Ask HN: python vs. php for web projects
Hi all,
My co-founder and I are working on several web projects, fishing for a new startup idea.
We've made our first prototype using django/python and we're working on our second using cake/php.
We'd like to stick to one language and/or framework. My co-founder and I are now disagreeing as to which language and which framework to move forward using.
We're pretty new to building production sites from scratch, so my question to the community is:
what are the advantages/disadvantages to using python vs. php vs. django vs. cake-php vs. other?
Thanks!
14 comments
[ 3.0 ms ] story [ 54.1 ms ] threadIf there's no consensus there, then make a decision based on the strength of your framework's community, quality of your framework's documentation, and the availability of good libraries for what you anticipate doing.
- PHP seems to have more security problems, so you should probably avoid it if security is important for your app.
- PHP is simpler to deploy, which might be important if you want to distribute your code for deployment by other people (eg. CMS, blog engine...)
In terms of overall design, Python is mostly well thought-out -- PHP feels more like things were bolted on haphazardly. Also, some of the nuances about how types work in PHP just blows the mind...
Also, I'd ask around in the community a bit -- ask 10 startups that are on PHP vs 10 startups that are on Python if they'd stick with their language for a new startup or product. I'd bet hands down the Python guys outnumber the PHP guys.
My thoughts on your question: I am a developer first, so I tend to forget the most important part of the business-have one! If your product isn't launched, you don't have a business just yet. Therefore, if using cakePHP can get your stuff out faster and with a simpler server setup, go for it. If you're comfortable with both (Django & CakePHP), then choose Python. It's easier to fix a painting when you make the first stroke. It's that blank canvas that scares us all. Go ahead, make the first stroke. Do the prototype in PHP if you can do it faster. Once the logic is written in one language, it doesn't take that long to redo it in another language. At least that's how my experience had been.
Good luck and hope you resolve your disagreement soon. There's no time to waste.
You can imagine what kind of solutions people will come up with when the standard library is anemic (compared to python) and it was difficult rely on certain "standard" 3rd party libraries.
Python folks rarely had to deal with the shared hosting issues (until very recently) and by virtue were freer in what they could install and how they could secure the system.
As a long time PHP developer (but dabbler in many others) I really can't thank Rails enough for forcing the PHP community to really push PHP libraries/applications forward.
Cross pollination FTW
But for a startup? Means nothing pretty much. Whichever helps you execute best. If it takes 10x longer to learn Python compared to PHP, do you really want to switch to Python? Or vice versa due if your founder has to learn PHP?
I don't think that's true. I have been part of both the ecosystems, and Python has equal (if not better) support in terms of libraries.
You should go with what ever the one of you does the most coding prefers.
There are new languages popping up every day, each with legions of fans telling you why the new language is better than everything else.
In the end you can either spend your life being mediocre at every new fad language that comes out, or you can learn one language, and learn it well.
As for me, I'm primarily a PHP man, but I do like Ruby as well. Of course my opinion doesn't matter, it's about what works best for you as a team :)
Some comparisons:
http://wiki.python.org/moin/PythonVsPhp
http://www.quora.com/What-are-the-advantages-of-learning-to-...
http://news.ycombinator.com/item?id=1507999
All that being said, I agree with everyone else, the most important thing is to make the developer comfortable.