|
|
|
| Hurry! Enter The Daily WTF's OMGWTF2 Contest by June 28th! - Prizes! Fame! Trophies! Do your worst: http://omg2.thedailywtf.com/ |
| « Prev | Page 1 | Page 2 | Next » |
|
Oh nooo, brace yourselves..
:) Special significance of the number 26 anyone? Zero padding? That's right folks, they were switching on letters, and decided to use string versions of numbers to represent that. Please post the rest of the code.. |
Wow... Thats a terrible idea. For suggesting something so terrible, go home and sit in a corner and think about what you've done. |
Yep, but you might have a lot of nested if (foo) { * branch 1 * } elseif (bar) { * branch 2 * } // end elseif Which incidently just makes the code even MORE of a WTF (My brain hurts just thinking about that possible monstrosity) Yazeran Plan: To go ot mars one day with a hammer |
|
Wrap that in a for loop and you'd have something.
|
This is what the official Amiga programming examples looked like, back in 1990 or so. EG.,
where resource_1 might be memory, resource_2 is a bitplane based on resource 1, resource 3 is a viewport, etc... And that was back when monitors were substantially less than 1920 pixels wide. |
Re: Unconditionally Useless
2012-07-04 17:10
•
by
Lost (inthe spaghetti)
(unregistered)
|
I imagine it is something like the following:
Are your eyes starting to bleed yet? Ooh, and about the "line number" changing when adding code, it would only happen if some 'programmer' would incorporate a new root level if / else statement.... And that person should have at last 6 of his fingers cut off... |
Re: Unconditionally Useless
2012-07-04 22:50
•
by
Gert
(unregistered)
|
|
You're such a massive idiot
|
Re: Unconditionally Useless
2012-07-04 22:51
•
by
Gert
(unregistered)
|
You're an idiot of epic proportions |
Re: Unconditionally Useless
2012-07-05 05:57
•
by
Steve The Cynic
|
I'd recommend 11 fingers, counting both thumbs and the big finger located on top of his torso, between his shoulders. I believe it's often called a "head". |
Re: Unconditionally Useless
2012-07-05 06:54
•
by
My Name
(unregistered)
|
You think someone like that can be stopped just by cutting off their head?? |
Re: Unconditionally Useless
2012-07-05 07:21
•
by
KEYSTROKE_NOT_FOUND
(unregistered)
|
KEYSTROKE_NOT_FOUND |
Re: Unconditionally Useless
2012-07-05 07:49
•
by
Steve The Cynic
|
No, but at least then everyone around him would know that there is something wrong. What would you do if you found that there was a headless guy bashing on the keyboard with fingerless hands? (OK, yes, if he was the sort of person who produced this kind of mess, you probably wouldn't notice much change...) |
Re: Unconditionally Useless
2012-07-05 07:52
•
by
Joe
(unregistered)
|
Except that we all know how it will end up looking: while (something_to_do) {
--Joe |
Re: Unconditionally Useless
2012-07-05 08:26
•
by
PedanticCurmudgeon
|
Can't tell if trolling or... |
Re: Unconditionally Useless
2012-07-05 08:35
•
by
Captcha:enim
(unregistered)
|
I think he just missed a "not". |
Re: Unconditionally Useless
2012-07-05 08:40
•
by
Anonymous Coward
(unregistered)
|
Sorry it is taking so long, every time I go to test the editor I take my hands off the keyboard and wait for it to do what I want. Bootstraping the editor in self-same editor is a slow process. So far the editor has managed to write 0 lines of its own code... May take some time. |
Re: Unconditionally Useless
2012-07-05 08:59
•
by
Nagesh
(unregistered)
|
Ain't be played bridge. Prefer physical sports as in cricket. |
Re: Unconditionally Useless
2012-07-05 09:01
•
by
Guran
(unregistered)
|
Yup. Sorry. |
Re: Unconditionally Useless
2012-07-05 09:01
•
by
Nagesh
(unregistered)
|
Ain't be a h8r. |
|
This makes as strong a case for paired programming as I've ever seen. It's hard to justify a litany of useless comments when your partner stops you after the first and asks, "WTF are you doing that for?"
|
Re: Unconditionally Useless
2012-07-05 10:30
•
by
Nagesh
(unregistered)
|
Ain't will work when both partner are scarecrows. |
You must be new here. |
Re: Unconditionally Useless
2012-07-05 10:44
•
by
PedanticCurmudgeon
|
You used the word "scarecrow" correctly. That sets a bad precedent. |
Re: Unconditionally Useless
2012-07-05 10:59
•
by
Chelloveck
(unregistered)
|
I wish I had code from one place I worked. A block of supposedly C++ code (well, we were using a C++ compiler, anyway) was deeply nested. How deep? I set my editor's indent spacing to 1 and reformatted it. On my 80-column display, I couldn't see the start of the text in the innermost block. Nested more than 80 levels deep, baby! Now that's manly-man code! |
|
This is the kind of shit that happens when you blindly follow both “single exit” and the mistaken belief that “goto considered harmful” means “don’t use goto, ever.”
|
Re: Unconditionally Useless
2012-07-05 15:04
•
by
dogmatic
(unregistered)
|
TROLLFIGHT!!! |
Re: Unconditionally Useless
2012-07-05 19:11
•
by
sinrtb
(unregistered)
|
|
Before fancy code highlighting and intellisense sometimes matching braces were not highlighted or given any indication of there match (even today if your brace is more than a page back). what probably happened is during a build there was an error or a bug during testing that all came down to one missing brace or an extra brace, he commented the braces to make find the missing one, and just never bothered to remove the comments.
|
|
Completely legal code to me and a very useful habit. Picture this: You have this nested if-else-construct and each block has 20+ lines. It's very easy to loose track of which block is now closed by a bracket.
|
Re: Unconditionally Useless
2012-07-06 13:17
•
by
dogmatic
(unregistered)
|
There is no method to this madness. |
|
I am new to this site, with issues such as this are we allowed to offer ot look at source for the writer? I am usually goot at tracking sources of data etc.
|
Re: Unconditionally Useless
2012-07-09 09:26
•
by
big picture thinker
(unregistered)
|
|
These are the people that think it's bad practice to use "return" as a logic controller eg:
if(!x) return; if(!y) return; if(z) return; //do something here Rather than: if(x) { if(y) { if(z) { //do something here } } } |
Re: Unconditionally Useless
2012-07-09 10:11
•
by
The Great Lobachevsky
|
|
Gert, spend some more time here - Nagesh posts are meant to be humourous. The actual registered Nagesh usually is. The unregistered fakes are usually not even close.
|
|
Thats it people getting worked up over 26 nests? I've made deeper nets.
To keep track though you should add Log('entering if #53'); For each net. Lot easier to debug then step'en through. One more thing.... R'nt u writing code using a language then why leave comments in a different language? It just give people who don't know the programming language a chance to break code they can under stand. The compiler won't do what's int the comments but it will always do what's in the code. Developers should spend more time on getting code right and less time formatting comments to bad code tree paths. I'm serious about the log() part though. |
Re: Unconditionally Useless
2012-07-09 20:49
•
by
Paresh
(unregistered)
|
|
0-8 is not there so what's to say it stops at 26?
What if it goes like this If (var >= 1 ){ Print( "one" ) If ( var >= 2 ){ Print("two") ... If(var >= 1024){ Print("thousand twenty four") }//end 1024 ... }// end 2 }//end 1 The program output could be Enter a number between 0-1024: 3 You entered 3: here are the words for each number One Two Three Can say each number? Could a cool kids learning app. Oh they were called applications I guess. |
|
So many people commenting on this really scare me. Mostly cause one day, I'm going to have to maintain their code!
Comments like this are *never* a good idea. I don't care about your coding standards. Don't do it. For the love of God, don't do it! * Forget the single-exit crap, and have logic gates, so you don't have nested if statements that look like abstract art. * Comments that refer to line numbers (???!) or magic numbers are asking for trouble. And while I'm on comments <rant> <strong> Comments are the work of the antichrist. The only time you should ever use a comment is to explain *why* you are doing something. But never *how* you are doing it. If you have to write a comment that explains how you're doing something, then you have either written some terrible code, or you are insulting the intelligence of the developer who follows you. Sadly, I have to adhere to some pretty rubbish code standards here, and they enforce mandatory comments on public methods. So I have to resort to such insanity as: /// <summary> /// Gets the username for a user by id /// </summary> /// <param name="userId">The user id</param> /// <returns>The username for the user</returns> public string GetUsernameForUserById(int userId) { var username = <code that gets the username>; return username; } This comment is worse than a waste of time. It's a liability! Not only does it not tell you anything you couldn't have gotten from the method signature, but the second it was written, the comment started becoming stale. Waiting patiently for the day when someone refactors the method without updating the comment. </strong> </rant> |
Re: Unconditionally Useless
2012-07-17 13:56
•
by
Danielle
(unregistered)
|
|
I submitted this code.
It is 26 (and more) nested if And sadly, instead of putting comments like those: } //endif (Condition bla bla bla) They actually put those coments } // else if 25 |
Re: Unconditionally Useless
2012-11-08 00:20
•
by
Anone
(unregistered)
|
One thousand and twenty-four. |
| « Prev | Page 1 | Page 2 | Next » |