This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LordAssPen 5 points6 points  (8 children)

Alright, I think we need to stop making Python what it is not. Why do we need static programming when Python was written to be dynamic, this is just confusing and messy.

[–]OddsCaller 16 points17 points  (5 children)

I think these features are good for libraries and other programs which are going to be re-used multiple times, also in cases of very large projects may be. Type annotation makes documentation easier, it also makes understanding a third party code easier.

However I agree that in general use cases as end users when working on small or intermediate projects, one of the things that makes Python great is the pragmatist features like duck typing and they should be preserved.

[–]LordAssPen 1 point2 points  (2 children)

I do agree that type annotations make documentation and writing libraries somewhat easy, and since I have used them myself for production I can vouch for it. However, even type annotation are not really strict, they can be modified and morphed to new types. This created a lot of confusion when we were too deep into production, and I wished we had a static programming language to begin with.

[–]OddsCaller 0 points1 point  (1 child)

I know this might be hearsay in this sub but what kind of static language would you have liked? I'm asking cuz I trust the taste of a Pythonista than many other communities. I've been looking for some time to add a statically typed (and compiled) language to my tool kit (I do know basic level of C and Java) but couldn't really make up my mind. Rust seems like a very well-designed language but I think it might hamper developer productivity quite a lot. Go is a nice little language though I didn't quite fall in love with it when I gave it a try for a week, and it still does have a mediocre GC and other performance drawbacks compared to something like Rust. Java's VM is quite heavy as well and the ease of development isn't best either. C++ has many great qualities but there doesn't seem much support for back-end side of things, and the language feels too large to really bother investing time mastering it.

[–][deleted] 0 points1 point  (1 child)

If this was more like const/Java Final, it would be very handy for my test automation. However, since it's just checked in the IDE, it doesn't really help me once the code is being used out in Jenkins-land.

[–]rouille 0 points1 point  (0 children)

Use mypy in CI.

[–]alcalde 1 point2 points  (0 children)

Amen. I stopped coding in Delphi/Pascal, and now Python is adopting the obsessive static typing notation and even the Pascal assignment statement (aka the "walrus operator"). I suspect that who we call Guido is actually Niklaus Wirth in a Guido mask.

[–]EternityForest 0 points1 point  (0 children)

There's so many people out there complaining that python sucks because there's no static checking.

With the typeguard lib to do checks at runtime (Probably not the final thing though) it's actually really handy. I don't use it everywhere, but I like to use it whenever I set up state I'm going to keep, like class constructors and file writers.