- 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
I'm not sure an extra level of abstraction is going to improve things. At least here the wtf is contained
Admin
Admin
If this is supposed to get percentage complete, shouldn't it be 100 * ct/9, or 11.11 * ct?
Admin
In JS you could probably do:
Admin
I found the following WTFs:
*it's not an event; the only other reason it would need to be done this way is if it's nested inside another function - in which case, that's another WTF. **this should be done when it helps improve readability; it doesn't, so why bother?
Dividing by 0.09 is not a WTF. Yes, you could multiply by 11.1 instead. No, it wouldn't make any substantial difference.
Without making it much less "clever", this is how the code should probably look: