Live data from Hacker News

Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

news.ycombinator.com

41–50 of 89 posts

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#41
post #38

Earlier quoted context omitted.

but a good developer can write good, clean code in either one. Every language/IDE combination encourages a 'default' coding approach, I agree that the PHP 'default' coding approach tends to be to create a hopeless muddle of assorted, random crap. OTOH, which would you rather have...a coder who is currently being 'forced' to write marginally better code in Python than he would in PHP because of the language constructs…

BS. Can PHP do this? http://www.joelonsoftware.com/items/2006/08/01.html (In fact the latest version of PHP (5.3) can, but for years PHP has been lacking this, so the point stands.) No amount of "good code design" can work around core features that are missing from a language. The argument that all languages are more or less equal is as nonsensical as saying all cars are more or less equal, or all guns are more or le…

"Can PHP do this?"

well, as you've pointed out yourself, yes it can.

"for years PHP has been lacking this, so the point stands."

Im sorry? I must be missing the point. How does the presence (or absence) of a particular language feature prove or disprove the point that bkrausz made originally?

".....it ignores the tremendous advantage that using good tools can provide."

not really. well, kind of.

so the thing is that if I take the things that (in my experience) work to make a project successful, and I squash them all up into a big ball, and then I take that ball and I split it up into two heaps....one heap consisting of the things that the developers brought to the project and one heap consisting of things that the language brought to the project...and I look closely at the relative sizes of those two heaps....then almost always the heap of things that the developers brings is a lot larger; so much larger in fact that in general the effect of the programming language can be ignored.

That is a pretty general statement, and there are clear cases where it is simply not true, but in general it is true, and I would particularly claim that in the case of a web application and choosing between PHP or Python, it absolutely is true. In the hands of good developers either will solve the problem well, both will provide a good, readable and maintainable code base. In the hands of an idiot, neither will be any good.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#42
post #21

With PHP it will be much much easier to outsource parts of your project compared to python. There are more PHP developers and they are much cheaper.

The downside of that is that it's much harder to find good PHP developers. There are an awful lot of awful developers who use PHP; less so with Python and other 'niche' languages.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#43

Earlier quoted context omitted.

Yea, Reddit and Twitter are great examples of places that failed because they were afraid to learn new technology? Wait. That failed because they tried to learn and implement things in unfamiliar technologies? Oh, wait, what?

No, they tried to build the app with a technology they wanted to learn {Reddit : Lisp, Twitter: Rails} and then had to rewrite it (mostly) from scratch when that didn't work out {Reddit: Python, Twitter: Scala}. Neither failed, because they were smart enough to know when to ditch. God knows how many startups failed because they didn't know that.

For Twitter, Rails was the technology they knew. They decided it wasn't the right tool for their needs. Scala is the tech they learned (and continue to learn) on the job. They even have a group blog detailing this process (http://gracelessfailures.com).

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#44
I'm happy that I'm developing my web apps with Python. I have used almost all Python web frameworks out there. So let me explain my experience.

Django - Until 1.2 Django was a total headache but with 1.2 it really is a great tool to develop web applications. No reason not to use it unless you feel something's missing. Django has an amazing community with very helpful people.

web2py - web2py lets you create apps very fast, it doesn't push you hard and you can build something in a very short time. However when things get complicated, you will want to quit web2py. I don't like its form helpers, I don't like its validation as the validation is unfortunately not per object but the input data and url routing is headache with web2py. Web2py also has a great community. All your questions will be answered in a short time.

turbogears - turbogears is a subset of pylons with sqlalchemy as orm and genshi as templating system. i don't like the @expose decorator. it's just not for me. provides many other tools by the way. TurboGears has a small but helpful community. SourceForge is using TurboGears.

werkzeug - now this is the framework of my choice. the endless freedom. it is only a skeleton which lets you dress your application onto it very easily. you can choose anything as your orm and templating system. provides a strong url routing mechanism. supports sessions, secure cookies and any other thing you may need. however i am not using werkzeug anymore as i don't like the way people act in #pocoo on freenode. this is the only reason i am not using werkzeug. they are ignorant and i don't like it.

Pylons - My favourite Python framework of all times. Flexible as much as it can be. Provides you the freedom you need for anything. I strongly recommend using Pylons. I am currently using Pylons and I'm very happy with it. Pylons is also used at some very popular web sites such as bittorrent.com, reddit.com, etc. It has a helpful community whenever you need.

