Click here to Skip to main content

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, embarrasing 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 PinmvpAbhinav S31-Oct-12 6:46 
GeneralRe: Now this is embarassing PinmemberGary R. Wheeler1-Nov-12 4:23 
QuestionRe: accidental deletion Pinmemberetkins1-Nov-12 5:38 
AnswerRe: accidental deletion PinmemberGary Wheeler1-Nov-12 7:13 
GeneralRe: Now this is embarassing PinmemberMartin.Cheng2-Nov-12 0:32 
GeneralIs silly bad? PinmemberStefan_Lang25-Oct-12 23:53 
GeneralRe: Is silly bad? PinmemberBobJanova25-Oct-12 23:58 
GeneralRe: Is silly bad? Pinmemberpeterchen26-Oct-12 0: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? PinmemberStefan_Lang26-Oct-12 1:56 
GeneralRe: Is silly bad? PinmemberBobJanova26-Oct-12 2:01 
GeneralRe: Is silly bad? PinmemberStefan_Lang26-Oct-12 2:53 
GeneralRe: Is silly bad? PinmemberBobJanova26-Oct-12 3:34 
GeneralRe: Is silly bad? PinmemberStefan_Lang26-Oct-12 4:51 
GeneralRe: Is silly bad? PinmvpPaulo Zemek30-Oct-12 5:43 
GeneralRe: Is silly bad? PinmemberBlackMilan30-Oct-12 0:09 
GeneralRe: Is silly bad? PinmemberStefan_Lang30-Oct-12 1:13 
GeneralRe: Is silly bad? Pinmembergoodsport30-Oct-12 16:41 
GeneralRe: Is silly bad? PinmemberMember 460889831-Oct-12 22:20 
GeneralRe: Is silly bad? PinmvpPaulo Zemek30-Oct-12 4:23 
GeneralRe: Is silly bad? PinmemberFabio Franco30-Oct-12 11:43 
GeneralRe: Is silly bad? Pinmemberlucien6431-Oct-12 6:13 
GeneralA very terrifying stored procedure: how can you solve this issue really ??? PinmemberEricCiz24-Oct-12 21:07 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? PinmemberHaBiX24-Oct-12 21:29 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? PinmemberEricCiz24-Oct-12 21:32 
GeneralRe: A very terrifying stored procedure: how can you solve this issue really ??? PinmvpOriginalGriff24-Oct-12 22:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web01 | 2.8.150414.1 | Last Updated 21 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid