Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Yet Another Python Problem List

DZone's Guide to

Yet Another Python Problem List

Python might not be perfect, but are the problems mentioned in this list really all that bad? Read on for some insight from a pro Python dev.

· Web Dev Zone
Free Resource

Should you build your own web experimentation solution? Download this whitepaper by Optimizely to find out.

This was a cool thing to see in my Twitter feed: 

Dan Bader (@dbader_org)
6/19/17, 10:47 PM "Why Python Is Not My Favorite Language" zenhack.net/2016/12/25/why…

More problems with Python. Here's the short list.

1. Encapsulation (Inheritance, really).

2. With Statement.

3. Decorators.

4. Duck Typing (and Documentation).

5. Types.

I like these kinds of posts because they surface problems that are way, way out at the fringes of Python. What's important to me is that most of the language is fine, but the syntaxes for a few things are sometimes irksome. Also important to me is that it's almost never the deeper semantics; it seems to be entirely a matter of syntax.

The really big problem is people who take the presence of a list like this as a reason dismiss Python in its entirety because they found a few blog posts identifying specific enhancements. That "Python must be bad because people are proposing improvements" is maddening. And dismayingly common.

Even in a Python-heavy workplace, there are Java and Node.js people who have opinions shaped by little lists like these. The "semantic whitespace" argument coming from JavaScript people is ludicrous, but there they are: JavaScript has a murky relationship with semicolons and they're complaining about whitespace. Minifying isn't a virtue. It's a hack. Really.

My point, in general, is not to say this list is wrong. It's to say that these points are minor. In many cases, I don't disagree that these can be seen as problems. But I don't think they're toweringly important.

1. The body of the first point seems to be more about inheritance and accidentally overriding something that shouldn't have been overridden. Java (and C++) folks like to use private for this. Python lets you read the source. I vote for reading the source.

2. Yep. There are other ways to do this. Clever approach. I still prefer with statements.

3. I'm not sold on the syntax change being super helpful.

4. People write bad documentation about their duck types. Good point. People need to be more clear.

5. Agree. A lot of projects need to implement type hints to make it more useful.

Implementing an Experimentation Solution: Choosing whether to build or buy?

Topics:
semantics ,python ,web dev

Published at DZone with permission of Steven Lott, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}