Frameworks aside, how will using Python will help you? * Very clean and beautiful code. * Easy updating and maintaining the code. * Easiness and laziness. * Great set of libraries. * Python for your mental health.

And I'd like to thank justin_vanw for the great sum. :)

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#45
post #38

Earlier quoted context omitted.

but a good developer can write good, clean code in either one. Every language/IDE combination encourages a 'default' coding approach, I agree that the PHP 'default' coding approach tends to be to create a hopeless muddle of assorted, random crap. OTOH, which would you rather have...a coder who is currently being 'forced' to write marginally better code in Python than he would in PHP because of the language constructs…

BS. Can PHP do this? http://www.joelonsoftware.com/items/2006/08/01.html (In fact the latest version of PHP (5.3) can, but for years PHP has been lacking this, so the point stands.) No amount of "good code design" can work around core features that are missing from a language. The argument that all languages are more or less equal is as nonsensical as saying all cars are more or less equal, or all guns are more or le…

Actually, older versions of PHP could do that, too, as long as you pass the function names as strings. $functionName() works fine in PHP < 5.3, though I'm not sure when it was introduced.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#46
post #37

Earlier quoted context omitted.

"The guy on your team who is the most against using PHP is likely the one who best understands the ways in which PHP will limit your team. You do not have the deep technical understanding to make these judgments, and for that reason (without taking months of hard work to gain such understanding) you should defer to him." sorry, what? the guy on his team who is most against using PHP could equally well be an idiot who…

Of course he could be. I don't envy the position of any non-technical person that has to make key technical decisions on a technical project. Ultimately it takes a good developer to spot a good developer, so a non-technical person seeking to build a "robust web application" starts at a huge disadvantage. Without understanding the pros and cons of each language choice, all he can do is gamble on finding a smarter pers…

Im not clear what makes you think the OP is a non-technical person? The question he phrased was the exact question that he should have asked, what is unfortunate (but unsurprising, given the complexity of the answer) is that nobody seems to be answering it clearly.

He asked: "How will it impact my webapp if it is written in Python and not PHP"

That is a fantastic question, and it deserves better responses than the 'language x sucks' ones it is mostly getting.

The simple fact that he asked the correct question gives me a great deal of faith that he is in fact technically inclined, technically able and has some development experience. The way in which it was phrased makes me believe that english is not his habitually spoken language.

He clearly does lack experience in using Python, and is (quite reasonably) hesitant about plunging into a different language without attempting to find out more about it.

"I'm advocating he choose the anti-PHP guy, slightly tongue-in-cheek, because given the limited amount of information presented, that choice gives him the best odds."

it really doesn't. some quite ridiculously stupid people are anti-PHP.

Given the information available, I would advocate that he use the language that the majority of people on his team are most familiar with. Nothing like having a team learn an entirely new language and associated design skills to bog down a project.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#47
The two framework examples you give are not at all on the same level. CodeIgniter has a lot of stuff to structure your application, but many experienced PHP developers wouldn't bother with it (and I, personally, don't think it's worth all the extra code you're importing); web.py, on the other hand, merely gets you partway to where PHP starts, with regard to writing your application. If those were your only alternatives, then I'd say you probably want to use web.py, but if using web.py is one of the choices, then you might just as well use PHP without a framework at all, which is one less piece of third-party software to go wrong.

One thing I've really liked about PHP is that (using Apache) if the webserver is up, PHP is up. When I developed most of the applications in Python, it seemed as though I was constantly worrying about the application process failing, even though this happened very rarely.

