Write code that’s easy to delete, and easy to... — programming is terrible

/code-to-debug

  • Write code that’s easy to delete, and easy to debug too.
    https://programmingisterrible.com/post/173883533613/code-to-debug

    The software always crashed the last time it ran, and now it is always out of cpu, out of memory, and out of disk too. All of the workers are hammering an empty queue, everyone is retrying a failed request that’s long expired, and all of the servers have paused for garbage collection at the same time. Not only is the system broken, it is constantly trying to break itself.

    Even checking if the system is actually running can be quite difficult.

    It can be quite easy to implement something that checks if the server is running, but not if it is handling requests. Unless you check the uptime, it is possible that the program is crashing in-between every check. Health checks can trigger bugs too: I have managed to write health checks that crashed the system it was meant to protect. On two separate occasions, three months apart.