Why PHP Is Fun and Easy But Python Is Marriage Material

About This Blog

This site is for  entrepreneurs.  A full RSS feed to the articles is available.  Please subscribe so we know you're out there.  If you need more convincing, learn more about the site.



And, you can find me on Google+

Connect on Twitter

Get Articles By Email

Your email:


Blog Navigator

Navigate By : 
[Article Index]

Questions about startups?

If you have questions about startups, you can find me and a bunch of other startup fanatics on the free Q&A website:


Subscribe to Updates


30,000+ subscribers can't all be wrong.  Subscribe to the OnStartups.com RSS feed.

Follow me on LinkedIn


Current Articles | RSS Feed RSS Feed

Why PHP Is Fun and Easy But Python Is Marriage Material


I think a lot about choices and decisions at startups.  That is the life of a software entrerpreneur:  It’s a stready stream of hard work, occasionally punctuated by some really hard decisions.  The decisions that are hardest are not the ones where you have the least amount of information — they are the ones that are hardest to undo or reverse. 

By this defintiion, picking the language/platform to use at a startup is one of the harder decisions.  It’s very hard to change this decision.  Here’s the story of how I made not one but two big language/platform decisions, neither of which really worked out — and which I’m now paying the price for.  The good news is that the company did very well despite these mistakes for two simple reasons:  First, I didn’t make awful choices — just sub-optimal ones.  Second, success in the early days of a startup is much more about getting market validation and traction than anything else.  And, as it turns out, customers really don’t care whether your SaaS application is built in PHP, C#, Ruby or Python.

On with my story…

When I kicked off my startup, HubSpot, over 4 years ago (June, 2006) I wrote a set of articles on the topic of choosing a language/platform — specifically for startups.  At the time, I was trying to pick between C# and Python for my then fledgling startup.  The article was aptly titled, “Python vs. C#: Business and Technology Tradeoffs”.  The article was very widely read, and still continues to drive traffic (likely because it ranks #1 in Google for “Python vs C#”).HubSpot Labs Logo

I made some pretty good arguments in that article, most of which I still stand behind to this day.  We ended up picking C# at the time.  The decision came down to one strong, dominant factor:  I was more productive in C# than I was in anything else, and that mattered — a lot.  Why?  Because it was basically just me.  In the early days of a startup, you’re looking to mitigate unnecessary risk and get to market as fast as humanly possible.  Within reason, my general advice is  “go with what you know”.  By “within reason”, I mean if what you know is a relatively mainstream language (Python, PHP, Ruby, Java, C# etc.).  There are definitely times to learn new things and experiment with new technologies — the early days of your product development is not the best time.  Either you need to know the language/platfrom from soup to nuts yourself — or you need to have immediate access to people you can rely on, that do.  So, I picked C# and .Net — which frankly, if I had to do over, I wouldn’t have picked (more on that later).  But, based on my circumstances at the time, I thought I chose rationally, and I was solving for the company, not my ego or enjoyment.  The good news is that the mistake wasn’t fatal.  [Side note: Patrick, if you’re reading this, I’ll admit, you were right. I should write a follow-up article on this on the topic of trust].

