| ▲ | victorpudeyev 2 hours ago | |
...I'm so happy that I write in untyped languages so I don't have to deal with any of this. | ||
| ▲ | pyrolistical 2 hours ago | parent | next [-] | |
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 an hour ago | parent | prev [-] | |
Congratulations on having to implement your checks at runtime, but stupid, repetitive, boring work is kind of why we invented compilers. | ||