Click here to Skip to main content
12,747,117 members (29,568 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: Happy debugging! Pin
Richard Deeming26-Sep-12 4:56
memberRichard Deeming26-Sep-12 4:56 
GeneralRe: Happy debugging! Pin
amity200126-Sep-12 5:28
memberamity200126-Sep-12 5:28 
GeneralRe: Happy debugging! Pin
Le Gauchiste26-Sep-12 7:43
memberLe Gauchiste26-Sep-12 7:43 
GeneralRe: Happy debugging! Pin
greldak27-Sep-12 22:51
membergreldak27-Sep-12 22:51 
GeneralRe: Happy debugging! Pin
dojohansen28-Sep-12 4:58
memberdojohansen28-Sep-12 4:58 
GeneralRe: Happy debugging! Pin
zenwalker19859-Oct-12 19:04
memberzenwalker19859-Oct-12 19:04 
GeneralRe: Happy debugging! Pin
Nitin Sawant4-Dec-12 2:31
memberNitin Sawant4-Dec-12 2:31 
GeneralCut out for Greenpeace... PinPopular
Naerling21-Sep-12 23:27
memberNaerling21-Sep-12 23:27 
So my boss is like a rabbit. He just loves his greens.

Unclear naming should stay unclear by commenting it (helper was never used, but that's beside the point).
' A helper variable.
Dim helper As Boolean
Of course we could make clear comments in favor of properly naming our variables.
' s is a SalesOrder

p.DoSomethingElse ' PurchaseOrder
The obvious also needs extra explanation.
i = nX + nY ' Add nX and nY
In case we ever want to compile our code into a beginners how-to-program book.
' Assign the value to the variable
i = 10
We just can't have enough comments!
' Refresh the screen
Keep an active log inside your code, you never know when you need it (SVN alone isn't good enough)... (date, initials, ticket number).
The fun thing about this is that when a fix is larger than a few code files it does not have to be commented.
If it is only a few code files chances are this piece of commentary is copied to each of them, sometimes in multiple places in the same file.
' 2012-09-22 N Ticket # 666.
' The client wants this fix because... Bla, bla, bla...
Some of this guys methods are commented line by line with these kinds of comments... WTF | :WTF:
I tried to talk to him about it, but he's convinced code is unreadable and can never be understood easily by just reading it. Comments are absolutely necessary if you, or another programmer, ever want to quickly make changes to the code. This is the same guy who thinks making a seperate class for almost every method (and randomly make it non-shared/non-static or shared/static) makes code more clear and readable (and single responsibility principle is a bonus!) and who just doesn't use access modifiers out of laziness or indifference...
Of course he is my boss and has eight years of experience where I have only two (how often I had to hear that) so when I disagree with him I'm rude and inexperienced.
I guess someday I'll laugh about it Unsure | :~
It's an OO world.
public class Naerling : Lazy<Person>{
    public void DoWork(){ throw new NotImplementedException(); }

GeneralRe: Cut out for Greenpeace... Pin
AspDotNetDev24-Sep-12 7:09
protectorAspDotNetDev24-Sep-12 7:09 
GeneralRe: Cut out for Greenpeace... Pin
Naerling24-Sep-12 9:06
memberNaerling24-Sep-12 9:06 
GeneralRe: Cut out for Greenpeace... Pin
CIDev18-Oct-12 9:19
memberCIDev18-Oct-12 9:19 
GeneralRefactor Pin
Clifford Nelson26-Sep-12 6:49
memberClifford Nelson26-Sep-12 6:49 
GeneralRe: Cut out for Greenpeace... Pin
CIDev18-Oct-12 9:23
memberCIDev18-Oct-12 9:23 
GeneralRe: Cut out for Greenpeace... Pin
Naerling18-Oct-12 9:38
memberNaerling18-Oct-12 9:38 
GeneralRe: Cut out for Greenpeace... Pin
CIDev22-Oct-12 4:11
memberCIDev22-Oct-12 4:11 
GeneralThey grow up so fast.. PinPopular
jim lahey20-Sep-12 0:03
memberjim lahey20-Sep-12 0:03 
GeneralRe: They grow up so fast.. Pin
Marcus Kramer20-Sep-12 5:55
memberMarcus Kramer20-Sep-12 5:55 
GeneralRe: They grow up so fast.. PinPopular
BobJanova20-Sep-12 6:24
memberBobJanova20-Sep-12 6:24 
GeneralRe: They grow up so fast.. PinPopular
AspDotNetDev21-Sep-12 7:37
protectorAspDotNetDev21-Sep-12 7:37 
GeneralRe: They grow up so fast.. Pin
jim lahey21-Sep-12 8:10
memberjim lahey21-Sep-12 8:10 
GeneralRe: They grow up so fast.. Pin
Naerling21-Sep-12 23:04
memberNaerling21-Sep-12 23:04 
GeneralRe: They grow up so fast.. Pin
zenwalker19859-Oct-12 19:07
memberzenwalker19859-Oct-12 19:07 
GeneralRe: They grow up so fast.. Pin
jim lahey9-Oct-12 22:49
memberjim lahey9-Oct-12 22:49 
GeneralC# properties and type safety Pin
Julien Villers19-Sep-12 23:31
memberJulien Villers19-Sep-12 23:31 
GeneralRe: C# properties and type safety Pin
Andrei Straut19-Sep-12 23:44
memberAndrei Straut19-Sep-12 23:44 

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.170215.1 | Last Updated 19 Feb 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid