Ruby, Python or PHP?

Status
Not open for further replies.

stonelove

New member
Jan 9, 2008
39
0
0
Which one is better for building simple web apps on hosted services like Amazon or the new Google App engine?

I'm all set to begin learning Ruby when I came across these post today - Ruby’s not ready - glyphobet • глыфобет • γλυφοβετ and Hacker News | Ask YC: Python vs. PHP

It's enough to make me want to scream. Now bear in mind i'd like to learn a language that is scalable later, especially if the app I build proves to be popular. What I've seen so far indicates that although Ruby might be easier to get started, apps built on Ruby can run into problems later on when dealing with issues of scale.

So what would you suggest a newbie programmer pick as a language of choice for building web apps in 2008? Ruby? Python? Php?
 


i've been using python's django. personally i love python and once you are familiar with django, development time can be very fast. i think the same can be said for ruby, but i've heard bad things about performance.

that said, php is probably best suited for most projects. php is not going anywhere.

python is definitely not suited for shared hosting enviroments. my django apps are running on lighttpd and fastcgi on a dedicated server.

i don't really know anything about google's app engine but i wouldn't go near it.
 
id say php+mysql is the easiest to learn and most scalable but ive never used Ruby or Python so im probably bias..
 
I don't post too often anymore but I thought I'd chime in on this thread. From what I heard about Google App engine it will only allow Python. If you're using a shared host, PHP is the best solution hands down.

As far as that "Ruby isn't ready" post, that guy doesn't know what he's talking about at all. I've used Ruby for tens of production web applications. Sure it has some issues but the blog post talking about how Ruby isn't ready is ridiculous. Would you listen to someone who had a week of Ruby experience over someone with years of Ruby experience? Probably not.

Python has a ton of web frameworks and choosing one isn't something to be taken lightly. If you want to go down this path, implement simple web apps in each of the major Python web frameworks and pick the one you like best.

All of the above depends on what you want to do. Do you want to be an expert in your technology of choice or just learn enough to make a little money online?

I'd also like to point out that Ruby does scale. If you ever run into having so much traffic that you need to scale you're going to have issues with every technology at some point.

Ruby is only getting better. It's getting faster and Rails is becoming battle hardened.

Good luck on your journey.
 
I'd say unless you need threading in your apps a lot I'd go with php. If you need a lot of threading and your doing things like heavy scraping/posting then I'd learn Python. There's quite a large python movement being pushed by google so I'm guessing that's going to become the next biggie.

But one thing to consider is if you ever plan on working with people on this board or IM then the common language for writing apps is definately PHP. PHP maybe poor when it comes to objects and threading but it's getting better all the time.

As far as rails I just don't see it having a place yet. Most of the people using it are early adopter techies that want to be cool by using the flavor of the month.
 
Of the three, I'd say python would be the best starting point. You can easily pick up PHP later.

If you're just starting, I'd highly recommend learning C first. It'll make you a better programmer. It shouldn't take too long to master the basics and you'll be able to move on to python pretty quickly.

I learned Javascript, Perl, Python, PHP, (in that order) before I forced myself to learn C (then C++, Java) and I wish I hadn't waited so long. C is by far the most fun of all of them and you can do some wicked-fast shit with it on *nix and windows

If you start with PHP you may mistake it for a real programming language instead of the POS that it is. Unfortunately, you'll eventually have to learn it if you are in web development but it won't be difficult after you've learned python (and/or C)

Javascript (for things like real-time form validation and AJAX) and Perl are two more languages I'd recommend learning. Ruby takes a lot from these two so if you learn them first you'll be able to pick up Ruby pretty quickly.

Recommended books/documentation:

C Primer Plus (you can get this cheap on amazon)

python.org documentation

Learning Perl
Programming Perl 3rd edition
activestate.com (download perl, documentation is included)

JavaScript - MDC

php.net


You don't have to spend a lot on books when starting, there's plenty of online documentation.

