- 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 would have said that the other code block is less wrong rather than more correct, but yes.
Admin
Mysteriously, today I'm frist.
Admin
Nice Sherlock Homes reference.
Admin
Admin
I'm going to guess that dir and localDir are never used. Only filePath is used. And at some point later there's a if string.IsNullOrEmpty(filePath) //... logic to set filePath.
Admin
More along the lines that the code sample given to us is "not even wrong."
Admin
The code base I inherited is full of stuff like this. I could submit the entire code base as is and generate content for this site for at least a year.
Admin
When you have eliminated the impossible, whatever remains, however improbable, must be "null".
Admin
We don't know if they use the a recent version of VS, but if they do, there is another layer of WTF - it comes with analyzers out of the box which would flag these variables as unused. OBVIOUSLY, these guys completely ignore those pesky annoyances like "warnings" and "info messages", who cares about those, amirite??
Admin
There is an old adage I continue to use: Debugging is the act of removing errors from a program. Programming is the act of putting them in.
Admin
Why did someone define PRODUCTION when DEBUG is already part of the default project templates since 2001?
Admin
Yeah, somebody's suppressing warnings. Once in a blue moon you actually need to suppress a bogus warning, but almost always it's either an error or can be trivially dealt with by making it clearer to the compiler what you're up to.
The only case I can think of that needs suppressing is when you have two separate code paths where you're guaranteed one will run but you can't do it as an if...then...else. Assign a default and it gripes that it's never used. Don't assign it, it gripes it's not assigned. (Admittedly, I haven't hit it in years, perhaps they've gotten smarter.)
Admin
My guess would be that it works perfectly, because it creates the directory if it doesn't already exist.
Admin
How is this not flagged for moderation ??
Admin
My comment with a code snippet (https://thedailywtf.com/articles/comments/constantly-magic): still waiting for moderation months after posting.
Mag's comment advertising for illegal narcotics: gets published without raising any flags.
Found the real WTF.
Admin
The real WTF in this thread of comments is that an adertisement can be seen while multiple legit comments are hold for moderation... what is up with that? :)
Admin
Could we have some daily moderation please?
Admin
EZ: just use the Preprocesser to defile [sic] null to be "null"
Admin
I can tell you how this works... just check the directory "C:\Windows\system32\null" on the machine running this code...
Admin
A week later and still the highly suspect advertisement is shown and the objections are still hidden while being held for moderation.
Was it maybe a paid advertisement?
Admin
Not illegal everywhere.