Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Failure isn't defined by programmed control structures, it's defined by requirements and implemented via programming.

If the requirements of a hello world program include accounting for all error boundaries of the host system, then I am yet to see them written down but would invite anyone to provide them.

The parent comment has made a start in this regard.



every program is given the 3 stdio channels: stdin, stdout, stderr. if the program is unable to use any of these as expected, it's an error that should be reported back to the user. today it's /dev/full but tomorrow it could be a log file with wrong access perms. you don't want to be returning 2 weeks later to find out that nothing was written, and your program didn't complain.


Agreed, the log file example is quite good, but also something like a systemd script reporting success when it actually failed.


This is true of *nix but on Windows they can be absent. In face this is the default for GUI applications.


This particular category of bug is something people - those making up the requirements too - probably wouldn't even consider.


Agreed. In a real world business requirements scenario, it would be dropped as premature optimisation if it was even considered at all.


And this is the reason unit tests are very often insufficient and provide vanishingly small value. They test programming details, while integration tests test requirements implemented via programming. Loved your first paragraph.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: