Click here to Skip to main content
11,412,833 members (74,199 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, 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: Uncheck this if you are not a bot Pin
Dennis_E at 7-Jul-14 10:25
professionalDennis_E7-Jul-14 10:25 
GeneralRe: Uncheck this if you are not a bot Pin
jasonHall at 7-Jul-14 11:20
memberjasonHall7-Jul-14 11:20 
GeneralRe: Uncheck this if you are not a bot Pin
jesarg at 7-Jul-14 11:49
memberjesarg7-Jul-14 11:49 
GeneralRe: Uncheck this if you are not a bot Pin
OriginalGriff at 8-Jul-14 2:38
protectorOriginalGriff8-Jul-14 2:38 
GeneralXPath oddity Pin
PIEBALDconsult at 3-Jul-14 9:15
memberPIEBALDconsult3-Jul-14 9:15 
GeneralRe: XPath oddity Pin
Richard Deeming at 3-Jul-14 9:39
professionalRichard Deeming3-Jul-14 9:39 
GeneralRe: XPath oddity Pin
PIEBALDconsult at 3-Jul-14 10:21
memberPIEBALDconsult3-Jul-14 10:21 
GeneralComparisons... Pin
jan larsen at 1-Jul-14 0:30
memberjan larsen1-Jul-14 0:30 
GeneralRe: Comparisons... Pin
Bernhard Hiller at 1-Jul-14 21:56
professionalBernhard Hiller1-Jul-14 21:56 
GeneralRe: Comparisons... Pin
jan larsen at 4-Jul-14 3:46
memberjan larsen4-Jul-14 3:46 
GeneralRe: Comparisons... Pin
Bernhard Hiller at 4-Jul-14 4:15
professionalBernhard Hiller4-Jul-14 4:15 
GeneralRe: Comparisons... Pin
jan larsen at 9-Jul-14 23:28
memberjan larsen9-Jul-14 23:28 
GeneralIIF to the rescue... Pin
Sander Rossel at 30-Jun-14 6:29
professionalSander Rossel30-Jun-14 6:29 
GeneralRe: IIF to the rescue... Pin
Bernhard Hiller at 30-Jun-14 21:38
professionalBernhard Hiller30-Jun-14 21:38 
Where do you see the problem behind that code that justifies it to be posted in the Weird and Wonderful?

Well, that IsNew function should better be a function of the Order class and not need a parameter (because OrderNumber could be expected to be a Property).

But otherwise? Does VB.Net have the ternary operator like C# (return OrderNumber = 0 ? true : false;)? I don't know.

Or did you want to tell us that it's better to do the comparison of OrderNumber to 0 whenever that IsNew function is used? Oh no! That would deserve to be posted here! IsNew clearly tells you the intention of the code, while If(OrderNumber=0) does not.
GeneralRe: IIF to the rescue... Pin
Sander Rossel at 30-Jun-14 21:56
professionalSander Rossel30-Jun-14 21:56 
GeneralRe: IIF to the rescue... Pin
Bernhard Hiller at 30-Jun-14 22:35
professionalBernhard Hiller30-Jun-14 22:35 
GeneralRe: IIF to the rescue... Pin
Sander Rossel at 30-Jun-14 22:56
professionalSander Rossel30-Jun-14 22:56 
GeneralRe: IIF to the rescue... Pin
Bernhard Hiller at 1-Jul-14 21:57
professionalBernhard Hiller1-Jul-14 21:57 
GeneralRe: IIF to the rescue... Pin
Sander Rossel at 2-Jul-14 1:58
professionalSander Rossel2-Jul-14 1:58 
GeneralRe: IIF to the rescue... Pin
Nagy Vilmos at 1-Jul-14 0:43
professionalNagy Vilmos1-Jul-14 0:43 
GeneralRe: IIF to the rescue... Pin
Sander Rossel at 1-Jul-14 1:16
professionalSander Rossel1-Jul-14 1:16 
GeneralRe: IIF to the rescue... Pin
Richard Deeming at 1-Jul-14 3:33
professionalRichard Deeming1-Jul-14 3:33 
GeneralRe: IIF to the rescue... Pin
PaulLinton at 2-Jul-14 16:14
memberPaulLinton2-Jul-14 16:14 
GeneralRe: IIF to the rescue... Pin
Sander Rossel at 2-Jul-14 20:31
professionalSander Rossel2-Jul-14 20:31 
GeneralRe: IIF to the rescue... [modified] Pin
Jörgen Andersson at 5-Jul-14 21:02
professionalJörgen Andersson5-Jul-14 21:02 
GeneralStarting to page OS to disk! Pin
David O'Neil at 27-Jun-14 11:22
memberDavid O'Neil27-Jun-14 11:22 
GeneralChecking for empty guid Pin
Stepan Kobzey at 26-Jun-14 11:04
memberStepan Kobzey26-Jun-14 11:04 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 26-Jun-14 11:13
memberPIEBALDconsult26-Jun-14 11:13 
GeneralRe: Checking for empty guid Pin
Stepan Kobzey at 26-Jun-14 11:16
memberStepan Kobzey26-Jun-14 11:16 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 26-Jun-14 11:37
memberPIEBALDconsult26-Jun-14 11:37 
GeneralRe: Checking for empty guid Pin
Sander Rossel at 26-Jun-14 11:51
professionalSander Rossel26-Jun-14 11:51 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 26-Jun-14 12:05
memberPIEBALDconsult26-Jun-14 12:05 
GeneralRe: Checking for empty guid Pin
Sander Rossel at 26-Jun-14 13:32
professionalSander Rossel26-Jun-14 13:32 
GeneralRe: Checking for empty guid Pin
OriginalGriff at 26-Jun-14 12:11
protectorOriginalGriff26-Jun-14 12:11 
GeneralRe: Checking for empty guid Pin
Sander Rossel at 26-Jun-14 13:32
professionalSander Rossel26-Jun-14 13:32 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 27-Jun-14 5:37
memberPIEBALDconsult27-Jun-14 5:37 
GeneralRe: Checking for empty guid Pin
HomerTheGreat at 26-Jun-14 12:19
memberHomerTheGreat26-Jun-14 12:19 
GeneralRe: Checking for empty guid Pin
Bernhard Hiller at 27-Jun-14 1:11
professionalBernhard Hiller27-Jun-14 1:11 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 27-Jun-14 5:37
memberPIEBALDconsult27-Jun-14 5:37 
GeneralRe: Checking for empty guid Pin
Bernhard Hiller at 27-Jun-14 1:06
professionalBernhard Hiller27-Jun-14 1:06 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 27-Jun-14 5:38
memberPIEBALDconsult27-Jun-14 5:38 
GeneralRe: Checking for empty guid Pin
Nagy Vilmos at 27-Jun-14 2:59
professionalNagy Vilmos27-Jun-14 2:59 
GeneralRe: Checking for empty guid Pin
Richard Deeming at 27-Jun-14 3:36
professionalRichard Deeming27-Jun-14 3:36 
GeneralRe: Checking for empty guid [modified] Pin
PIEBALDconsult at 27-Jun-14 4:11
memberPIEBALDconsult27-Jun-14 4:11 
GeneralRe: Checking for empty guid Pin
Richard Deeming at 27-Jun-14 4:21
professionalRichard Deeming27-Jun-14 4:21 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult at 27-Jun-14 5:26
memberPIEBALDconsult27-Jun-14 5:26 
GeneralInteresting... Pin
Dave Kreskowiak at 23-Jun-14 3:53
mvpDave Kreskowiak23-Jun-14 3:53 
GeneralRe: Interesting... Pin
Simon Lee Shugar at 23-Jun-14 4:10
memberSimon Lee Shugar23-Jun-14 4:10 
GeneralRe: Interesting... Pin
0bx at 23-Jun-14 7:42
member0bx23-Jun-14 7:42 
GeneralRe: Interesting... Pin
Bernhard Hiller at 23-Jun-14 23:37
professionalBernhard Hiller23-Jun-14 23:37 

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.150427.1 | Last Updated 27 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid