Hacker News new | ask | show | jobs
by duckinator 5601 days ago
I don't think there's a clear-cut winner - it's mostly choice. Strong typing generally allows more solid, less-breakable code; weak typing generally allows quick prototyping and small scripts to be done at a faster pace.

This is why I suggested a -strict flag (https://github.com/bendmorris/scotch/issues/3): if you decide that you're done prototyping, and would like to make what you're doing more explicit.

Another method could possibly be being able to specify in-code that it's strict, perhaps something along the lines of "#flags: strict <...>" for flags always applied to that file? (Yes, that's ugly. I'm talking about the idea, not that particular incarnation of the idea)

This would allow the best of both worlds, without trying to force them to play nice with each other in one file.

However, even while avoiding mixing them in one file, that still raises other issues. For instance, if non-strict file "a" imports strict file "b", is "a" strict? I'd vote not (this would allow the entire standard library to be strict for clarity, and not cause any issues elsewhere), but I'm curious what other people's opinions are.