Still interested in why you would think python is bad for web development
I wouldn't say Python is bad for web development; it's just not the gold standard. Python has a lot of good parts--I especially like its comprehensions, iterators, and generator expressions. It makes it quite easy for a team of experienced, disciplined developers to crank out code quickly (so long as the code doesn't need to be parallel).
However, I disagree with you that Python excels at development speed and maintainability. Here are some grievances I have with Python regarding development speed and maintainability, in no particular order:
Python's "fast development" is an illusion achieved mostly by removing static analysis tools from the loop or otherwise making it very hard for static analysis tools to do their jobs. You're only kicking bugs down the road where they're more expensive to find and fix.
Python encourages lots of bad programming practices by making the bad thing easy (no language prevents bad code, but Python actively tempts developers to write it). For examples:
Why inject your dependencies when you can just mock.patch() to "validate" your spaghetti code?
Why design interfaces when you can just isinstance(x, T)?
Why define classes with structure when you can just pass around dicts and tack on whatever you think someone else might need down the road?
And then there are other misfeatures that it includes just to trip up beginners:
inheritance
decorators
default arguments (def func(arg=[]))
Style
Not enforced
Standard library mixes conventions (assertEqual() isn't snake case)
PEP8 is the first and only style guideline I've ever felt makes code less readable. This is obviously subjective, so I won't discuss it further.
Setuptools suck. Pip sucks. Easy_install sucks. I don't think anyone disagrees with this, but it doesn't make development more pleasant.
Python completely ignores it's own Zen. By coincidence, Go seems to respect Python's Zen more than Python does.
Basically, Python makes collaboration harder than it needs to be. Of course, these criticisms are general--not specific to web development. My grievances with Python's web development story are:
You need an external web server to handle requests in parallel with decent performance
I've not yet encountered a decent web framework. Certainly nothing as straightforward as Go's HTTP library.
Parallelism is hard in Python. This isn't a super common case, but it's not an edge case either. And it really sucks when you start a project in Python thinking you won't need parallelism, only to find out you really do need it.
Deploying Python sucks (lots of runtime dependencies)
Like I said, I still think Python is a fun, useful language; I enjoy writing it, I just think Go beats it at many of its own strengths.
4
u/weberc2 Mar 23 '16
I wouldn't say Python is bad for web development; it's just not the gold standard. Python has a lot of good parts--I especially like its comprehensions, iterators, and generator expressions. It makes it quite easy for a team of experienced, disciplined developers to crank out code quickly (so long as the code doesn't need to be parallel).
However, I disagree with you that Python excels at development speed and maintainability. Here are some grievances I have with Python regarding development speed and maintainability, in no particular order:
Python's "fast development" is an illusion achieved mostly by removing static analysis tools from the loop or otherwise making it very hard for static analysis tools to do their jobs. You're only kicking bugs down the road where they're more expensive to find and fix.
Python encourages lots of bad programming practices by making the bad thing easy (no language prevents bad code, but Python actively tempts developers to write it). For examples:
Why inject your dependencies when you can just mock.patch() to "validate" your spaghetti code?
Why design interfaces when you can just
isinstance(x, T)?Why define classes with structure when you can just pass around
dicts and tack on whatever you think someone else might need down the road?And then there are other misfeatures that it includes just to trip up beginners:
inheritance
decorators
default arguments (
def func(arg=[]))Style
Not enforced
Standard library mixes conventions (
assertEqual()isn't snake case)PEP8 is the first and only style guideline I've ever felt makes code less readable. This is obviously subjective, so I won't discuss it further.
Setuptools suck. Pip sucks. Easy_install sucks. I don't think anyone disagrees with this, but it doesn't make development more pleasant.
Python completely ignores it's own Zen. By coincidence, Go seems to respect Python's Zen more than Python does.
Basically, Python makes collaboration harder than it needs to be. Of course, these criticisms are general--not specific to web development. My grievances with Python's web development story are:
You need an external web server to handle requests in parallel with decent performance
I've not yet encountered a decent web framework. Certainly nothing as straightforward as Go's HTTP library.
Parallelism is hard in Python. This isn't a super common case, but it's not an edge case either. And it really sucks when you start a project in Python thinking you won't need parallelism, only to find out you really do need it.
Deploying Python sucks (lots of runtime dependencies)
Like I said, I still think Python is a fun, useful language; I enjoy writing it, I just think Go beats it at many of its own strengths.