logoalt Hacker News

victorpudeyev • today at 3:48 PM • 3 replies • view on HN

...I'm so happy that I write in untyped languages so I don't have to deal with any of this.


Replies

the__alchemist • today at 6:02 PM

I lamented patterns of what I consider over-use of the type system in Rust (This applies to other languages as well). There is a balance: I prefer this over-use/strict use (e.g. implementing a custom non-empty Vec type) over not using typing at all, but a big margin!

Balance in all things?

pyrolistical • today at 3:52 PM

But you kind of do.

For a untype language like js array, since it can be empty, you have to either always check the length, the item returned, or have a precondition to know the array is not empty.

All three of those cases is either code or context you’re holding in your head.

All that stuff is equivalent to a type system

well_ackshually • today at 4:32 PM

Congratulations on having to implement your checks at runtime, but stupid, repetitive, boring work is kind of why we invented compilers.