3 ms·
with robust and potentially high volume code, the most important feature is good behavior in failure domains. disk full, do you abort or continue once the cron
by lanstin 3y ago
with robust and potentially high volume code, the most important feature is good behavior in failure domains. disk full, do you abort or continue once the cron job frees some space; cant alloc memory, do you abort or return a static 503 page? bad contents in some file, do you exit or log the error and carry on? does a bad pyc file generate a good error message or crash python. this robustness is the famed second 90% of the project. normal go looks a cerain way when it is handling these errors.
- za3faran 3y agoNothing you wrote is specific to golang's error handling though, and in actuality, ends up being more brittle because it is possible to miss handling such errors. At least an exception would bubble up instead of keeping the program running in an undefined state.
- preseinger 3y agoit is my very clear experience that rust programs are more brittle than go programs, precisely because rust makes it possible (even encourages) error "bubbling" via `?` in practice, go code bases that are subject to even minimal code review have basically no ignored errors
- lanstin 3y agoyeah my linters won't allow it. and bubbling up is exactly what you dont want for robust code. the UX is different for a failure on rereading a config file when you already have a good config vs. on startup. go code tends to be robust because the authors of the code and the community are the sort that worry about each err value, like Linux and like Python and like C itself.