Should I learn Ruby or PHP?

bitt3n

Senior member
Dec 27, 2004
202
0
76
I want to make some scripts for a website, and my background is only C, so I need to learn a scripting language. PHP seems to be the most popular, except I've heard from some forums like slashdot that Ruby is much better. However I'm afraid if I learn Ruby it will be harder to find people to help me should I have questions or problems with anything major.

I want to know whether I should go the tried-and-true Apache MySQL PHP approach, knowing that I'll be able to get help easily and can even pay someone to help with parts of the coding if it comes to that, or I should go the Ruby on Rails approach and learn a language that many people consider superior, but that is far less common.

Also I am wondering if anyone has ever used or has any opinions about XAMPP (http://www.apachefriends.org/en/xampp-windows.html#641), which is apparently an easy way to install AMP.

Also I was wondering what the benefits and drawbacks of using a Linux versus XP installation of AMP are. Is there some kind of licensing fee for usnig AMP on XP or something? Why does everyone use Linux?

Finally if anyone has any good book suggestions on any of these topics, I would love to hear them.

Thanks for your suggestions!
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
As an experienced C programmer, you should have no trouble picking up any scripting language. I'm partial to PHP, although I've tried only a few others. On AT, you will able to get more help with PHP than with anything else.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Ruby is the hot thing right now, but PHP has been around for a while. I'd recommend perl. :p

People use Linux because it's more suited to server things. PHP, Apache, and MySQL are developped on and for unix-like systems (like Linux or BSD), Windows is an after thought. Linux typically has those server utilities you need like good remote administration, tcpdump, and a highly configurable firewall. Windows XP doesn't.
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
Originally posted by: Zugzwang152
On AT, you will able to get more help with PHP than with anything else.
that seems to confirm what I figured, namely that PHP is the better route, even though everyone tells me Ruby is a better language.

Originally posted by: n0cmonkey
People use Linux because it's more suited to server things. PHP, Apache, and MySQL are developped on and for unix-like systems (like Linux or BSD), Windows is an after thought. Linux typically has those server utilities you need like good remote administration, tcpdump, and a highly configurable firewall. Windows XP doesn't.
if I do my script coding on AMP running on XP, will I be able to port it over to LAMP when I'm finished? I'm running XP and I've never run Linux, so I'm thinking of using XAMP to learn how everything works and at least do some of the coding, and then worrying about getting a Linux boot drive later. Do you think might not be the best idea?
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
How is ruby a "better" language? Ruby lends itself to certain things (namely file manipulation to my knowledge) but PHP is a good all purpose language with its various modules availible and connecting it up to a db it couldnt be any easier. PHP isn't as "fast" at times, but learning it is definately easier and imho more useful.

ive never had any problems with programming anything in php on an IIS system and then transfering it over to a Linux system. If you want to use your windows great, if you want ot use lamp/xamp great. PHP its pretty universal so that if you program it in one space transfering it over to another isn't much of an issue.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: bitt3n
Originally posted by: Zugzwang152
On AT, you will able to get more help with PHP than with anything else.
that seems to confirm what I figured, namely that PHP is the better route, even though everyone tells me Ruby is a better language.

Originally posted by: n0cmonkey
People use Linux because it's more suited to server things. PHP, Apache, and MySQL are developped on and for unix-like systems (like Linux or BSD), Windows is an after thought. Linux typically has those server utilities you need like good remote administration, tcpdump, and a highly configurable firewall. Windows XP doesn't.
if I do my script coding on AMP running on XP, will I be able to port it over to LAMP when I'm finished? I'm running XP and I've never run Linux, so I'm thinking of using XAMP to learn how everything works and at least do some of the coding, and then worrying about getting a Linux boot drive later. Do you think might not be the best idea?

I think as long as you aren't trying to serve from XP you'll be fine. I can't imagine doing any server work on XP, but writing a webpage isn't a big deal.

PHP/MySQL should be PHP/MySQL everywhere.
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
Originally posted by: Drakkon
How is ruby a "better" language?
This is what I've read on slashdot (http://developers.slashdot.org/article.pl?sid=05/12/14/0034219&tid=156&tid=8):


Ruby on Rails provides a far superior solution for web sites than PHP in many cases. It would be excellent if it ended up usurping PHP for most PHP-based sites.

PHP's bad reputation with regards to its security is, unfortunately, harming the open source community. Managers who are considering switching to open source solutions are hearing about the security flaws in PHP, and mistakenly thinking that Apache, MySQL and Linux are insecure (due to the popular 'LAMP' association). Of course, that isn't the case by a long shot.

Regardless of what people switch to, the main focus needs to be on moving away from PHP. Ruby on Rails provides a rapidly maturing alternative for building all sorts of web sites.

also

I have been writing some internal web applications for my corporation using Ruby on Rails. I will never go back to PHP or ASP.NET. Ruby on Rails lets me write things in 10 hours it would take me 50 hours to write in PHP. The framework is set up to make it easy for you to re-use code and stylesheets so you don't end up writing the same stuff over and over. I've written much more PHP code than Ruby code but I am already much more productive in RoR.

I love how small and compact RoR apps are. You end up with less lines of code and therefore project maintenance is so much easier. The "migrate" class is amazing. Gives you version control for your database schema. It really speeds up the development cycle.

Not only that but Ruby on Rails is fun to program in! Everything is so squeaky clean and organized. It gives you a good feeling and is much more readable than the old spaghetti code I used to write in PHP. Ruby on Rails has templating built in so you don't have to go install and learn some third party template program. I love it. I am so much more productive I am blowing away the other web developers who write in non-RoR frameworks. They have no chance at competing with me.
These types of opinions make me worry about choosing PHP over Ruby, even considering that it would be a lot easier for me to get help with PHP on AT. Because I have no knowledge of either language I am somewhat at sea on what to do, but your advice is certainly useful.

incidentally someone suggested this as a means to overcome some of the drawbacks of PHP relative to Ruby: http://www.symfony-project.com/ Has anyone used this perhaps?

Right now I'm starting to learn PHP basics, and I might learn a bit of Ruby too before I decide to go one way or the other.
 

itachi

Senior member
Aug 17, 2004
390
0
0
it really depends on what your needs are.

i've written cgi apps in c, servlets in java, and toyed around with struts and jsf.. c was the simplest for me to write, but it scales horribly.. java is far easier, but html mixed with code isn't exactly a pleasant thing to see.. its really easy to write a small page in it tho. struts and jsf both enforce mvc (model-view-controller) design patterns.. the controller is the front-end for the app, the model does the processing, and the view displays the results.
the view and controller represent the presentation layer and the model represents the business logic. splitting it like that makes the code a lot easier to read, and simpler to modify.

rails enforces mvc design patterns.. and reduces the amount of code you have to write when compared to java. php is based on the view. if you're just trying to make a little site without any relational database (where rails shines), it'd probably be easier to do in php.. especially with the larger amount of help available.