You can use an all-in-one install to get apache,php,and perl running for local development and testing but I highly recommend installing apache, python, php, perl by downloading and installing each seperately, it's really not that difficult and you'll get a better understanding of each

For learning C, you can use DevCpp (google it), it's fairly easy to use.


The key is getting the basics down. Variables, control structures, loops, functions (or subroutines, etc), etc., after that learning a new language is basically picking up it's syntax and style (that doesn't pertain to C++ and Java, they are a little more difficult but much more powerful)


Good luck
 
C is a bit hardcore for web development. You only need C if you intend to become a programmer for a career. For web development, there's nothing you would need C for except for hard core crunching that you can't scale otherwise, like SNMP polling, extensive graphics manipulation, etc. And you'd go for C++, not plain-old C. There is a difference.

I personally use PHP, and I've been able to do anything I've wanted in it, except for the stuff Flash is good for -- graphic games.

PHP is easy to learn, but it's easy to learn it poorly and use it insecurely.

I've heard proponents of Ruby and Python talk about how superior their systems are, but it usually ends up being a debate over the specific frameworks and development styles of each person. All are valid web development platforms and they will all take you very far.

Personally, I'd say you should look at each underlying language first (PHP, Python, Ruby) and then look at the frameworks (Cake is a popular PHP framework; Django for Python; Rails for Ruby of course).

Looking through tutorials for each should take you 1-2 days, and you should start getting a feel for which one would be best for you. Take the time to do the research; it's worth it.

However, my personal recommendation is PHP. TONS of open source and commercial web apps are written in php (phpBB, vBulletin, WordPress, Joomla, MediaWiki, Zen Cart, Coppermine, Gallery2, and many many more) so ergo there are a LOT of people out there who know PHP, write tutorials for PHP, and are actively developing on PHP.

How many open source web apps are out there for Python? Ruby? I can't think of any single well-known open sourced app in either of them, but I haven't actively sought them out either.
 
C is a bit hardcore for web development. You only need C if you intend to become a programmer for a career.

It's not about learning it for web development, it's about learning the fundamentals of programming. And C is NOT difficult to learn.


For web development, there's nothing you would need C for except for hard core crunching that you can't scale otherwise, like SNMP polling, extensive graphics manipulation, etc.

Bullshit!

I've written a shitload of web apps in C. Some standalone and some that work alongside Perl and Python apps like web services that utilize SQLite, MySQL, etc., etc.

And you'd go for C++, not plain-old C. There is a difference.

You don't know what the fuck you're talking about, STFU


However, my personal recommendation is PHP. TONS of open source and commercial web apps are written in php (phpBB, vBulletin, WordPress, Joomla, MediaWiki, Zen Cart, Coppermine, Gallery2, and many many more)

And the open source web apps have to be updated and patched on almost a daily basis because of the numerous security flaws.

Try managing a bunch of sites filled with that open source PHP shit, you'll spend all of your time updating/patching, removing spam, and trying to figure out how your site was hacked.

The reason PHP is so popular is that it basically took the "programming" out of programming and because of the ease of integrating the code into an html page.

so ergo there are a LOT of people out there who know PHP.

But very few know proper programming techniques because they learned that junk "language" first.

How many open source web apps are out there for Python? Ruby? I can't think of any single well-known open sourced app in either of them, but I haven't actively sought them out either

lol


I agree that PHP is currently the the most popular option, but that's just because anyone who can learn a few functions and echo "I is a interwebs programmer" can use it.
 
I'd say unless you need threading in your apps a lot I'd go with php. If you need a lot of threading and your doing things like heavy scraping/posting then I'd learn Python. There's quite a large python movement being pushed by google so I'm guessing that's going to become the next biggie.

How significant is the performance difference between scraping/posting with Python vs. PHP?
 
C is a bit hardcore for web development. You only need C if you intend to become a programmer for a career. For web development, there's nothing you would need C for except for hard core crunching that you can't scale otherwise, like SNMP polling, extensive graphics manipulation, etc. And you'd go for C++, not plain-old C. There is a difference.

