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

1–10 of 89 posts

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

#1
Folks, I have seen too many HN posts on the fact that PHP is not a good language to develop a robust web application, despite of the fact few of the biggest web sites are running on PHP. We(my team and me) started debating on the issue of choice of the technology for the next project. I am still in some ways not convinced that python may be a better approach.

PHP and Python

* Both have good framework web.py | codeigniter

* Both have good helpful community and support

* Both large set of plugins

How will it impact my webapp if it is written in Python and not PHP

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

#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 it tends to make dealing with code other people wrote easier.

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

#4
It will probably negatively impact your project if all of your team know PHP better and are more comfortable with it. Pick whichever language works best for your team. If some of your team love Python and are able to convince the rest of you as to why its better, then go for it. However, a bunch of strangers on HN probably aren't going to offer much of value. If you are really curious, I suggest diving into Python yourself (no play on words intended!) by reading a book on it, writing some code examples, and then maybe a small project of around 500-1000 lines, trying to use the idioms of the language that you are less familiar with. And if you're not curious, more power to you! In the end, it's the product and the team developing it that are most important.

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

#5
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…

How do you relate "broken window theory" with the grammar of PHP?

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

#6
If you want a more "guided" approach to Python webdev, try looking into Django. There's a large community that has built up around it contributing tons of plugins.

I say this as someone who is working on a Pylons site. You can do anything with Pylons that is possible with Python, you just have to figure it out yourself or twist someone else's library to make it work. Sometimes you don't need that much freedom and the guided approach will do 90% of what you need. Do a bit of research and see which approach best suits your needs.

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

#7
The only way to get useful answers (vs just answers) to these questions is to get a feel for web-app development with Python yourself.

Work through a Python tutorial (I suggest "Dive Into Python") first and then set up Django and work through the Django tutorial. Build a small app of your own with Django.

If you are a decent programmer all the above should take you a weekend at most.

And then you'll have some first hand experience about difficulty of transition etc.

Fwiw, I prefer Django to PHP. But then I am biased so use appropriate amounts of salt. I'd kill myself if I had to work for very long in PHP.

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

#8
Maybe debating about it is not the right approach. If you have experience in PHP and you can afford some (inherent) delays in the next project you should try Python and see for yourself. You will be hit by reality faster and better than any debating would. Then you'll have an educated opinion for the next (second) project.

I'm biased towards Python.

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

#9
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…

How do you relate "broken window theory" with the grammar of PHP?

Broken window theory, as it applies to code essentially says that sloppy code begets sloppy code. PHP itself has sloppy design, such as inconsistent argument order and naming conventions for built-in functions.

Most of the complaints I can think of about PHP that are objectively demonstrable are outdated. The language now has namespaces, closures and the like. Most of the complaints I have left have to do with the feel of the language, and some remaining cultural elements; it feels like a ghetto, even though it seems to have modern infrastructure now.

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

#10
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…

How do you relate "broken window theory" with the grammar of PHP?

[deleted]
Post reply on HN