walterbyrd — 2009-06-26T22:49:49-04:00 — #1
As a language, I like Python better than PHP. But, for web development, I am afraid that python may not be a practical choice.
Python requires special, non-standard, expensive, hosting. This is especially true if you want to use one of the popular python frameworks, and frameworks are probably the most practical way to develop web sites with python. In the likely case that a client already has a host, and that host does not work with python; it may be difficult to tell a client that he/she will have to change hosting, and pay much more.
If you need to hire developers, you will find that python developers are much more difficult to find.
If you want a job as a web developer, you will find that python is not a commonly demanded skill. Demand for python web developers certainly lags far behind demand for PHP, .Net, Java, or RoR, developers.
Or is python such a great language, that it's worth all the extra trouble? Or, am I wrong about everything?
ruby_lang — 2009-06-26T23:37:56-04:00 — #2
Don't give up on Python so fast. It is certainly gaining traction, and hosting isn't all that much more expensive. Webfaction, to cite one, offers Python/Django for $9.50/mo (less if you pay in advance.)
If you plan to find a job in an area that isn't a technological hot spot or maintain pre-existing sites, then you won't escape from the triad PHP, Java, and C#, with the occasional RoR if you are lucky. But if you are creating your projects from scratch, Python is a great option.
alexdawson — 2009-06-27T03:57:59-04:00 — #3
It depends what you class as expensive hosting, many hosts now automatically include both ruby on rails and django (python) scripting as part of the package.
I am currently with mediaTemple and they offer RoR and Django containers at $20 a month (on top of the existing $20 a month you pay for hosting)... but for that you are getting dedicated resources over the usual grid / cluster hosting so your apps are going to be more stable as a result rather than them running just as part of a shared service, it's almost to the point of cloud hosting
walterbyrd — 2009-06-27T08:24:12-04:00 — #4
I can get PHP hosting for $10 a year.
alexdawson — 2009-06-27T08:28:20-04:00 — #5
Sure but PHP is designed for something totally different to Python.
If you are doing general purpose server-side scripting, PHP is file.
If you are making web applications or extensive multi-function scripts, python may be better.
ditch182 — 2009-06-27T08:37:06-04:00 — #6
I like python, a lot. But I know where you're coming from. My webhosts only allow python on the high end Dedicated Server plans. I use it mostly for prototyping and proof of concept stuff, but I think it's worth knowing and keeping in your toolbox.
stakes — 2009-07-03T03:15:19-04:00 — #7
[B]Is Python impractical for web development?
[/B]By itself, compared to PHP it would be highly impractical.
On a higher lever, with a framework like Django, it's extremley practical. I come from a PHP background and I can say I haven't really looked back, but there are some drawbacks (some of which you mention)
1) Hard for beginners
I'm self taught, and I've found the documentation and tutorials available for python are offen much more theoretical than practical, and to start with, it was hard for me to wrap my head around it. The people who write/work with python/django tend to discuss the language on such a high level that it's not even remotely interesting to me.
2) Code evolution
This is only applies to Django, about 90% of blog posts and articles I find about Django are outdated, because only since last year, there has been so many changes/upgrades to the the framework. For a beginner, it's really hard knowing what to believe and learn, thankfully though, the official django documentation is mostly really good, and their IRC channel is very friendly too
Like you mentioned, deploying a python/django website takes more trickery than just uploading a PHP file. You need more knowledge and time setting it up to run smoothly. As a result, finding web hosting that supports it, and knows how to run it well, is harder and maybe just a little bit more expensive to find. But those that DO host it, tend to be very good.
Having said all this, I've totoally falled in love with Python and Django, and once you get rolling, there's nothing stopping you
phazestone — 2009-07-27T11:00:25-04:00 — #8
Python is indeed very good for webdevelopment, nice language! I also was a Python fan before I saw Coldfusion going! The problems of the most Python web frameworks are:
- You need to have some OOP knowledge.
- Not easy to learn.
Coldfusion takes rid of this problems! It is possible to use OOP (CFC's) but it's not necessary.
yahn — 2009-07-27T20:53:48-04:00 — #9
You could set up a server yourself. It's not that hard.
waverider — 2009-07-29T04:42:24-04:00 — #10
We're currently doing web development with Python and Django and I wouldn't go back to PHP :).
Hosting is indeed a but tricky. But there are shared hosts that support running Python with Fastcgi. And also VPS prices are going down and you can have a more than decent full root machine for $10 a month.
felgall — 2009-07-29T15:52:15-04:00 — #11
Free hosting through Google for your Python apps isn't all that expensive (unless you get so many visitors that they actually do start charging you for it).
codefisher — 2009-08-07T06:58:02-04:00 — #12
When I chose what I am going to use for a project Python vs. PHP it comes down to scale. If it is small, it is normally far faster to hack something together in PHP.
However if it is something larger, take for example the current site I am working on ~12000 lines of python. I could never maintain that by myself in PHP, in python I find it easy.
If which one you chose really comes down to who/what you are. Single programmer who knows both and your working on you own thing and it is going to be something non trivial Python I think is a better choice.
If your going to pay someone else to write something for you, Python may not be the correct choice because of the problem finding developers who can use it.
Also Python is only now really starting to gain traction, so all the tools to make it easier don't exist yet.
That Python frameworks are OOP based is a good thing. It might be a hurdle for beginner programmers doing small sites, but if your doing something much larger it makes a lot more sense. The amount of code I chose to write as OO has been roughly linked to my experience as a programmer.
stomme_poes — 2009-08-12T05:38:45-04:00 — #13
Perl has this same problem, as far as the hosting. Often, they may even say "yeah we have perl (or python)" and it turns out they have some very old version with no modules. Often you need root access to load your desired modules.
One solution is some package you can get loaded onto the server that can load all the other stuff for you. A bit more palatable for the GoDaddies out there. I've seen some for Perl and I would think there are packages for Python that do the same thing.
While it's likely true you won't find Python guys running around as much as PHP guys, I think in general you would get higher quality guys period if you use Python. The shear number of available PHP guys doesn't mean much if they're very low level. Compare instead the number of available Pythong guys to the number of PHP guys who can code to high standards, preferably also with knowledge of one of the other OO programming languages too. They may even up more.