:rasta::rasta::rasta:
i want what ever you are smoking must be some good shit.
Make a binding for curl lets say, to language X (insert ruby,python,lua,lisp,php) without knowing C.
 
Language wise, all of them have thier pros and cons.
Personally i do not like PHP
I like ruby and python.

Buy 3 books 1 on PHP,ruby and python, read each one and see which language u like best
 
I used to code C in System V (looong time ago). What a pain in the ass that was. It's cool to learn new languages and all, but I am most interested in the almighty greenback so outsource & scale!
 
My vote is for PHP, for a few reasons.

1. Very mature - probably the most common scripting language on the internet
2. A number of very powerful frameworks available. My favorite is CodeIgniter/KohanaPHP, but there is CakePHP, Symfony, and many more.
3. Getting help/support is easy because it's so widespread
4. PHP more closely resembles more traditional style programming languages - which some look at as a weakness of the language, I say it's a strength.
5. Depending on where you go in your a career, you can easily translate php skills to more 'enterprise' languages like Java or C# (.NET) because the syntax is very similar
6. A number of really good books out there to kick-start learning how to program

I could go on. Just pick php. You won't regret it.
 
How significant is the performance difference between scraping/posting with Python vs. PHP?

probably not that signifigant unless you are multi threading.

the big plus for me with python is time spent developing.
the syntax is very clean and concise vs. a language like java which is very verbose.

for scraping/posting in python checkout feedparser, BeautifulSoup, mechanize, xmlrpclib.
 
Definitely learn PHP - just take a look at job boards and craigslist and you'll see that it is the most in-demand language around. That way, if anything, you'll also become an employable programmer.

A friend of mine fell into the mistake of hiring a Ruby programmer who bulshitted him about all of the language's features etc. When that programmer jumped ship, my friend was left holding his dick, because you *cannot* find someone to develop in Ruby. And if you think that's not applicable to you, think about the time when you want to retire and can't find someone else to take care of your code....

And seriously don't contemplate using C for web programming. Just. Don't.
 
:rasta::rasta::rasta:
i want what ever you are smoking must be some good shit.
Make a binding for curl lets say, to language X (insert ruby,python,lua,lisp,php) without knowing C.
I don't need to write a binding.. I just have to compile PHP --with-curl and that shit is there ready to use. There are packages that include Curl already, but it's easier for me to compile myself; that way I get total control over what goes in my PHP.
 
It's not about learning it for web development, it's about learning the fundamentals of programming. And C is NOT difficult to learn.




Bullshit!

I've written a shitload of web apps in C. Some standalone and some that work alongside Perl and Python apps like web services that utilize SQLite, MySQL, etc., etc.



You don't know what the fuck you're talking about, STFU




And the open source web apps have to be updated and patched on almost a daily basis because of the numerous security flaws.

Try managing a bunch of sites filled with that open source PHP shit, you'll spend all of your time updating/patching, removing spam, and trying to figure out how your site was hacked.

The reason PHP is so popular is that it basically took the "programming" out of programming and because of the ease of integrating the code into an html page.



But very few know proper programming techniques because they learned that junk "language" first.



lol


I agree that PHP is currently the the most popular option, but that's just because anyone who can learn a few functions and echo "I is a interwebs programmer" can use it.
You're an idiot.
 
My favorite language to program in is python but I mainly program in php. Unlike what you will hear from a lot of people, php is not a perfect language but it is one of the best at what it does, web programming. I do agree learning C will make you a better programmer and even better than that assembly. But if your looking at doing web development only and nothing too fancy then that is really overkill like was mentioned before.
 
PHP, Ruby, AND Python. Learn em all :)

They all have their benefits, pro's and cons. Start with PHP to learn the basics. Move onto Ruby/Rails/python ---- it will be easier to grasp things there once you have done a few php apps.

In the end though you will probably do more stuff with php, and back end stuff with python/rails.
 
Status
Not open for further replies.