It's important to differentiate between the technical ability to build web applications and the craft of programming. It seems you are interested in the former, in which case I would recommend learning a popular framework (Ruby on Rails or Django). While you are learning a framework you'll pick up the base language just fine.
If you'd like to learn the more general craft of programming, Peter Norvig has some excellent advice: http://norvig.com/21-days.html. You'll find some language recommendations in the appendix.
Personally I tried Ruby on Rails and I did not like it. There was too much magic going on and it was confusing to a beginner like myself. I thought about Django but I got the impression that it is just "Python on Rails", so I stayed away from that too. I ended up going with web.py, and I enjoy it. I understand what is happening and what all the pieces of my program do.
It's not for everybody. There are fewer plug-ins for the framework and doing things like session management is a little harder than in Rails. The community is small (though the Google group is active). I had to spend 10 or 20 hours learning sqlAlchemy instead of having an DBORM handed to me out of the box.
But it is far easier to create a complex web app that breaks the Rails/Django paradigm. Reddit uses web.py.
There are some cool open source projects on Github that can get you started:
Please note that my experience may have been better because I already logged a thousand lines or so in Python before diving in (which reminds me of a great free book for learning Python - "Dive into Python").
i disagree a little with the advice above as a recommendation for the original poster. i'm not saying that web.py is better or worse than django or ror, but i think that as a "learning experience" it's probably better to go with one of the larger packages. learning to use a big package will teach you a lot. once you have that understanding, sure, go with web,py and cut your own path.
I was in a similar situation to you earlier this year, in that I was trying to decide between Rails and Django. I ended up going with Django, but I don't think there will be much effective difference to you regardless of which one you choose. Both platforms are good for building web apps and both languages will help you learn new concepts. I went with Django because of the wealth of documentation abailable online and the fact that I have personal resources to tap on Python (although I've used mostly online documentation for that as well).
If you end up going with Django, feel free to email me with questions. I'm sure I can help with some of the "simple" and "stupid" things that can trip up newbs for disproportionate amounts of time.
choose whichever your friends use, or whichever community you find friendliest, or whichever has the documentation you prefer. technically, either is fine.
Despite what a lot of people will tell you ;) Python isn't really a web app language (really, at all, in the slightest). Stick with PHP or learn RoR.
In all seriousness if a web app is your aim, and you have on in mind, then stick with what you know and get good at it - it will suffice :) at the end of the day there is no particular limitation with PHP that RoR or Python will solve - if you get the point of having to worry about scaling etc. then they all have the same issues/solutions :)
EDIT: if your going to disagree that's great! But lets hear some reasoning - there is no logical reason to pick Python to learn from scratch if you already know PHP and wish to start a web app. Seriously speaking it's a waste of time; python is a killer language (and by far my favorite) but PHP and RoR are much saner choices for a web app :)
Python is a mature language with solid implementations, top-class web frameworks, an above average user community, and hundreds of libraries that do pretty much any thing you want.
But im not deriding Python per-se (indeed I believe it is a fantastic language and the vast majority of my code is in Python).
However when you consider it in the situation of a Web App (i.e. running under Apache or another web server) it loses most of the advantages. Not to make it worse - but if you know PHP there is no huge benefit for switching to Python :) Which is what the OP is asking "should I learn a new language to make a web app in". I'd say no, not if PHP serves you fine! :)
On the other hand if you want a general purpose language to hand then, yep, Python is ace.
(despite all that when programming for the web I still prefer PHP, because, well that was what it is designed for).
I wrote a PHP app back in the day. It was small and messy, had code strewn all throughout the HTML. Hell, I didn't even know how to run a PHP script without loading an URL in the web browser.
That's not necessarily a fault of the language, but the books available for PHP taught me how to code that way. And the community was in a perpetual state of newbishness. At least in 2005, the IRC channels were dominated by people (like me) who one day though "I have no programming experience but I would like to make a web app. I know! I'll use PHP!". PHP can be programmed well, but it was hard to find someone in the community to point you in the right direction.
Facebook proves that large, successful web apps can be built with PHP. But PHP was probably not Zuckerberg's first or only programming experience.
As for your contention that "Python isn't really a web app language (really, at all, in the slightest)", that's just straight stupid, and doesn't deserve a further response.
> As for your contention that Python is not good for web apps, that's just straight retarded and doesn't deserve a further response.
Im not sure that contends a good reverse argument ;) but anyway... (I do stand by the statement somewhat though; it was never designed to be a web language but as a general purpose successor for ABC, any web implementations are incidental and I still contend that it cant beat purpose built "for the web" languages :))
It's a difficult call all round. I used to code PHP that way - but one good book (I forget which) and some experience with Frameworks cured me of it. It's probably similar for other languages; the person I know best who swears by Django does pretty much the same thing (horrible code)
Not good for web apps is perhaps not the point I was making (it got confused in trying to be concise). More Im saying that if the OP is sat there knowing some PHP and wondering where to go next if his aim is to make a web app I would say: go make a web app in PHP. There is no killer advantage that makes Python better for the web than PHP (for me PHP is better for the web - but that is a somewhat subjective choice).
if his prime aim is to learn a new language - and he also wants to make a web app RoR is a good choice. Again because it is tailored for the web.
If he wants to learn a language and wants something general purpose which also will do him for web work Python is a great choice.
To make things even less clear; if you want to do something specialist Python is probably your "best foot forward".
The problem with Web apps is that the web server is by far the greatest leveller. It removes any clear advantage Python has over PHP :)
I am mid/high experienced in Ruby, Python and PHP and I personally would say PHP was the best choice for a basic web app with Python bringing up a very close rear :)
Comments
It's important to differentiate between the technical ability to build web applications and the craft of programming. It seems you are interested in the former, in which case I would recommend learning a popular framework (Ruby on Rails or Django). While you are learning a framework you'll pick up the base language just fine.
If you'd like to learn the more general craft of programming, Peter Norvig has some excellent advice: http://norvig.com/21-days.html. You'll find some language recommendations in the appendix.
Between starting with Ruby on Rails or Django with Python, is one better to start with than the other?
Personally I tried Ruby on Rails and I did not like it. There was too much magic going on and it was confusing to a beginner like myself. I thought about Django but I got the impression that it is just "Python on Rails", so I stayed away from that too. I ended up going with web.py, and I enjoy it. I understand what is happening and what all the pieces of my program do.
It's not for everybody. There are fewer plug-ins for the framework and doing things like session management is a little harder than in Rails. The community is small (though the Google group is active). I had to spend 10 or 20 hours learning sqlAlchemy instead of having an DBORM handed to me out of the box.
But it is far easier to create a complex web app that breaks the Rails/Django paradigm. Reddit uses web.py.
There are some cool open source projects on Github that can get you started:
http://github.com/alexksikes
Please note that my experience may have been better because I already logged a thousand lines or so in Python before diving in (which reminds me of a great free book for learning Python - "Dive into Python").
i disagree a little with the advice above as a recommendation for the original poster. i'm not saying that web.py is better or worse than django or ror, but i think that as a "learning experience" it's probably better to go with one of the larger packages. learning to use a big package will teach you a lot. once you have that understanding, sure, go with web,py and cut your own path.
I was in a similar situation to you earlier this year, in that I was trying to decide between Rails and Django. I ended up going with Django, but I don't think there will be much effective difference to you regardless of which one you choose. Both platforms are good for building web apps and both languages will help you learn new concepts. I went with Django because of the wealth of documentation abailable online and the fact that I have personal resources to tap on Python (although I've used mostly online documentation for that as well).
If you end up going with Django, feel free to email me with questions. I'm sure I can help with some of the "simple" and "stupid" things that can trip up newbs for disproportionate amounts of time.
choose whichever your friends use, or whichever community you find friendliest, or whichever has the documentation you prefer. technically, either is fine.
Despite what a lot of people will tell you ;) Python isn't really a web app language (really, at all, in the slightest). Stick with PHP or learn RoR.
In all seriousness if a web app is your aim, and you have on in mind, then stick with what you know and get good at it - it will suffice :) at the end of the day there is no particular limitation with PHP that RoR or Python will solve - if you get the point of having to worry about scaling etc. then they all have the same issues/solutions :)
EDIT: if your going to disagree that's great! But lets hear some reasoning - there is no logical reason to pick Python to learn from scratch if you already know PHP and wish to start a web app. Seriously speaking it's a waste of time; python is a killer language (and by far my favorite) but PHP and RoR are much saner choices for a web app :)
Python is a mature language with solid implementations, top-class web frameworks, an above average user community, and hundreds of libraries that do pretty much any thing you want.
Ergo: it is fine to use with web apps.
But im not deriding Python per-se (indeed I believe it is a fantastic language and the vast majority of my code is in Python).
However when you consider it in the situation of a Web App (i.e. running under Apache or another web server) it loses most of the advantages. Not to make it worse - but if you know PHP there is no huge benefit for switching to Python :) Which is what the OP is asking "should I learn a new language to make a web app in". I'd say no, not if PHP serves you fine! :)
On the other hand if you want a general purpose language to hand then, yep, Python is ace.
(despite all that when programming for the web I still prefer PHP, because, well that was what it is designed for).
I wrote a PHP app back in the day. It was small and messy, had code strewn all throughout the HTML. Hell, I didn't even know how to run a PHP script without loading an URL in the web browser.
That's not necessarily a fault of the language, but the books available for PHP taught me how to code that way. And the community was in a perpetual state of newbishness. At least in 2005, the IRC channels were dominated by people (like me) who one day though "I have no programming experience but I would like to make a web app. I know! I'll use PHP!". PHP can be programmed well, but it was hard to find someone in the community to point you in the right direction.
Facebook proves that large, successful web apps can be built with PHP. But PHP was probably not Zuckerberg's first or only programming experience.
As for your contention that "Python isn't really a web app language (really, at all, in the slightest)", that's just straight stupid, and doesn't deserve a further response.
> As for your contention that Python is not good for web apps, that's just straight retarded and doesn't deserve a further response.
Im not sure that contends a good reverse argument ;) but anyway... (I do stand by the statement somewhat though; it was never designed to be a web language but as a general purpose successor for ABC, any web implementations are incidental and I still contend that it cant beat purpose built "for the web" languages :))
It's a difficult call all round. I used to code PHP that way - but one good book (I forget which) and some experience with Frameworks cured me of it. It's probably similar for other languages; the person I know best who swears by Django does pretty much the same thing (horrible code)
Not good for web apps is perhaps not the point I was making (it got confused in trying to be concise). More Im saying that if the OP is sat there knowing some PHP and wondering where to go next if his aim is to make a web app I would say: go make a web app in PHP. There is no killer advantage that makes Python better for the web than PHP (for me PHP is better for the web - but that is a somewhat subjective choice).
if his prime aim is to learn a new language - and he also wants to make a web app RoR is a good choice. Again because it is tailored for the web.
If he wants to learn a language and wants something general purpose which also will do him for web work Python is a great choice.
To make things even less clear; if you want to do something specialist Python is probably your "best foot forward".
The problem with Web apps is that the web server is by far the greatest leveller. It removes any clear advantage Python has over PHP :)
I am mid/high experienced in Ruby, Python and PHP and I personally would say PHP was the best choice for a basic web app with Python bringing up a very close rear :)
How is Rails "tailored for the web" in a way that Django is not? Marketing?