- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Scrollpocalypse
- Fast Quick
- 12345
- Said Different
- Ai Dios Mio
- Unrewarding
- Good Time
- Hello, New Mexico!
-
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 imagine the line immediately before reads:
generate a private keyEdit Admin
Ironically if this is C/C++/C# it won't matter because the compiler will optimize it away. Not sure about other languages, a lot of them have way less optimization going on that a lot people give them credit for...
But yeah, constructs like that are weird and I found them mostly in code with languages that enforce definition at declaration like Java.
Edit Admin
You could argue that this is more of a WTF than a lot of the other code we get here. A 100-line mess could be the result of one developer that just can't keep in their head everything that's happening, or it could be the result of 10 different developers adding stuff over time and never really understanding what the code is doing.
But something like this should only take two seconds to see the stupidity.
Edit Admin
Ummm... the thing that mattered in the first place wasn't the extra instructions that would be executed. A coding pattern that doesn't hurt performance but makes it difficult to understand what the code is doing is a very bad thing - even it it doesn't have any negative performance attributes.