When the programmer is forced to handle return codes
Posted Dec 3, 2009 13:19 UTC (Thu) by
NAR (subscriber, #1313)
Parent article:
On the importance of return codes
The manual for the close() system call states that "Not checking the return value of close() is a common but nevertheless serious programming error". Java uses checked exceptions to avoid these problems: if the IOException thrown from e.g. FileOutputStream:close() is not handled, the code doesn't even compile. Unfortunately this doesn't solve the problem - many "not so talented" developers just put an empty try-catch block around to shut the compiler up when at least some error message would be useful...
(
Log in to post comments)