When static types make your code shorter

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 #code #types

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles