- 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 think that last line used to read:
because in a lot of places in the code an extra space was needed, and the developer was guessing (based upon discussions?) that more spaces or no spaces at all would be needed in the future.
Then later it was decided that no spaces were needed and then you'll end up with this...
Admin
Admin
Or you can rewrite that function: public string AddSpace(string value) { string space = " "; if (value.Contains("[Advertisement"]))//.Equals(space)) { return space; }
Admin
This would never pass a code review done by me - the string 'variable' should be a const.
Admin
Yes, well, they are at the end of the article. What exactly were you trying to say?
Admin
Admin
Admin
most of them are in accounting, so I pity you.
Admin
The WTF is that the uselessness is clickable!
Admin
Oh, sure. The one time I try and "store" something in an intern I get brought up on sexual harrassment charges, but ol' C++ can do it whenever it wants, huh?
Admin
Oh, sure. The one time I try and "store" something in an intern I get brought up on sexual harrassment charges, but ol' C# can do it whenever it wants, huh?
Admin
TRWTF is that this is an instance method.
Admin
Admin
Don't understand - it just gives a new fresh and previously unused space back! I did that a lot in past....
Admin
Not true. It doesn't do absolutely nothing. This function introduces the possibility of a null pointer exception if value is null. You would have to switch the comparison to space.Equals(value) for it to have absolutely no possible impact on anything.