A couple of years later, I was faced with a different decision.  I was working in HubSpot Labs.  HubSpot Labs is a “startup within a startup”.  We don’t have a written charter for HubSpot Labs (because frankly, I’m not exactly sure how to write one of those, or if I did, who would read it).  But, the idea was to build cool free tools (see http://grader.com).  These tools pulled in website visitors, increased visibility of HubSpot, and helped us get some interesting data that we used to benefit our core business.  At the time all this was happening, I was trying to decide between PHP, Python and Ruby.  I knew I wanted a dynamic language, and I had whittled things down to those three choices.  I picked PHP, and Python was my second choice.  Though Ruby/Rails would likely have been fine too, there’s something about it that I just found unnatural.  If I had a dog, the dog would bark at the Ruby code.  Python just feels more “natural” to me.  But that's likely related to my C/C++ background.  But, I digress.  Back to why I chose PHP: Main reasons were: 1) It was easy to get started.  2) It had decent OOP support.  3) There were lots of other people using it.  4) It was lingua franca on the web.  The language served me well.  It was an easy transition from my C++/C# days, and combined with an MVC framework like CodeIgniter, things weren’t too bad.  I actually had fun developing in the language, and after the first few months, I felt that the code I was producing was about as good as some of the code I’m most proud of throughout my professional career. 

I have a love/like relationship with PHP.  Sometimes I have good days, and sometimes I have great days.

During my 2+ years of PHP development, I launched a bunch of web applications.  Cumulatively, they’re getting millions of page views a month now.  Not bad.  No major issues.

So, you might then be wondering, why switch away from PHP and move to Python now?  Don’t I have better things to do with my time?  Did I give in to peer pressure or somehow decide I wanted one more chance at being one of the “cool kids”.  I’ll attempt at answering some of those questions.

Why HubSpot Labs Is Switching From PHP to Python

Here are some of the tradeoffs (PHP wins on some fronts, Python in others), for those faced with the decision now.  Note:  The context here is a startup that is a bit further along (HubSpot was 2 years old and had about 50 employees at the time of this decision).  But, some of the arguments still apply, even if you’re earlier stage.

1. Python is well designed, PHP is not.  Although PHP is a completely workable language — it’s still not an elegant language.  In the short to mid-term, that’s not a particularly big problem.  Any experienced developer that can create great software can likely also write really good software in PHP.  (I’m talking about PHP 5+ here — and ignoring all the ugliness that came before).  But, there are limits.  I’m not particularly bothered by the weird idiosyncracies of PHP (the “needle vs. haystack” problem).  I can get over that pretty quickly.  It’s the other stuff — which is deeper and more nuanced.  As a “classically trained” developer (undergrad CompSci), I appreciate that Python gets a bunch of the language stuff “right”.  It’s about how reflection is implemented.  How functions are first-class objects.  It’s all the little things, which in aggregate, make for better cleaner, more elegant code.  Although it’s perfectly possible to write good code in PHP, it’s much easier to write great code in Python.  It is clear that Python was architected to be a robust, well-designed and well thought-out language.  PHP “just happened”.  Not to knock PHP (I actually love working in PHP) — but Python is just a better language.  [Note:  I still am viscerally troubled by the using whitespace to indicate code structure, instead of just using braces like the rest of the sane world, but it’s a relatively minor gripe].

2. Python has a “clear” web framework winner:  Although conceptually I like having choices (and I believe in openness), practically, I really, really like standards.  All things being equal, I much prefer that all of us are working with the same frameworks and libraries.  Python mostly has that with Django.  It’s close to the de-facto choice for web frameworks in Python.  Maybe not quite as dominant as Rails in Ruby-land — but close.  Contrast that to PHP where we have Symfony, Zend, CodeIgniter, Kohana — and others.  On the one hand, this kind of competition is good.  I’m sure they’re all great frameworks (I use CodeIgniter right now), but the fact that there’s no clear winner means that the market is fragmented.  And, fragmentation is bad.  It’s particularly bad when it comes to web frameworks.  The learning curve these days is not a new language (it takes a proficient programmer just a few days to get her arms around the basics of a new language).  The learning curve is with the framework.  The deeper and richer the framework is, the more there is to learn.  Don’t get me wrong, I love frameworks (dating back all the way to the Object Windows Library that Borland had for TurboPascal).  Frameworks have an upfront cost, but provide a ton of value long-term.  But, if there are a bunch of different frameworks floating around, the odds that any given person is working in the same framework you are lower.  And as such, getting someone new up to speed takes longer.  In Python land, the clear web framework winner is Django.  This means that if I find a great Python developer for the team (more on this later), they’ve likely used Django.  That makes life much easier. 

3. PHP is lingua franca in the world of the web.  One of the the early reasons I picked PHP, which is still true, is that it has become lingua franca on the web.  If someone releases a new API, and provides a “wrapper” for convenience, the first language supported will likely be PHP.  If you’re looking to build WordPress plugins, you’re going to be doing it in PHP.  In fact, many of the biggest open source projects out there, that you might consider leveraging, are based on PHP.  So, knowing PHP is a very, very useful thing.  My advice is that even if you do decide to go with Python — be at least “reasonably fluent” in PHP — it’ll come in handy.

4. Low-End Web Hosting is a non-issue.  Many people make the argument that PHP is a great choice of platform for startups because you can find a $9.99/month hosting provider that supports PHP.  No need for higher-end hosting and you save money.  I think that’s a poor reason.  Yes, it’s nice to know that there are thousands of hosting providers out there that all support PHP, and that you can get hosting really cheap as a result.  But, if you’re picking a language based on spending $10/month vs. $50/month or $100/month — you’re focused on the wrong thing.  Assuming that you stick with your low-cost provider for 18 months (a long time in startup-land), you’ll have maybe saved $900.  That’s just not a lot of money.  My advice:  Recognize that there are things like Amazon EC2 out there now, and over time, it’s going to be just as easy to spin up servers for Python as it is for PHP. 

5. Not all Python fans are fad-focused elitists .  One of the arguments I hear continually online goes something like this:  “PHP is a perfectly fine language, and folks pushing Python are just fad-focused elitists that want to work on the latest cool new thing, instead of just picking what works and focusing on building apps that solve customer problems.”  I’m paraphrasing a bit, but that’s the gist of it.  I can see why people sometimes feel this way.  Lets say you’re something like me:  You’ve learned PHP and used it to build and launch “real world” apps.  For you, the cost of change is high (maybe even prohibitively high).  Really hard to justify the change, because though you might grudgingly admit that Python is better, it’s not better enough to warrant switching.  You’ve got a startup to grow, you can’t be bothered with trying to join the cool kids.  But, I’m to advocate for some empathy here.  Lets say you were on the outside looking in (i.e. you’re a gifted developer looking to join a cool new startup).  Since you’re really good, and demand for great developers always exceeds supply, you essentially get to pick where you want to work.  All things being equal, you’re going to pick the place that is doing Python vs. PHP.  Of course, not all things are equal, and you might actually pick the startup whose business you think has the best chances of success or whose founders you like and respect.  But, often, it’s hard to know that stuff upfront, so you focus on what you do know — that developing in Python’s a better “bet”.  I wouldn’t fault people for solving for their self-interest and preference.  They’re not trying to talk you into switching, they’re just saying that it matters to them.

6. Low Learning are less important than high ceilings.  If you’re in the software development business as a career choice (i.e. you’re going to do it for a long time), then the larger consideration should be what’s going to create the most value for you long-term.  Some languages, like PHP, have very low learning curves — it’s super-easy to get started.  And, that’s awesome.  It’s easy-going, fun, and you feel super-productive (especially if you’re making a big change to something new).  But, once you get past that initial dating period, you need to think about your future.  You want to forge a relationship with a language that will be long-lasting, rich and deep.  A language that brings the best out in you — over the long-term.  Apologies for the strained metaphor here — but it had some resonance for me.  So, back to the title of this article:  PHP Is Fantastically Fun, But Python Is Marriage Material.  Apologies for the strained metaphor, but it resonated with me.  I’ve been programming for a long time, it’s my calling, and with any luck, I expect to do it for a couple of more decades. Since I'm going to get into a long-term relationship with a language, I figured Python's a pretty good bet.

Whew!  That ended up being longer than I expected.  If you made it this far, thanks for reading!  By the way, if you’re a gifted Python developer in the Boston area and looking to join what is quite possibly the best company to work for in Boston (we won an award, so it must be true), would love to connect.  The HubSpot developer interviews are a bit, um, rigorous, but I promise that you’ll meet some people that will have made the time spent worthwhile, even if things don’t work out.  If you’re interested, just drop me an email at {dshah} @ {OnStartups}{daht-com}.  By the way, in case you didn’t know, I’m the founder/CTO at HubSpot, and an all-around nice guy.  Just ask anybody. 

And, if there are any arguments you’d make on either side (PHP or Python), would love to hear them.  Don’t want to start yet another language war, but I’m fascinated by the topic of making hard decisions at startups, and this is one of the hardest. 

Posted by Dharmesh Shah on Wed, Oct 27, 2010


OK...you've convinced me. The next Intro to Web Development course will be on building apps using python and django ;)

posted on Wednesday, October 27, 2010 at 4:14 PM by TheRealBenSmith

Hey Dharmesh, very nice article. You did put things right :) I'm a PHP programmer fighting to switch to python (which I already knew was better) for quite some time. Perhaps next year, right? :P

