Click here to Skip to main content
13,055,490 members (47,290 online)

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Now this is embarassing Pin
Member 314096230-Oct-12 17:46
memberMember 314096230-Oct-12 17:46 
GeneralRe: Now this is embarassing Pin
Gary R. Wheeler31-Oct-12 3:06
memberGary R. Wheeler31-Oct-12 3:06 
GeneralRe: Now this is embarassing Pin
Michael K Gray30-Oct-12 20:04
memberMichael K Gray30-Oct-12 20:04 
GeneralRe: Now this is embarassing Pin
AspDotNetDev30-Oct-12 20:22
protectorAspDotNetDev30-Oct-12 20:22 
GeneralRe: Now this is embarassing Pin
Gary R. Wheeler31-Oct-12 3:34
memberGary R. Wheeler31-Oct-12 3:34 
GeneralRe: Now this is embarassing Pin
lucien6431-Oct-12 5:00
memberlucien6431-Oct-12 5:00 
GeneralRe: Now this is embarassing Pin
Abhinav S31-Oct-12 5:46
mvpAbhinav S31-Oct-12 5:46 
GeneralRe: Now this is embarassing Pin
Gary R. Wheeler1-Nov-12 3:23
memberGary R. Wheeler1-Nov-12 3:23 
QuestionRe: accidental deletion Pin
etkins1-Nov-12 4:38
memberetkins1-Nov-12 4:38 
AnswerRe: accidental deletion Pin
Gary Wheeler1-Nov-12 6:13
memberGary Wheeler1-Nov-12 6:13 
GeneralRe: Now this is embarassing Pin
Martin.Cheng1-Nov-12 23:32
memberMartin.Cheng1-Nov-12 23:32 
GeneralIs silly bad? Pin
Stefan_Lang25-Oct-12 22:53
memberStefan_Lang25-Oct-12 22:53 
GeneralRe: Is silly bad? Pin
BobJanova25-Oct-12 22:58
memberBobJanova25-Oct-12 22:58 
GeneralRe: Is silly bad? Pin
peterchen25-Oct-12 23:37
memberpeterchen25-Oct-12 23:37 
No, Silly rocks[^]!

Simple is great, but simple is in the eye of the maintainer.

I consider your example line simply as redundant and might wonder why the long form was chosen.

---
As usual I'm tempted to make it even more explicit:

bool flag = ((a > b) ? true : false) ? true : false;


Now that's better, isn't it? It spells out the purpose right there: if a > b is true, set flag to true, but if a > b is false, set flag to false.

GeneralRe: Is silly bad? Pin
Stefan_Lang26-Oct-12 0:56
memberStefan_Lang26-Oct-12 0:56 
GeneralRe: Is silly bad? Pin
BobJanova26-Oct-12 1:01
memberBobJanova26-Oct-12 1:01 
GeneralRe: Is silly bad? Pin
Stefan_Lang26-Oct-12 1:53
memberStefan_Lang26-Oct-12 1:53 
GeneralRe: Is silly bad? Pin
BobJanova26-Oct-12 2:34
memberBobJanova26-Oct-12 2:34 
GeneralRe: Is silly bad? Pin
Stefan_Lang26-Oct-12 3:51
memberStefan_Lang26-Oct-12 3:51 
GeneralRe: Is silly bad? Pin
Paulo Zemek30-Oct-12 4:43
mvpPaulo Zemek30-Oct-12 4:43 
GeneralRe: Is silly bad? Pin
BlackMilan29-Oct-12 23:09
memberBlackMilan29-Oct-12 23:09 
GeneralRe: Is silly bad? Pin
Stefan_Lang30-Oct-12 0:13
memberStefan_Lang30-Oct-12 0:13 
GeneralRe: Is silly bad? Pin
goodsport30-Oct-12 15:41
membergoodsport30-Oct-12 15:41 
GeneralRe: Is silly bad? Pin
Member 460889831-Oct-12 21:20
memberMember 460889831-Oct-12 21:20 
GeneralRe: Is silly bad? Pin
Paulo Zemek30-Oct-12 3:23
mvpPaulo Zemek30-Oct-12 3:23 
GeneralRe: Is silly bad? Pin
Fabio Franco30-Oct-12 10:43
memberFabio Franco30-Oct-12 10:43 
GeneralRe: Is silly bad? Pin
lucien6431-Oct-12 5:13
memberlucien6431-Oct-12 5:13 
GeneralA very terrifying stored procedure: how can you solve this issue really ??? Pin
EricCiz24-Oct-12 20:07
memberEricCiz24-Oct-12 20:07 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
HaBiX24-Oct-12 20:29
memberHaBiX24-Oct-12 20:29 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
EricCiz24-Oct-12 20:32
memberEricCiz24-Oct-12 20:32 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
OriginalGriff24-Oct-12 21:32
mvpOriginalGriff24-Oct-12 21:32 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
Marcus Kramer25-Oct-12 3:00
memberMarcus Kramer25-Oct-12 3:00 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
BobJanova24-Oct-12 22:22
memberBobJanova24-Oct-12 22:22 
JokeRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
ryanb3125-Oct-12 2:03
memberryanb3125-Oct-12 2:03 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
ENOTTY25-Oct-12 19:17
memberENOTTY25-Oct-12 19:17 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
Zac Greve25-Oct-12 19:24
memberZac Greve25-Oct-12 19:24 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
Peter_in_278025-Oct-12 20:30
memberPeter_in_278025-Oct-12 20:30 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
Gary Wheeler26-Oct-12 0:15
memberGary Wheeler26-Oct-12 0:15 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? Pin
Zac Greve25-Oct-12 19:23
memberZac Greve25-Oct-12 19:23 
GeneralBug of the day Pin
Chris Maunder23-Oct-12 4:51
adminChris Maunder23-Oct-12 4:51 
GeneralRe: Bug of the day Pin
Marcus Kramer23-Oct-12 5:04
memberMarcus Kramer23-Oct-12 5:04 
GeneralRe: Bug of the day Pin
Ravi Bhavnani23-Oct-12 5:09
memberRavi Bhavnani23-Oct-12 5:09 
GeneralRe: Bug of the day Pin
Christoph Keller23-Oct-12 5:19
memberChristoph Keller23-Oct-12 5:19 
GeneralRe: Bug of the day Pin
Chris Meech23-Oct-12 5:24
memberChris Meech23-Oct-12 5:24 
GeneralRe: Bug of the day Pin
Sentenryu23-Oct-12 5:28
memberSentenryu23-Oct-12 5:28 
GeneralRe: Bug of the day Pin
OriginalGriff23-Oct-12 8:15
mvpOriginalGriff23-Oct-12 8:15 
GeneralRe: Bug of the day Pin
Sentenryu23-Oct-12 8:37
memberSentenryu23-Oct-12 8:37 
GeneralRe: Bug of the day Pin
Marcus Kramer23-Oct-12 8:55
memberMarcus Kramer23-Oct-12 8:55 
GeneralRe: Bug of the day Pin
Sentenryu23-Oct-12 23:27
memberSentenryu23-Oct-12 23:27 
GeneralRe: Bug of the day Pin
BobJanova23-Oct-12 23:55
memberBobJanova23-Oct-12 23:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 28 Jul 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid