Hacker News new | past | comments | ask | show | jobs | submit login

The guy didn't even mention type checking. Guess it's not a big deal to him. Zero type errors during runtime is a big deal.



Well, it's Go, so you're going to have some runtime type errors. interface{} is way too common to avoid them completely (I had the order of arguments for two ConcurrentMaps wrong, for instance, and it blew up on reads -- found it almost instantly, but alas, at runtime). But it should be a much smaller number than python.


That's a very good thing for a language to have, indeed. But Go isn't the best thing to look into for productivity-via-the-type-system. What is (barring the purely functional languages' learning curve) is most any ML descendant; albeit Rust in particular if Go-like performance is desirable.


Rust is descended from ml? Isn't Rust a algol based language? Is it functional?


OCaml was a really strong influence on Rust. The first Rust compiler was written in OCaml. Rust's traits are also similar to Haskell's typeclasses.


Rust also has discriminated unions, structural pattern matching and local type inference.


In addition to typeclasses, Rust has discriminated unions (ergo algebraic datatypes), structural pattern matching, first-class functions, local type inference, and an exclusive/nonexclusive dichotomy of references which serves as a useful proxy for mutability.


People who use Python are generally happy without it IMO. It's not a big deal.


people who use python more aren't as happy about it, otherwise mypy wouldn't exist.

i use python more, can't recommend mypy enough, it's great for what it is. it has warts, but that's to be expected if you add an optional strict modern type system to 20 years of dynamic language.


A large part of why mypy exists is due to cargo-culting groupthink that leaves the 'static typing > dynamic typing' trope less challenged than it ought to be. Static typing is just not as useful as the glossy claims - and the boilerplate cruft incurs way more friction than typists like to admit.

mypy is great, I use it in 'public' api's, tricky parts where context alone is inadequate and where I previously fucked up - the latter usually is a signal that the flow or abstractions can be improved to the extent that I can remove the typing hints.

mypy helps me, it does not force me to throw a goat into the lava pit to appease the compiler.


friction vs 99% reduction of runtime type errors...

If the goal is convenience don't go with types. If the goal is robustness, use types.


Well, python has type check since 3.4 so...


Really? How does it work?


Google mypy for an introduction. Pycharm has good support for it if you want IDE integration.

The stdlib is globally well annoted now. However, most 3rd party libs are not.


mixing untyped libraries with typed basically makes the whole monolith behave as if it was untyped. Once they get the major libraries typed, python projects will become much more robust.


It's not an all or nothing proposition. Gradual improvement is a thing.


agreed. I was just stating something, not a counter at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: