3 ms·
The proper way to fear in programming is to fear: 1. Your input will be incorrect/corrupt/malicious. Sanitize the crap out of your input. Think of every possib
by titzer 3y ago
The proper way to fear in programming is to fear:
1. Your input will be incorrect/corrupt/malicious. Sanitize the crap out of your input. Think of every possible way your parser could go off the rails and fail.
2. Your code will hit pathologically slow cases. Thread the needle between the overly complicated but linear thing and the simplistic but straightforward to implement, debug and test O(nlogn) thing.
3. Your code will fail in production in a way that is hard to debug. Put in logging, monitoring, and dashboards. Check them. Alert on them.
4. You'll have to debug your code. Put in tracing modes, use good names, divide things up to separately debug them.
5. You'll have to explain your code. Make it easier to understand for future, drunk, or stupid you.