PHP really is an ugly language, but you eventually get used to it. :(

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#48
post #38

Earlier quoted context omitted.

BS. Can PHP do this? http://www.joelonsoftware.com/items/2006/08/01.html (In fact the latest version of PHP (5.3) can, but for years PHP has been lacking this, so the point stands.) No amount of "good code design" can work around core features that are missing from a language. The argument that all languages are more or less equal is as nonsensical as saying all cars are more or less equal, or all guns are more or le…

"Can PHP do this?" well, as you've pointed out yourself, yes it can. "for years PHP has been lacking this, so the point stands." Im sorry? I must be missing the point. How does the presence (or absence) of a particular language feature prove or disprove the point that bkrausz made originally? ".. ...it ignores the tremendous advantage that using good tools can provide." not really. well, kind of. so the thing is that…

"Im sorry? I must be missing the point. How does the presence (or absence) of a particular language feature prove or disprove the point that bkrausz made originally?"

Yes, you are missing the point. I refer to closures, the feature at the core of functional programming, not just any "particular language feature". Functional programming is an extremely powerful tool to wield, and has been absent from PHP since its inception until very recently.

A great developer with a functional programming tool in hand is able to well outperform a great developer who must work around its absence.

Here's a paper that surfaced to the front page of HN recently on the importance of functional programming: http://news.ycombinator.com/item?id=1482797.

This is just one example, but a very potent one, of why language selection matters.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#49
post #37

Earlier quoted context omitted.

Of course he could be. I don't envy the position of any non-technical person that has to make key technical decisions on a technical project. Ultimately it takes a good developer to spot a good developer, so a non-technical person seeking to build a "robust web application" starts at a huge disadvantage. Without understanding the pros and cons of each language choice, all he can do is gamble on finding a smarter pers…

Im not clear what makes you think the OP is a non-technical person? The question he phrased was the exact question that he should have asked, what is unfortunate (but unsurprising, given the complexity of the answer) is that nobody seems to be answering it clearly. He asked: "How will it impact my webapp if it is written in Python and not PHP" That is a fantastic question, and it deserves better responses than the 'l…

"gives me a great deal of faith that he is in fact technically inclined, technically able and has some development experience."

I'm sure he has development experience. But too limited an amount.

It is a valid question, but I don't think any response provided here can properly demonstrate to him the value of a language like Python over a language like PHP. No more than someone could teach him to fly a plane in the span of a post like this. It's not a simple subject, by any means.

The best anyone can do is point him to resources that he could study and learn over a period of time -- or advise him to listen to someone talented that he trusts.

I'd be very careful listening to anyone advocating PHP for a project starting from a blank slate. Yes, there are talent developers that prefer PHP. And there are many more poor developers that prefer PHP as is the most popular default choice for those that lack experience, are not comfortable with their own technical judgement, or believe that all languages are more or less equal.

Many on HN would argue that a top-tier developer would not choose PHP, period. But you may not be able to get hold of a top-tier developer -- and in that case a team of solid PHP developers may be the best available choice, if not the best possible choice, particularly if you've worked with them before, and the project is technically simple and limited in scope.

Re: Ask HN: How will it impact my webapp if it is written in Python instead of PHP.

#50
post #48

Earlier quoted context omitted.

"Can PHP do this?" well, as you've pointed out yourself, yes it can. "for years PHP has been lacking this, so the point stands." Im sorry? I must be missing the point. How does the presence (or absence) of a particular language feature prove or disprove the point that bkrausz made originally? ".. ...it ignores the tremendous advantage that using good tools can provide." not really. well, kind of. so the thing is that…

"Im sorry? I must be missing the point. How does the presence (or absence) of a particular language feature prove or disprove the point that bkrausz made originally?" Yes, you are missing the point. I refer to closures, the feature at the core of functional programming, not just any "particular language feature". Functional programming is an extremely powerful tool to wield, and has been absent from PHP since its inc…

yeah, closures are good.

we really do appear to be having two different discussions, Im neither claiming that PHP is 'better' than Python nor am I arguing against functional programming.

I am simply arguing that the most important thing in a project is the quality of the developers, not the language they chose; and that given a good developer and a choice between PHP and Python I would almost certainly find the relative language features so entirely unimportant that I would choose the language based on stupid things like what language the existing codebase is in, what language the developer preferred and had most experience in and how recently I had been frustrated by the languages in question.

OTOH, I am always willing to debate the relative importance of language features, so by all means lets go there.....

Closures in particular are a very powerful tool in async/multi-threaded environments, but in the stateless/sync environment of a web application environment, they collapse down to syntactical sugar, and solve nothing that cannot be solved in other ways.

The software industry has, by and large, been working around the absence of closures for years....I certainly wont argue that it is better because of it, but to claim that PHP has been seriously crippled by the absence of closures over the years is to entirely overlook and understate the multitude of other problems its users have had to overcome.

Post reply on HN