5 ms·
The main problem with type hints for Python code is that it changes the way you think about writing Python. Before, it went something like this: 1) Install Py
by wheelerof4te 5y ago
The main problem with type hints for Python code is that it changes the way you think about writing Python.
Before, it went something like this:
1) Install Python (if you don't have it already)
2) Install your favorite text editor
3) Write some Python!
Now, it goes something like this:
1) Install Python
2) Install your favorite IDE
3) Install plugins for your IDE
4) Install black, mypy, flake8 plus some other nonsensical "helper" library
5) Don't forget your poetry, gotta have that
6) Be careful to pick only 3rd party libraries that have good type hints..
7) God help you if you try writing something yourself, let your IDE do that.
Type hints make not only your code more complicated and unreadable. They complicate your entire workflow.
- tomerv 5y agoHow did you get from type hints to black, not to mention poetry? Seems like you're just complaining about there being a mature ecosystem around Python, and the implicit expectation to use it.
- wheelerof4te 5y agoAnd here I thought my explanation at the bottom covered this. Let's try again: Python has become a mess. It is no longer a simple productive language to get into like it used to be. Now, you are expected to buy into it's ecosystem, like it is C# or Java. Well, it is not. It's Python and I am truly sad they are killing it with thousand cuts.
- tomerv 5y agoYes, it's getting more complicated. Yes, there's a whole ecosystem being built around it, and the line between language and ecosystem is blurry. And indeed, there's a hidden expectation for any Python developer to buy into the whole ecosystem. But that's just a symptom of a mature programming language that's used in a variety of complicated scenarios. You don't have to do it all, and no-one is forcing you. You can always write your one-off script without black, flake8, type hinting, or anything of the sort. If it's just your script then no-one will even know. On the other hand, if you want your code to be part of the larger ecosystem, then you're expected to write it in a conformant way (e.g. pep8 formatting). And that's a good thing!