3 ms·
>typos no longer crash in production because the compiler checks everything. Gentle correction: Python is typed now too and you can get the benefits of typing
by linsomniac 1y ago
>typos no longer crash in production because the compiler checks everything.
Gentle correction: Python is typed now too and you can get the benefits of typing both in your IDE (via LSP) and before deploying to production (via mypy and the like). This happens both by type inference as well as explicit type annotations.
- linsomniac 1y agoWhat percentage of typing features does a language need to have to be "good enough"? Because I'm gaining benefits of typed languages in Python, but responses to this thread are, literally: You aren't a programmer.
- nazgul17 1y agoThat's the dream. Reality is very different. Mypy presents numerous false negatives and false positives. Useful to screen for some bugs, but definitely far from giving guarantees. Not to mention, if a library does not or does sloppily use type annotations, you would not get reliability even with a perfect type checker.
- linsomniac 1y agoI'm sure you're right that there are situations where mypy or ty or LSP give false positives/negatives, but in my use of them over the last ~6 months I really haven't run into many of those situations, or at least none come to mind. Libraries without type annotations do reduce the effectiveness to just what can be inferred by the type checker.
- wiz21c 1y agoyou need to work on big project for these flaws to become a problem. Say, you have a huge code base, 100000's of lines that you didn't write. Then you want to refactor a method's name. Python can't give you any guarantee the refactoring is fully complete. Only a real typed language can do that. I write 95% of my code in python, I love it, it's my go to language for many things. But for huge code base which I don't master, the lack of type system makes me more than nervous.
- globular-toast 1y agoSure but you can also write bugs in a perfectly typed compiled language. Short of formal verification the best we can do is try to minimise the possible surface for errors to occur. I'm of the opinion that language and tooling plays only a small part in writing robust software. What's more important is designing software using simple components that are small enough to be obviously correct.
- chamomeal 1y agoTrue but IME languages that are historically dynamically typed have a rough time truly converting to static types. Php even seems to have decent static types these days, but do my coworkers use them? Hell no
- almostgotcaught 1y ago> Gentle correction: Python is typed now too No it's not and you should lose your union card for lying like this.
- 7bit 1y agoTake a deep breath
- rjh29 1y agoSomehow "gentle correction" sounds more aggressive (passive aggressive) than just saying correction.
- freilanzer 1y agoIt's patronizing.
- boxed 1y ago"Is typed now" is false. "Can be typed now" is somewhat correct. "Can be partially typed now" is actually correct.
- gpderetta 1y agoThe fact that you have to run a separate tool just to check typing is a joke.