Click here to Skip to main content
15,887,027 members

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: If it fails, try again Pin
the Kris5-Jun-17 0:30
the Kris5-Jun-17 0:30 
GeneralRe: If it fails, try again Pin
Sander Rossel5-Jun-17 1:10
professionalSander Rossel5-Jun-17 1:10 
JokeRe: If it fails, try again Pin
Jim_Snyder5-Jun-17 3:05
professionalJim_Snyder5-Jun-17 3:05 
GeneralRe: If it fails, try again Pin
Sander Rossel5-Jun-17 5:30
professionalSander Rossel5-Jun-17 5:30 
GeneralRe: If it fails, try again Pin
Jim_Snyder5-Jun-17 6:04
professionalJim_Snyder5-Jun-17 6:04 
PraiseRe: If it fails, try again Pin
Jim_Snyder5-Jun-17 6:05
professionalJim_Snyder5-Jun-17 6:05 
GeneralRe: If it fails, try again Pin
kalberts5-Jun-17 22:06
kalberts5-Jun-17 22:06 
GeneralRe: If it fails, try again Pin
Sander Rossel6-Jun-17 5:58
professionalSander Rossel6-Jun-17 5:58 
Depends, most of the code is just properties, setting, getting, some database queries, standard stuff.
I always get a little sad when I see comments like:
C#
// Assign the variable.
someVar = someVal;

// Loop through the products.
foreach (Product p in products)

// Save the customer.
customer.Save();

// Save the customer. [notice the error]
product.Save();
Unfortunately, I've only seen comments like that.
And because of these kind of comments I came to detest them.
You may think I'm overreacting, but those are actual real-life comments I see almost daily.
I have 7 years of experience and I have yet to find a single comment that is actually helpful.
I rarely comment my code, maybe once or twice when there were some weird side-effects (which is just bad code).
I'm at the point that I prefer my code uncommented (especially when it's bad code, people who write bad code also write bad comments).
Yeah, comments can't be done right.

GeneralRe: If it fails, try again Pin
Nelek6-Jun-17 6:53
protectorNelek6-Jun-17 6:53 
GeneralRe: If it fails, try again Pin
Sander Rossel6-Jun-17 11:06
professionalSander Rossel6-Jun-17 11:06 
GeneralRe: If it fails, try again Pin
Nelek6-Jun-17 19:19
protectorNelek6-Jun-17 19:19 
GeneralRe: If it fails, try again Pin
Sander Rossel6-Jun-17 21:10
professionalSander Rossel6-Jun-17 21:10 
GeneralRe: If it fails, try again Pin
kalberts7-Jun-17 1:34
kalberts7-Jun-17 1:34 
GeneralRe: If it fails, try again Pin
Rob Grainger6-Jul-17 2:12
Rob Grainger6-Jul-17 2:12 
GeneralRe: If it fails, try again PinPopular
kmoorevs5-Jun-17 4:15
kmoorevs5-Jun-17 4:15 
GeneralRe: If it fails, try again PinPopular
Sander Rossel5-Jun-17 5:29
professionalSander Rossel5-Jun-17 5:29 
GeneralRe: If it fails, try again Pin
Daniel Wilianto5-Jun-17 16:04
Daniel Wilianto5-Jun-17 16:04 
GeneralRe: If it fails, try again Pin
Rob Grainger6-Jul-17 2:20
Rob Grainger6-Jul-17 2:20 
GeneralRe: If it fails, try again Pin
DerekT-P6-Jun-17 8:37
professionalDerekT-P6-Jun-17 8:37 
GeneralRe: If it fails, try again Pin
theoldfool5-Jun-17 13:20
professionaltheoldfool5-Jun-17 13:20 
GeneralRe: If it fails, try again Pin
kalberts5-Jun-17 21:51
kalberts5-Jun-17 21:51 
GeneralRe: If it fails, try again Pin
kmoorevs6-Jun-17 4:53
kmoorevs6-Jun-17 4:53 
GeneralRe: If it fails, try again Pin
Rob Grainger6-Jul-17 2:24
Rob Grainger6-Jul-17 2:24 
GeneralRe: If it fails, try again Pin
Richard Deeming6-Jun-17 0:20
mveRichard Deeming6-Jun-17 0:20 
GeneralRe: If it fails, try again Pin
abmv23-Jun-17 9:14
professionalabmv23-Jun-17 9:14 

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.