| > No. Yes. There is literally more visual noise on the screen. This is not up for debate - more pixels are lit on the monitor you are looking at. > When you make a function call, and that call can fail, then the happy-path and the sad-path are both things that you need to manage as a caller. False - the direct caller is not responsible for error-handling, in general - some transitive super-caller will be. Errors as return values needlessly generate this visual noise for every caller, when not needed, in addition to introducing aforementioned coupling. > Error handling code is not "noise". It is equally important to success-path code. You're misunderstanding my point. I never said that error-handling code is noise - it isn't. What is noise is forcing every single function call between the appropriate error-handling point and the error location to have extra useless junk. When there's an error, you should see exactly two things in your codebase: some stuff at the point where the error is thrown, and some stuff at the point where the error is handled - and, given that the place where the error should be handled is rarely the direct caller, you should see nothing in between. |
The direct caller is _absolutely_ responsible for error handling.
> What is noise is forcing every single function call between the appropriate error-handling point and the error location to have extra useless junk.
No. Falliable operations must be managed by the thing which calls them. Anything else is shadow control flow, which subverts understanding and negatively impacts reliability.