- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
All the commenters have been silent all day because the title was the frist to use the word "frist".
The TestingTime studies has a variable phoneWearable = {yes, no, FILE_NOT_FOUND, yes_and_no}
Admin
I think they were silent all day because I published a few hours late due to a blog software WTF: apparently if you "publish" a post but don't specify the date and time, it's not actually published.
Admin
Columbus day is October 10th and not 1st or are you trying to confuse us?
Admin
You forgot: yes_implies_no
Admin
Alas excpected exceptions are far too common.... Meaning that the underlying condition is not really exceptional - it is readily predictible as a possibility....
Consider opening a file for write ... Before attempting:
Now even after all these checks (which do not involve even first-change exceptions), there is a possibility that things will change in the mS before the write occurs.... but that would be exceptionally rare (for most systems)
Admin
So rare that it never appears in static analysis tools under the bug category "ToCToU", Time of Check/Time of Use...
By "never", of course, I mean "always".
Admin
Well, yes and no...
Admin
AARRFGGH!!! The real WTF in that doctor's appointment is displaying unformatted telephone numbers. WTF can parse a random stream of random digits?
Admin
Aren't exceptions always to be expected (when using a language/API than can actually throw exceptions of course)? If you didn't expect them you would not use
try
in the first place.As for your example, it is decidedly NOT possible to predict that an/no exception WILL be thrown (on most systems). It IS however possible to predict the possibility (I'm not using the statistics term here), as in "yeah its possible that a file operation throws", that's why you always
catch
and handle that exception. It might not throw most times (e.g. because the user cleverly selects a "good" file name), but no amount of checks can guarantee it, so why even bother?