posted on Wednesday, October 27, 2010 at 4:22 PM by Zé Ricardo

Dharmesh, I'm a JS/PHP man myself, but I can see a lot of merit in your arguments. 
One thing I always try to explain to people (at least those who ask) is that it's not the tool but how you use. I wrote the software I'm most proud of 25 years ago in BASIC and 6809 assembler. 
In other words, you can write very elegant code in PhP, and total guff in Python, Haskell or Erlang (of course the reverse is also true). 
But you're arguing something subtly different - which is the relevance of one dominant framework. It's a very good point, and one which I haven't heard articulated so well before. I can see why it would make a difference... 
Finally, it may all be irrelevant, anyway. If node.js continues like this it will be non-blocking Javascript on both sides of the cavern. 
Just think! Only one language to learn.... 

posted on Wednesday, October 27, 2010 at 4:26 PM by David Semeria

I'm curious (especially because I thought you were going to expand on why, you now regret having chosen C# and .NET. I don't ask because I'm a fan of it, because I chose specifically to move away from the MS technology stack, but I'm curious to see someone else's perspective on it who wasn't influenced by having actually worked at MS (like me.)

posted on Wednesday, October 27, 2010 at 4:30 PM by James Donaldson

Love seeing this argument on an ASPX page! The irony!

posted on Wednesday, October 27, 2010 at 4:31 PM by tom brander

Interesting article. I usually don't do this, but I'll weight your words with gold and try it out myself. (Except when I find another better language for the web.. (I doubt it). 
I know Ruby (on Rails/Spoutcore/Cucumber), PHP(5.3), C++, C#, C, Pascal, Java, ASP, JSP, CSS(3)/JS/HTML(5)/LaTex/VB/XML..and still.. 
I feel at home in the Web-Development, because I see more value in connected software than in isolated offline environments. 
I'll develop a pure web-application (without a framework) in a team of 5 after 1-3 months for a class where we're open to use any language. 
And you're right learning a language takes a day and getting productive with it takes a week. But learning a framework is more time consuming, especially sharing the knowledge you've achieved.

posted on Wednesday, October 27, 2010 at 4:34 PM by Fernandos

I can completely relate.  
Back in 2007 after working on the Microsite stack for (gah!) 13+ years I wrote a blog post "On the Hunt for a New Programming Language": (not being as good a blogger as you I never followed it up, but hey!) 
Basically Python was my favorite, but I chose PHP because it was more standard, i.e. more important apps that I cared about were written in PHP: MediaWiki, vBulletin, Drupal, WordPress, etc. Of those I now only really care about WordPress, but I care an awful lot about it because it's the most widely used CMS on the web, and to me that trumps all else (at least for things that are currently important to me.) 
I do lament the fact I don't get to use Python because I love it as a language (although I've grown intensely fond of variables that are prefixed with $; it makes it far easier to do refactoring of variable names than in most other languages.) And I love how Python uses whitespace; it's requires so much less syntax and few lines to do the same thing than semi-colons and braces. And I lament not having the expressiveness of Python vs. PHP.  
OTOH I think your point on shared web hosting misses an underlying theme and that's the because it's easier to get a PHP app set up far more people end up using PHP apps. Had Python been as easy to get set up then I think we'd see a lot more viable apps (vs. frameworks) based on Python and I think Python has missed huge opportunity and really played this aspect poorly.  
I love that you view standards as critical; that's what I debate so often with developers who don't appreciate the value of standards, but I think the irony here is that Python is less standard because it requires a solid (and expensive) technical person to get it running. That's no problem for the hardcore dev, but it is a problem for the totally non-technical business person looking for a system that doesn't cost them lots of $$$ to implement. 
BTW, I've been advising web startups not to go the .NET stack route in instead choose one of PHP, Python, or Ruby so I would love to see you elaborate on why C# was a mistake.

posted on Wednesday, October 27, 2010 at 5:46 PM by Mike Schinkel

Your new HubSpot Labs logo is really cool. The deadhead in me thinks it looks like a bong. Smile!

posted on Wednesday, October 27, 2010 at 7:35 PM by Brian Halligan

"If I had a dog, the dog would bark at the Ruby code." And if I had a cat, it would twitch its tail and otherwise look mildly irritated at Python code. 
I kid, of course. It's true, however, that having worked extensively in both Python and Ruby, I find Ruby somewhat more comfortable. And it isn't even that I'm a heavy user of the more "exotic" features of Ruby that often come up in comparisons of these languages. There's an element of personal taste here. 
I really don't think I could stand C# and .Net.

posted on Wednesday, October 27, 2010 at 7:43 PM by Ralph Haygood

I'm a ColdFusion developer looking to branch out to other web development languages. Twice now, I've looked into PHP and gotten annoyed and sidetracked by the fragmented framework-space. I've always been a fan of Python, but have never taken the dive. I think you just pushed me to commit some time to Django.

posted on Wednesday, October 27, 2010 at 7:48 PM by Ben

Great post. 
Please drop the other shoe. Why do you say you regret having picked C# in the first place? Why did you later feel that you had to change from C# to something else?

posted on Wednesday, October 27, 2010 at 8:32 PM by Carlos Accioly

PHP vs. Python? Choose Javascript

posted on Wednesday, October 27, 2010 at 8:56 PM by pyto

At one point I had the option to choose .NET or Python for our primary web programming language. I choose .NET. Man do I regret that now.

posted on Wednesday, October 27, 2010 at 9:23 PM by Christopher Baus

php vs python.....mini mini mani mo......never been bitten by a python, but i wonder how the venom turns out. Php....agreed...easy to learn

posted on Wednesday, October 27, 2010 at 9:42 PM by chuks

I'm curious if you ever considered anything besides Django for Python. To me, Django appears to have that same allure of PHP (a low learning curve), but when you get past the dating period, you wish you had more flexibility. I'm thinking of Pylons here. Any thoughts?

posted on Wednesday, October 27, 2010 at 10:47 PM by Josh

Django does not have a shallow learning curve, but it DOES have excellent documentation. The end result is similar: you can get productive very quickly. But there is a subtle difference; Django has many many deep and powerful features that you'll never touch until one day you realize that you need them. 
If django seems like it's inflexible, double-check to make sure you're not overlooking some extension point. Django has a pluggable backend for just about everything.

posted on Wednesday, October 27, 2010 at 11:58 PM by jim robert

Not that long ago whilst working at a company with about 2 million lines of Perl I was considering specifying another development language. The reason related to CORBA, the beast which had to be tamed, but which Perl just couldn't deal with. 
I liked the idea of Python, and still do, but in the end I had to stick with Perl. The reason was entirely pragmatic - the company had cornered the market in Perl programmers locally, and I knew that there were fewer Python people out there. So, if we made the jump we'd be in danger of painting ourselves into another corner. Programmers can learn of course, but quite a few were (and still are around here) unhappy with the thought of Linux script languages. It's considered a dead-end as far as career goes. 
I use Python myself a lot, although the white space issue still bugs me a bit. 
What did we do about CORBA? Wrote the interface in Java and called it from the Perl script. Slow and messy but functional.

posted on Thursday, October 28, 2010 at 12:28 AM by Hook

I went through all of this while deciding on the platform for my startup - nice to see the validation! :) I chose PHP too for all the reasons that you have mentioned. Some reasonable open source well supported CMS are available in PHP. So to start off the block in quick time, with minimal resources, it is kinda hard to look the other way :)

posted on Thursday, October 28, 2010 at 1:31 AM by Nikhil

Anyone who claims Python is the current fad elitist language is so far behind the times you might want to tell them about this new hip language called Java.

posted on Thursday, October 28, 2010 at 2:50 AM by Bob Jones

I feel, with evolution of time, our opinions on a language/frameworkchange which might be because 
1. Language/frameworks in the language have improved.  
2. You have improved your skill in the language/framework. 
3. The existing "circumstances" for the language/framework improved. Like easy hosting for django has come with amazon ec2 etc. 
I will not be surprised if Dharmesh after 5 years, writes an article saying, XYZ langauge/framework is better than Python because of a, b, c etc..

posted on Thursday, October 28, 2010 at 2:53 AM by Saradhi Indurthi

"[Note: I still am viscerally troubled by the using whitespace to indicate code structure, instead of just using braces like the rest of the sane world, but it’s a relatively minor gripe]" 
In a language that used braces, would you still indent the code properly (i.e. like you do in python)? If you would, then you should recognize the fact that python helps you write code faster and easier to grasp visually by not having to match the opening and closing braces.

posted on Thursday, October 28, 2010 at 4:41 AM by Mircea

I think of all the choices a founder must make, technology choice is among the least important. If the product can grow, the language is scalable, talent is available in wide swaths of the community, and there is robust third party development (frameworks, Open Source, CMS, etc) then I would say go with what you know best. Other costs, as you mentioned, are minimal compared with the cost of learning new languages and frameworks for a single founder.  
That said, I am also classically trained and found some of the less robust features of PHP very annoying!

posted on Thursday, October 28, 2010 at 8:54 AM by Boots

I love these arguments, it shows how much we grow over the years as we program. This is a time vs experience issue. 
1) Starting out, C# made you the most productive. 
2) Learning a new language/framework looks like a mountain to overcome. 
My opinion, the more languages you learn, the better programmer you are. I really didn't think closures or chaining was useful, then jquery changed all that. Now Javascript had the ability to do that all along, as well as other languages, but only now using it helps me be more productive in other languages. 
Keep learning guys and use the best tool for the job, which may be what you already know. Oh and don't fall in love with it, because a few years later the equation changes and your developers will have more experience in X language and it makes sense to rewrite for it.

posted on Thursday, October 28, 2010 at 9:09 AM by Jeremy Peterson

Clearly written by a Python aficionado. I've had to maintain someone else's Python (or cr*p as I like to call it) code. Python allows for very bad code to be written fast and easily. No type information to go on when debugging. The article author is assuming an idealistic world, where all coders write well written and logical code. If that were the case then not only Python but all the other good languages would be "great". As for being Marriage Material, the author again is assuming an idealistic world, where a spouse is faithfully and doesn't nag all the time.

posted on Thursday, October 28, 2010 at 9:21 AM by charles_d

1. The author asserts, without explanation or elaboration, that C# was the wrong choice. Why? 
2. The author says: "Low Learning are less important than high ceilings." What was limitations did you have with C# and .NET that weren't there with PHP or Python? Have you not seen ASPNET MVC or Entity Framework (or even NHibernate)? How do you make the rational argument that .NET is less productive or has a lower ceiling than PHP or Python, especially when you make the point that saving money on ultra-cheap hosting providers isn't that strategically great in business terms? 
Mr. Author: please do a new version of this article with more explanation of the points you make but don't back up.

posted on Thursday, October 28, 2010 at 9:29 AM by Mike C

On advantage we've found in using Python at Resolver Systems is that it acts as a filter when you're recruiting. Many programmers know PHP, VB, Java or C#. Those languages are needed in the vast majority of programming jobs, so people who see coding as a means to a paycheck rather than a passion will (quite reasonably) learn one of them and work in it. They won't apply for a job at a company using Python because it would be a waste of time for them to invest in learning the language. 
On the other hand, people who are passionate about programming will either know Python or will regard the chance to learn it as a positive aspect of a job. 
So by saying "we develop in Python" on the job ad, you effectively pre-emptively filter out the bulk of the people who aren't keen programmers before they even apply, which greatly reduces the costs of recruitment -- which can be a killer for a startup because you absolutely must have the best people but have very little time to spend on hiring them. 
Of course, programmers at a startup have to be more than great developers -- they need to be pragmatic, flexible, and business focused. But I don't know any short-cuts for identifying those before an interview :-) 
(Oh, and perhaps as Python becomes more mainstream the filter will work less well. But it's probably not time yet to switch to Clojure just to make hiring easier...)

posted on Thursday, October 28, 2010 at 9:33 AM by Giles

Just realised that Paul Graham said essentially the same thing as I just did, back in 2004!

posted on Thursday, October 28, 2010 at 9:58 AM by Giles

After reading your article, and enjoying it, I'm trying to find one solid business reason for doing the unthinkable in a startup business environment, switching programming languages after having significant investment in another. In a startup every thought should be on maximum return on investment, and I cannot see anything in your post to indicate that was on your mind which leads me to believe that yes you were indeed "fad-focused". The only point you had that had any return on investment mentality was the "Python means I get better programmers applying", but I would wager that you would find more quality PHP programmers simply due to the sheer number of PHP programmers to Python programmers out there. Of course the invterview process would take quite a bit more skill and time to weed out all the bad ones.  
Ok, so despite my counter argument, you've made me want to actually spend some time learning Python between my PHP and C# duties. As I said, I enjoyed your article and I think you made a lot of good points for a PHP programmer to look into Python. As for your decision in a startup I think it's insane, but I suppose you covered that in the beginning of the article. I think you should probably chalk this up to a giant FAIL decision, which I believe you do, and learn that in the grand scheme of things, a capable and current programming language should never be switched out. You cannot justify that cost in most situations.

posted on Thursday, October 28, 2010 at 10:19 AM by Chris Robinson

django is bulky, i found it hard the first time i learned about it. but then i found bottle, now i am becoming lazier to open my php code than to write and experiment using bottle.

posted on Thursday, October 28, 2010 at 10:40 AM by pebbie

I've never tried Django, so have no comparison to contribute. But I find it telling that the Django guys don't try to redefine the term "MVC". Because they are not using it as buzzword in the first place, unlike all the PHP frameworks. 
That being said, PHP in itself is a workable framework. And the clumsy HTTP input arrays are itself a near perfect environment for web apps. Frameworks are icing on the cake, sometimes bloated und undelicious icing. But I believe it's better to have choice here than a one-size-fits-all API. 
Again I don't know enough about Django, but the Python core libraries are not very well trimmed towards web apps. (E.g. none of the default http modules supports content-encoding out of the box.)

posted on Thursday, October 28, 2010 at 1:03 PM by mario

When a friend of mine left to work for you two years ago and told me you were using C# I was kind of stunned. Everything he said about the company was appealing (good use of social media, smart concept, and great use of tools as marketing) but that stack choice stuck out in my mind the most. Glad to see you've come over to the Django side. Also I can't agree with Tom Leys more. The fact that I can use Python in so many ways makes it so much more valuable.  
Now all you have to do is convert most of your team to Ubuntu users and you are set.

posted on Thursday, October 28, 2010 at 1:24 PM by Brian

Whoa whoa whoa! I don't code on the first date.

posted on Thursday, October 28, 2010 at 1:32 PM by Br.Bill

PLEASE let us know about what your view are on C# in follow up to your statement "So, I picked C# and .Net — which frankly, if I had to do over, I wouldn’t have picked (more on that later)."!!! 

posted on Thursday, October 28, 2010 at 1:38 PM by Dean S

Thanks for all the comments. 
And sorry for not following up on my thoughts regarding C#/.Net. The article was getting long, so I thought I'd save that for another day. 
I'll write a follow-up article next week.

posted on Thursday, October 28, 2010 at 2:02 PM by Dharmesh Shah

LOVE your article. Wish you can write another article on your perspective on C#/.NET.

posted on Thursday, October 28, 2010 at 3:09 PM by William

Also, for all of you wanting a post about Python vs C# my boss wrote one a while back http://bit.ly/9oD8Gu.

posted on Thursday, October 28, 2010 at 3:31 PM by Brian

Its kind of interesting that stack overflow.com and Answers.OnStartups.com are both built on c# and asp.net mvc. And its also interesting that a very smart Google engineer named J. Skeet, one of the top rated users on stackoverflow wrote a great in depth book on C#. Clearly language choice does not depend on how good you are as a programmer or how passionate you are about the craft of software design. It is a personal choice based on the qualities of a language that appeal to you (verbosity and strong typing in my case) and that work for you in terms of your own productivity. 
As long as you don't live in a bubble and study other languages and frameworks so you can make your own informed choice.

posted on Friday, October 29, 2010 at 12:44 AM by Areg Sarkissian

@Areg Sarkissian -- Answers.OnStartups.com is an instance of the Stack Overflow software, isn't it? 
Anyway, not sure if you were thinking of my comment above when you said "language choice does not depend on how good you are as a programmer or how passionate you are about the craft of software design", but if so, we don't disagree. There are many great programmers out there who prefer typed languages like C#. I've even met good developers who were fond of Visual Basic. It's not so much the choice of language that's important, but the willingness to learn other languages. To put it another way, good developers will know more than one programming language, or will be willing to learn another. Or as you put it, they avoid living in a bubble, and study other languages and frameworks so that they can make their own informed choices. 
When you combine this with the fact that (say) Python is a minority language, so is unlikely to be someone's only language (outside a few scientific specialities), it means that knowing or being willing to learn Python is quite a good indicator of a good programmer. That doesn't mean that every good programmer knows Python, but it does mean that if a programmer knows Python, or are willing to learn it on the job, they are probably good. This makes hiring easier. 

posted on Friday, October 29, 2010 at 4:51 AM by Giles

Great article indeed! I write C# for a living but love learning about Python and using it in my own products. This article touched on a lot of points we, developers are thinking but would never say due to being flamed by our peers. 
Thank you

posted on Friday, October 29, 2010 at 7:41 AM by Carl

I hadn't done any 'real' programming in quite awhile when I decided to develop my website. I choose PHP because it seemed like the shortest learning curve, tons of information available (manuals, sample code, forums, user community etc.. though this is probably true with most other languages as well), and the easiest to get started on to bring up a version 1/working prototype. Though, if I had experience in another language I sure I would have chosen it. If the site does kick off though I could see having to rewrite it in a more robust language. Seems like there have been other sites with extremely high traffic that have either redesigned on another language or added code to turbo boost PHP. There isn't always one 'best ' solution but more importantly use the proper tool to solve the problem. For now PHP is serving me well.

posted on Friday, October 29, 2010 at 10:30 AM by matt

To choose a language i'd say go with your gut fealing. That will keep you happy and motivated.  
I started as a kid doing various types of assembler code (m68k, x86, mips) and for years I believed ppl who used high lvl languages were stupid. Later c, c++, perl, php, jscript (severside!), java, c#, then java again then c# and finally java. Also did a bunch of academic languages like ml.  
For web I probably hit the peak of productivity with perl and php - they were both quick and dirty (but the stuff I wrote was not very maintainable nor scalable). I really like both c# and java but in the end I decided for java because c# dosen't have much of an ecosystem - it's microsofts tool and framework or nothing - and I couldn't get into the really big projects (20mio+ budgets and large scale architecture) with c# but the opportunities were abundant with java.  
I think developers today are spoilt for choise not only in languages but also dev invironments. Java really hit the golden age of dev environments maybe 5-8 years ago. You can choose between IDEs such as netbeans, intellij, eclipse, jdeveloper and more - all for free - all with exellent refactoring, unittest, buildsystems etc. Truely amazing times we live in - if your not happy being a developer today then its never going to happen change your profession right away! :)

posted on Friday, October 29, 2010 at 12:14 PM by motherteresa

Similar arguments could possibly support the use of Java over php (as opposed to python) given the advantage of seamless interoperability, ubiquitous support on all server hosting providers (disregarding the minor hit on speed, ofcourse, which again can be mitigated by intelligent caching)

posted on Saturday, October 30, 2010 at 12:46 AM by Abhishek

Besides all the things you mentioned, one thing that stood out for both Python and Django was the presence of clear decision makers. With Guido as BDFL it means that progress can be made rather being mired in some of the community bickering that can go on with languages like Java.

posted on Saturday, October 30, 2010 at 3:45 AM by Brent Hoover

Seems like this decision to switch to Python is even harder since the Python 2.7 release on 4 July 2010 was the final end-of-life (albeit with extended support) for the 2.x branch and the new 3.x is not backward compatible with 2.x and Django support for 3.x is still pretty much awol at this time. 
Will you start with 2.x and then migrate all of your body of work to 3.x when Django and other frameworks catch up? Or will you just transition newer development to 3.x and be in the position to support two baselines (either indefinitely or until you can migrate your 2.x stuff)?

posted on Sunday, October 31, 2010 at 1:12 PM by Eric N. Winn

Well... I think you are trying to push what you actually believe in rather than the fact.  
PHP and Python both are good, choosing between them is kind of choosing between two different type of apples. what ever that python does can be done in php as well. vice versa. 
I believe that there should an personal hidden agenda behind this article. 
whatever it is... have fun

posted on Monday, November 01, 2010 at 3:53 AM by Ram

I've spent a lot of time in PHP, and just enough time in Python to realize that I don't like the amount of "magic" that Python forces the developers to rely on. What I constantly found myself having problems with was the amount of inconsistencies in the prebuilt libraries and modules that we as a shop ended up using. Without having a PhD on the team of 8 programmers who happened to be a Python pro (but interestingly enough had no Django experience) was like a blind monkey trying to lead a pack of deaf rats. Gone were the days of troubleshooting errors without having to create a complex knowledge of the intricate workings of the source code, linear progression through the different modules, and other stuff. I can't tell you the number of times I spent hours in one rabbit whole, only to ask and find out that the problem was actually somewhere entirely different and really would never have looked there unless I just knew that was where to look. Yes, PHP sometimes probably involves a bit more programming *sometimes*, but I find that the Python programmer is one who is a)lazy and b)enjoys coming up with impossible to track down code using highly ingenious solutions to solve the most menial problems ever. Yes, sometimes the prebuilt stuff makes it easy, but as the latest comment prior to mine stated, Python has now deprecated the current revision of Python that is the only compatible version with django.

posted on Monday, November 01, 2010 at 1:09 PM by Oknotsomuch

An awesome article and one that's very much needed on the tubes right now. I'm a PHP developer for the most part, but a skeptic forever, and this kind of writing is always interesting to me. 
I love/hate your comment about being a "classically trained" developer due to your CS undergrad work. I started out as a CS student as a freshman at Purdue (*lots* of Java development), but moved to our "Computer Technology" department, mostly because of their more practical (vs theoretical) approach to development. Unfortunately, the program focuses heavily on C# .NET and Oracle, and I find that PHP is a much better route for web development learning on one's own (as you mentioned). As far as education and web development go, I'm convinced that you can learn to write high quality web-aps on your own, but employers will *always* like to see a related degree. 
At any rate, I thank you for this article. PHP I feel is the best place to get started in web development due to the low learning curve and extreme popularity that you mentioned. While I know Python is fairly similar and much more handy for things like back-end scripting, I'm ashamed to say I haven't touched it yet. Either way, this article will surely get a review and mention on my own site! 

posted on Monday, November 01, 2010 at 1:39 PM by Sam Smith

Excellent article, it was a very good read. I'm also considering switching from PHP, mostly because of all the bad rumors about PHP6 development.  
I'm very very interested in this part:  
"Python gets a bunch of the language stuff “right”. It’s about how reflection is implemented. How functions are first-class objects. It’s all the little things, which in aggregate, make for better cleaner, more elegant code." 
Could someone please provide some reading material on this?

posted on Monday, November 01, 2010 at 2:57 PM by WishCow

Hi @Oknotsomuch,  
Your comments ring true with me given my experience with "ideal" solutions in the past (one of which I was a staunch advocate and wrote a book for) and more pragmatic solutions that just let people get things done. As I commented above, I currently program in PHP programmer but wish I could program in Python; unfortunately it just ain't in the cards for me at this time. 
But one thing you said struck me as unexpected: "b) enjoys coming up with impossible to track down code using highly ingenious solutions to solve the most menial problems ever." One of the things that makes me want to work with Python are some of the things quoted as ideals in The Zen of Python: 
The following aphorisms really resonated with me: 
- Explicit is better than implicit. 
- Simple is better than complex. 
- Flat is better than nested. 
- Readability counts. 
- There should be one-- and preferably only one --obvious way to do it. 
- If the implementation is hard to explain, it's a bad idea. 
- If the implementation is easy to explain, it may be a good idea. 
All of those sound diametrically opposed to what you quoted as your issue "b)." Sounds like maybe the Python programmers you know are not really good Python programmers but instead followers who can't be bothered to know, understand and practice the doctrine, maybe?  
P.S. What you describe sounds a lot more like what I've seen looking in from the outside looking in with Ruby and Rails vs. Python where many of the Rubistas I know delight in coding in as few lines as possible even if it makes it impossible to maintain. That's why I shied away from Ruby.

