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

71–80 of 89 posts

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

#71
post #48

Earlier quoted context omitted.

"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 relat…

"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."

Closures allow for abstractions that are impossible to achieve without them. Yes, you can always get the same functionality, but you will be forced to deal with a weaker abstraction.

PHP has closures however.

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

#72

I have been writing serious, database backed, large dataset, etc etc web applications using Python for about 4 years. Although it may seem like bragging, I probably know the ins and outs and what-have-yous of the python web programming landscape as well as anyone. State of web programming in python: The frameworks: Django: More powerful? No. Faster, more seductive. In the long run you'll outgrow it, if you are any go…

I think for a web framework to be successful (all other things, like features, being equal) it needs a few essential ingredients:

- plugin ecosystem. Not necessarily at the beginning, but tha architecture should make it easy enough to add plugins (or apps, or extensions or whatever they are called by the framework) that developers feel encouraged to do so.

- high profile sites or projects, or at least a high volume of sites, so developers can answer manager's question, "Well, who uses it ?". Again, no framework will have this at the beginning but it will need this to get big (bit of a chicken and egg situation).

- good documentation, preferably but not exclusively online. Good == well written, up to date, well organized and consistent.

- good marketing: maintainers who can blow their own trumpet in the blogosphere, conferences, books, Twitter etc etc.

Now the code may be crap, and it may not have this feature or that feature, or it may or may not be easy to extend or customize. But the above points are required if it is to stand a chance.

Django, despite the flaws you mention (and I agree with some of them, and could add a few of my own) meets these criteria. It has the sites, the documentation, a healthy ecosystem of apps (though of varying quality), and is marketed by people who work, or used to work, in the newspaper business.

Flask, as an up-and-coming framework, is just a couple months old, so obviously doesn't have the ecosystem or the high profile/high volume yet. But it is well-positioned to take off : the documentation is excellent, and it has a good plugin architecture, with about a dozen or so "official" extensions already. Whether or not it does take off depends on many other factors, but I'd say it's future looks quite promising. It may need some aggressive marketing, or at least one or two high profile sites.

Pylons, OTOH, doesn't look so healthy. Documentation, last I looked, was out of date, poorly organized, and contradictory (AuthKit is recommended in the docs, newbies use AuthKit, get confused by its crapiness, go on IRC, and get told "don't use Authkit" - why is it still in the docs at all ?).

It's not so easy to add plugins, except at the WSGI level, which is often the wrong level of abstraction, plus there is the confusion of "entry points" and how to make it all work with Paster. As a result (and also because of the pisspoor docs) despite being around almost as long as Django, Pylons doesn't have a good plugin ecosystem. It has one high profile site - Reddit - but otherwise for the time it's been around I can't think of many others.

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

#73
post #3

Python will probably be easier to write and almost certainly be easier to maintain. It's possible to write good code with PHP, but a great deal of the example code you'll find online is not good. On top of that, the language itself tends to encourage bad design (see "broken window theory"). Python has a strong culture of having one obvious and good way to do things. In some situations, that can feel restrictive, but…

Python has a strong culture of having one obvious and good way to do things.

This is, I think, where people new to Python stumble up. If they were Dutch, the obvious way would be easier to spot.

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

#74

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…

I have been following #pocoo for the past several weeks and have found it to be very helpful and informative. I have seen a few terse replies to poorly-asked questions (such as questions asked with no context), but nothing unfriendly or ignorant. I have also seen conversations that started that way become quite productive.

And Werkzeug, I cannot recommend more highly.

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

#75

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…

I don't know what your experience is with #pocoo, but in general I have found the members courteous and helpful.

If anything you seem a bit ignorant for rejecting a framework you otherwise seem to like because of an IRC channel.

If you are going to call a whole lot of people - some of whom are among the best coders in the Python community -ignorant, I'd suggest coming up with some examples.

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

#76

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…

"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."

Would be nice to know if this is a general thing or if we did something in particular wrong. Because if that is what you remember of this channel we should really improve our behaviour then. So it would be nice if you could elaborate on that.

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

#77
post #48

Earlier quoted context omitted.

"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 relat…

> 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.

Every feature in every language is syntactic sugar for ASM instructions and solves nothing that cannot be solved with raw machine code. It's precisely the expressiveness of the higher-level features that gives them their power.

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

#78

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…

The #pocoo irc discussions are logged and available online for all to see. Why don't you say what your nick is and people can look at what happened. The guys who usually hang out on #pocoo certainly aren't ignorant, but then you may have been online when none of the regulars were around and could have been dealing with a casual visitor.

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

#79

I have been writing serious, database backed, large dataset, etc etc web applications using Python for about 4 years. Although it may seem like bragging, I probably know the ins and outs and what-have-yous of the python web programming landscape as well as anyone. State of web programming in python: The frameworks: Django: More powerful? No. Faster, more seductive. In the long run you'll outgrow it, if you are any go…

I'd have to disagree with you here. In fact, my experience is almost exactly the opposite. Django is incredibly easy to get going, and you can rewrite bits of it as you need to. It's reasonably easy to switch out the templating language if you need to, and I haven't had any problems like you describe with the ORM or admin app. For prototyping apps I wouldn't use anything else. I'm currently running with nginx/FastCGI…

> I basically couldn't populate databases from a unit test, then run a controller, then check the results, since SQLAlchemy would lose the connection after the controller.

What you say makes no sense. SQLAlchemy just uses the usual adapter for whatever database you are using. What does "loses the connection" mean to you? SQLAlchemy, by default, uses a pool of connections. I suspect you tried it for an hour and gave up without really understanding what you were doing.

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

#80
post #36

I have been writing serious, database backed, large dataset, etc etc web applications using Python for about 4 years. Although it may seem like bragging, I probably know the ins and outs and what-have-yous of the python web programming landscape as well as anyone. State of web programming in python: The frameworks: Django: More powerful? No. Faster, more seductive. In the long run you'll outgrow it, if you are any go…

> and it was at my urging that the Banquet library (a common interface to all template systems) was discarded Buffet.

Oh yea. It sucked.
Post reply on HN