DEV Community

Discussion on: Why static typing matters

Collapse
 
eljayadobe profile image
Eljay-Adobe

As of Python 3.5, optional type annotations were introduced. For small projects, of small value. For large projects, invaluable.

Much as TypeScript brings statically checked types to JavaScript. Huge win for big projects.

Collapse
 
brunooliveira profile image
Bruno Oliveira

Yes!! Exactly! I wasn't aware of this, since last version I used was 3.0

Collapse
 
diliev1996 profile image
Delyan Iliev

Doesn't that mean you should have done better research on the topic before writing this article?

Thread Thread
 
brunooliveira profile image
Bruno Oliveira

Not really, since the point of the article was to talk about types and why it's important to have them.
The article of dropbox mentioned there is from 5 of September. Seems quite recent to me :)
And it was more of a discussion on the side of why it's important to use them and how a company like Dropbox also did it... It wasn't really about Python versions and if anything, it just makes the article and comparisons more accurate

Collapse
 
mindplay profile image
Rasmus Schultz

Interesting 🙂

Note that this isn't a new language feature per se, though - technically, this is new syntax for annotations: it isn't checked by the compiler when the code is loaded, and the types aren't checked by the interpreter at run-time either. An external tool is required to perform the static analysis offline.

I suppose these things would be possible in the future though. Possibly even in userland? (I don't know Python all that well myself.)

Either way, just adding the syntax is a major step up - it's real incentive to proof and harden your code, and start using an offline inspection tool. 👍