posted on Monday, November 01, 2010 at 4:07 PM by Mike Schinkel

I don't understand why people continue the language-wars argument. The reality is that all the languages mentioned have been used to develop successfull business's. Therefore, pick a language that you and your team is comfortable with and focus on building the product that solves the solution. 
Arguing Python is better than C# or PHP is better than Java is pointless. Each technical team will have a favorite, for different reasons...and I say develop with the language you feel most comfortable with. If you architect your product well, you'll do fine.

posted on Monday, November 01, 2010 at 6:33 PM by mike

I get asked questions about one language over another all the time. At the end of the day they all have their pros and cons, it really comes down to what you have the most experience with. 
Crappy code is crappy code no matter what language it is written in. I am way more concerned about picking the right members of my development team than the language we decide to use.

posted on Monday, November 01, 2010 at 9:14 PM by Adam

Finding a good platform is very critical at start up. Cost most be taken into consideration as well as knowledge of the platform.  
So if all I know at start up is PHP, should I then refuse to launch or spend most of my time reviewing platforms than getting straight to work? No! 
For me right now it does not matter whether PHP or Python is better. They both get the job done either way. it's more about ease of programming. 
Some will advocate that Java is the best but the truth is that there are always options.We can always upgrade like you've done if the need arises.

posted on Tuesday, November 02, 2010 at 4:33 AM by seunweb

In my opinion the point really being made here isn't that one is simply a better language than the other but what is more sustainable as a platform in the long run to scale-up a startup's operations. It's noteworthy that at the end of the day if you're just trying to get your solution up and running go with just about any platform you're comfortable with rather than having to add another layer of learning i.e. other than marketing, finance etc. Get the solution out there, mature it, reassess when scaling up and go with the platform that suits your needs the best. For all you know it might not even be Python.

posted on Tuesday, November 02, 2010 at 9:46 PM by HSekhon

in my opinion, C# is good to develop desktop application, PHP and Python is good to make web application. I prefer Python because I hate to press a lot of key (Shift+[ = {) and Python is easier to read.

posted on Wednesday, November 03, 2010 at 4:34 AM by kjen

I like Python a lot for it's inherit OOP, simple syntax and readability. But in the end it's also about what the company you program for already uses. Right now the world is mostly in PHP and that's what I've got the most experience in. Just like I need to work with Symfony 1.4 and not 2.0, even though I'd like to use 2.0 already (or one of the other frameworks). It might be different if you're setting up a site from scratch.. but then again all my knowledge, experience and pre-made ready-to-use code is in PHP - so why switch? 
On the other hand I still use Python when hobbying and would gladly welcome an opportunity to work in it professionally. At least I prepared for that some, although for now my focus must be on PHP.

posted on Wednesday, November 03, 2010 at 2:00 PM by Rein

I would love to see your follow up article about why you regret starting with C#. I am coming from a desktop app perspective and couldn't imagine doing my work entirely in Python, but I'm also not that experienced in it. Would love to see what the issues are with C# and website development.

posted on Monday, November 08, 2010 at 9:42 AM by Dave M.

please write the follow up article on c# vs. python - we're about to make this very decision and currently leaning to c# (for the same reason you made your original decision)

posted on Tuesday, November 09, 2010 at 10:28 PM by Jon

After previously commenting I'm returning to comment again because I just got an email that reminded me of one of the key reasons why PHP or Python are much better for most startups than C# or Java. And this is to address what those who say "Technology choice isn't important, it's execution that's important." They are right about the latter but not about the former, and in part it's because the former relates to the latter in ways they were probably not considering. 
From 1994-2006 I ran a successful catalog mail order business that sold commercial component software to Microsoft-centric software developers. We started with components for Visual Basic developers and evolved to components for .NET developers. One of our vendors was a company called Aspose and I only mention them here because it was a marketing email I got today from them.  
Aspose's products allow developers to "Create, Open, Modify, Convert and Save: DOC, DOCX, XLS, XLSX, PPT, PPTX, PDF and many more." They claim their products are "Trusted by more than 50% of Fortune 100 companies" to which I've no reason to believe is false (my former company sold to almost 100% of Fortune 100 companies because they all had Visual Basic developers somewhere within their company and we only need to resell one $100 component to claim them as a customer!) 
Apose's email pitch today included "Aspose.Total isn't just a cheap alternative; it is quite simply the best value for your money. Prices for Aspose.Total start as low as $1999..." And therein lies the problem.  
The entire culture around .NET and Java components is based on value pricing of software marketed to the Fortune 1000. And that's not a bad thing; for those companies spending money for functionality from a throat they can choke is far better than depending on open-source. But a $2000 per developer component package to solve one technical problem (of which there are many) is absolutely not appropriate for startup budgets.  
The culture around PHP and Python is freely downloadable open-source functionality that in most cases is on par with the commercial equivalent that is value priced in .NET+Java. And the open-source model ensures that, for the most part, the best components bubble to the top because there is no pricing friction that keeps developers from evaluating the different available options. 
In the .NET+Java world the components offered by the company that executes their business best bubbles to the top, not the best technical solution. I saw it repeatedly, the guys that could manage their sales force the best were the leading vendors, not the companies whose developers created the best component. And thus there is far more fragmentation among components in the .NET+Java space. Back in the day I counted at one time 37 different charting components available for sale to .NET developers, and it is very hard to determine which one met your needs without lots of time spent evaluating each of them.  
With PHP and Python the best solutions become relatively clear because of the community aspect of open-source, and there are rarely more than 3 reasonable options to evaluate. This one fact alone is an important reason to avoid .NET or Java for a startup and to go with PHP or Python. 
In summary, the reason why .NET+Java are bad for startups is that their ecosystems are optimized for serving enterprise needs at enterprise prices and with enterprise evaluation timeframes whereas the ecosystems for PHP and Python are much friendlier to the needs, financial constraints and evaluation timeframes of startups. Frankly I left my successful business selling .NET components back in 2006 because I realized that open-source PHP+Python was a much better avenue than .NET+Java for web startups and I wanted to get more involved in the web space because, frankly the enterprise sales process disgusts me. 

