5 ms·
If I had to choose I'd say prefer strict... But reading this made me wonder: what if you could be strict during development but switch to forgiving for deployme
by dicroce 6y ago
If I had to choose I'd say prefer strict... But reading this made me wonder: what if you could be strict during development but switch to forgiving for deployment?
- deleted 6y ago[deleted]
- Vinnl 6y agoThat sounds like the modern JavaScript toolchain. During development, run a linter to make sure you're not using error-prone or outdated functionality, run a type checker to make sure you're passing sane data around, but when running in the browser, don't blow up in the user's face.
- avianlyric 6y ago> what if you could be strict during development but switch to forgiving for deployment? That sounds like a debugging nightmare, where your production system is subtlety different in behaviour to your dev system. Also how do you know that the forgiving behaviour is correct in production? Maybe it prevents a couple of scary error messages, but it could just as equally allow incorrect inputs to be processed and stored, creating a data cleanup nightmare later.
- gpderetta 6y agothat's the idea behind assert in C/C++.
- 4thwaywastrel 6y agoThis is what we do, but we warn rather than just swallow it. I find it the best of both.