PHP or Rails...

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
I know it is very opinionated (which is why I'm asking your opinions), but what do you guys think would be better for this website:

open source, so maintainability is important
development speed, I don't want to spend forever get something usable up
expandability, new features will be added on periodically
AJAX
multi-language support (interface and back end)
complex searching algorithms (it is a type of search engine for language learners)
database connectivity (probably just mysql)
performance is needed but the site will never be hugely popular

I've read a lot of good things about RoR, but I'm familiar with Perl and more C-Like languages, so going the PHP route would have less of a learning curve. But, I'm not a professional and having help in areas of expandability and ready-made packages (gems) would be nice.

any suggestions?
 

Ka0t1x

Golden Member
Jan 23, 2004
1,724
0
71
I do PHP/Oracle as a day-job, as well as PHP/MySQL development. I recently did a senior project for my degree using Rails. The learning curve isn't really that bad and there is a wealth of information out there. And I will have to say that the development time once you learn the basics is simply fantastic. Nine weeks (part-time) to produce a fully functional website while knowing nothing about Rails.. not too shabby. Twitter had some major issues with scalability, but at the same time that was back in 2007, and improvements have been made, as well as the massive amount of traffic Twitter generates.

Rails is a framework whereas PHP is simply a language, unless you're using CakePHP, symfony, CodeIgniter.. etc. So doing basic operations would require writing your own API to smooth things out.. which also isn't too bad using PHP's OOP schema. In rails you have gems like Authlogic (user authorization, salted hash) and Paperclip (image uploads) that make things worlds easier.

It would also depend on where you wanted to host the site and how much you wanted to pay..

My vote would be Rails.

Useful Information:
http://railsenvy.com/ -- Podcast
http://railscasts.com/ -- Screencast
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
I would go with Rails all the way. With Phusion Passenger being stable now it's trivial to deploy Rails app onto an Apache/Mysql application stack.

Having a powerful ORM to interface with that abstracts away the database entirely from the programmer makes writing applications much faster. Especially since if you do everything the 'rails' way you don't have to worry about certain security issues like SQL Injection.
 

Cogman

Lifer
Sep 19, 2000
10,283
134
106
AFAIK Rails is considered by most to be a superior language. However, PHP has much wider spread adoption.

If you plan on working with others websites, PHP would be good to know. However, if you are starting your own website, then I would recommend using rails if possible.
 

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
AFAIK Rails is considered by most to be a superior language. However, PHP has much wider spread adoption.

If you plan on working with others websites, PHP would be good to know. However, if you are starting your own website, then I would recommend using rails if possible.

i've got a little bit of PHP knowlege, so thats why i was leaning a bit towards it. but, from the looks of it Rails will be much simpler to manage over the long haul, which is pretty important to me. also, ruby has a larger stronghold in Japan which is good for me (job purposes). can't hurt to know another language :p

i haven't decided yet, but any ruby nuts out there know of some good beginner's guides? i still don't understand scaffolds or any of the neat stuff RoR has...
 

Ka0t1x

Golden Member
Jan 23, 2004
1,724
0
71
There's a screencast on the Rails website.. the Blog in 15mins, it will explain a lot of how the system works in a very short time.. I'd suggest doing this tutorial.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I still find it hard to adapt rails to existing databases. It just never seems clean. Most examples seem to want to use some kind of active record implementation and that just doesn't work with the database provided to us.

For sites built from the ground up for rails, I love rails. Otherwise I'm not a fan of any of the rail like frameworks.
 

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
I still find it hard to adapt rails to existing databases. It just never seems clean. Most examples seem to want to use some kind of active record implementation and that just doesn't work with the database provided to us.

For sites built from the ground up for rails, I love rails. Otherwise I'm not a fan of any of the rail like frameworks.

well, this could pose problems. i've got a large database of words and translations (its a dictionary) there are lot of funky formats and stuff like that... wonder if it'll cause problems...
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
well, this could pose problems. i've got a large database of words and translations (its a dictionary) there are lot of funky formats and stuff like that... wonder if it'll cause problems...

Well in order for Rails to work automatically your names of tables and columns need follow the naming conventions as well as having id columns for any tables that are going to be used in relations.

With the names you can always override the 'expected' value by rails with declarations within each class.

I would check out that 15 minute tutorial to give you an idea of what's going on before you make your decision.

http://rubyonrails.org/screencasts
 

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
Well in order for Rails to work automatically your names of tables and columns need follow the naming conventions as well as having id columns for any tables that are going to be used in relations.

With the names you can always override the 'expected' value by rails with declarations within each class.

I would check out that 15 minute tutorial to give you an idea of what's going on before you make your decision.

http://rubyonrails.org/screencasts

i checked out that screencast. lots of neat stuff, but it didnt have any info on how it connects to the DB. I saw some generated SQL when he was debugging, but that was it. how does it know what DB to connect to and what info to use?
 

MooseNSquirrel

Platinum Member
Feb 26, 2009
2,587
318
126
I also recommend you take a look at Django (Python framework).

Really easy to work with AND great documentation.

Don't buy into the language "religion".

Python is nice though.
 

Ka0t1x

Golden Member
Jan 23, 2004
1,724
0
71
app/db/database.yml

Keeps all of your database connection information. Other than that the whole application is abstracted from the database.