posted on Wednesday, November 10, 2010 at 10:20 AM by Mike Schinkel

Agree with you comment above on .net; but I don't really think all of the software ecosystem in java is geared toward the fortune1000. 
There's quite a bit of open source community thats thriving if you know where to find it.  
But then again, if your requirement lies in specific niches then it may be true that the ecosystem that caters to your need is mostly geared toward the enterprise. 

posted on Wednesday, November 10, 2010 at 11:51 PM by Abhishek

Abhishek: Fair point about Java. I was lumping it in with .NET because I know that Java is heavily used in the enterprise. Although it does appear that out-looking-in that Java is similar to .NET (the local Java user group in Atlanta is all enterprise focused, for example) truth-be-told I don't have enough relevant experience in the Java ecosystems to speak with any authority on it.

posted on Thursday, November 11, 2010 at 9:22 AM by Mike Schinkel

I'm not trained as a developer, but I like to make a little website here and there. I did a little test run with Python and appengine(horrible choice by the way). Anyway, this article inspired me to try it, and I must say it's amazing. Thanks.

posted on Saturday, November 13, 2010 at 4:08 AM by hiimleath

If you're using Python for web apps, you should definitely check out web2py. I'm impressed with it's capability and the community is awesome.

posted on Tuesday, November 16, 2010 at 9:05 AM by Lorin Rivers

Lutz Prechelt wrote a chapter on the relative productivity of different programming languages for the new O'Reilly book "Making Software" (disclaimer: I'm one of the editors), and Steven Clarke did a chapter on applying usability techniques to APIs --- see http://oreilly.com/catalog/9780596808303.

posted on Tuesday, November 16, 2010 at 12:13 PM by Greg Wilson

Once again, awesome read... I'm not a programmer myself, but do dabble in it sometimes and the idea that php have lots of open source and freely available code, makes you want to go back to it again and again. 
I kind of went for the one with the lower learning curve, mostly because of time constraints. Nice article Dharmesh

posted on Tuesday, November 16, 2010 at 2:44 PM by Web hosting

My opinion is next: 
PHP as language is really good. If you know how to accelerate, cache, optimize, etc... your application it will work like a little baby. 
If you to run something like spiders, crawlers, things like real-time chat etc... PHP is useless... You can sit, cry and cry... (You can do it but doing it in PHP is like a suicide...) 
So how I like to do stuff:  
1.)Write site in php. Do massive caching agains HTML, PHP, do things like Varnish + Nginx and optimize database as much as possible. 
2.)All serious process => redirect to python. 
Overall I cannot judge those languages. Python is python, as far I am concerned built for one thing. PHP is something else built for another thing no matter that both can be used for serving web pages. 
P.s. For me, Python is easier than PHP lol 

posted on Wednesday, November 17, 2010 at 5:30 AM by 0x19

ASP.NET is not suitable for public-facing web sites. It's suitable for enterprise intranet and limited extranet applications. 
I say this after having managed multiple ASP.NET projects, some with 7-figure budgets, for enterprise customers in the insurance, banking and health care industries. ASP.NET is a fine choice if you're building a real, web-based enterprise solution where you can dictate the OS (Windows) and browser (Internet Explorer) that your users will rely on. 
Take a look at this very site, however. The home page at onstartups.com has 1,095 validation errors and more than 1,100 validation warnings! 
That's ridiculous, but it's par for the course for a website built on ASP.NET, in my experience. Part of that is Microsoft's fault - they actually make it difficult to generate valid code with their tools, but part of it is also due to the fact that (in my experience) many .NET developers simply don't know (and often don't care) about how to develop correctly for the web. They may often understand how to develop proper business logic, but their web knowledge tends to lag far behind. 
I have a customer who moved his website to HubSpot a year ago. I told him that, while the service looked very nice, I couldn't recommend that he host his site on an ASP.NET-based system. A year later, he's frustrated and ready to move again. Don't get me wrong - you've done an admirable job of building a really cool set of tools, but you've managed to do that despite ASP.NET and not because of it, and from what I hear from him and other customers, there's an inflexibility in HubSpot's applications that I imagine can be attributed, at least in part, to the fact that the tools are built on top of ASP.NET. 
I know - don't fix it if it ain't broke, but you may want to consider migrating HubSpot to Python before you move on to your next startup ;-)

posted on Thursday, November 25, 2010 at 5:10 AM by Kurt Milam

@Kurt Milam - Great insite, thanks for sharing! I once read a blog post where someone said "ASP.NET doesn't let you build 'web' apps, it lets you build ASP.NET apps that just so happen to live on the web." So true...

posted on Friday, November 26, 2010 at 7:03 PM by Mike Schinkel

This article was well written! I feel the same way about there being multiple frameworks in PHP. I've been using PHP for almost 5 years and I love a lot about it, mainly the OOP. However, the more I work in Python it appears the maintainability of a Python application will be MUCH easier. I am talking about Django Framework vs one of the PHP Frameworks. I like some PHP Frameworks too and will still use PHP but the more I learn about Python it seems like everything you said on here is true.

posted on Saturday, November 27, 2010 at 6:28 PM by Jesse

I don't really have a strong preference between python or PHP, but this article lists more pros for PHP than it does Python...  
The only pro for Python is #1 - Python is well-designed, PHP is not, but you don't give any reasons or examples as to WHY Python is well-designed (not that it isn't) 
Your other points read as follows: 
#2 - PHP has more frameworks 
#3 - PHP is popular 
#4 - PHP hosting costs less 
#5 - Some Python fans are fad-focused elitists 
#6 - PHP has a low learning curve 

posted on Tuesday, November 30, 2010 at 2:53 PM by Brian

Comments have been closed for this article.