DEV Community

Discussion on: More accurate the type, better the code

 
macsikora profile image
Pragmatic Maciej

Not a fan of then neither. Seen code with constants definitions for hundreds of lines, where most of them where used only ones in the file. I mean if you have type system, such ways like - literals cane be used without a fear, without type system, yes these things are magic numbers/strings and constants, enums are the only solution.