When static types make your code shorter
07-Dec-2023 1248
The type system can let you remove runtime validations because invalid states are impossible.In the eternal debate between static and dynamic types, verbosity is often cited as superior in dynamic languages. You don’t have to specify types, so your code is shorter. I’ve definitely experienced this—I sometimes feel like I’m fighting the compiler, flooding my screen with noisy type gymnastics.But my recent work showed me something I’d never seen before: it can sometimes make your code shorter because it can prevent states you don’t have to worry about.
When static types make your code shorter #ruby #rubydeveloper #rubyonrails #static #types #shorter #code #types https://rubyonrails.ba/link/when-static-types-make-your-code-shorter