3 ms·
Type hints are a great feature in Python to enhance readability and to catch programming errors when refactoring or learning a new library. A lot of the featur
by okl 3y ago
Type hints are a great feature in Python to enhance readability and to catch programming errors when refactoring or learning a new library.
A lot of the features presented here are helpful for programming in the large, i.e., once the program exceeds mental capacity.
As a general goal I think that programmers should reduce complexity even of simple stretches of code so that, adding all its context, a larger chunk of code fits into their brain at once and errors become more visible. Part of that is unloading tasks onto the tools.
Unfortunately, its still common practice to create write-only code, often justified by an "it works" (usually not true).