Click here to Skip to main content
15,881,588 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: Needed a series of random numbers Pin
Bert Mitton14-Sep-11 4:04
professionalBert Mitton14-Sep-11 4:04 
GeneralMessage Removed Pin
21-Sep-11 7:04
professionalN_tro_P21-Sep-11 7:04 
GeneralRe: Needed a series of random numbers Pin
Bert Mitton22-Sep-11 3:08
professionalBert Mitton22-Sep-11 3:08 
GeneralRe: Needed a series of random numbers Pin
Luis D. Aguilar7-Oct-11 7:49
Luis D. Aguilar7-Oct-11 7:49 
GeneralCommenting code... Pin
Sander Rossel4-Sep-11 20:47
professionalSander Rossel4-Sep-11 20:47 
GeneralRe: Commenting code... Pin
Firo Atrum Ventus4-Sep-11 22:02
Firo Atrum Ventus4-Sep-11 22:02 
GeneralRe: Commenting code... Pin
Allan Thomas5-Sep-11 14:53
Allan Thomas5-Sep-11 14:53 
GeneralRe: Commenting code... Pin
Sander Rossel5-Sep-11 19:56
professionalSander Rossel5-Sep-11 19:56 
We have programmed with .NET WinForms for 7 years now, my boss too (and probably more than any of us). Documenting methods that are already documented just seems like such a waste of space.
Our code is full of such obvious comments...
VB
' Set the caption of the label.
Label1.Test = "Saved successfully"

' Saves the Product.
customer.Save

Do you see the problem? Everyone can see that the TEXT of a label is set, even though comments say caption (all throughout the software, copy/paste mentality). Even worse for the product/customer. People copy and edit code, they don't edit comments.
If I had to comment each and every .NET Framework method like that the development time gets quite a bit longer...

I have learned to not read comments, because they do not currently add any value to our code, just clutter. Every comment needs to be maintained, just like any other piece of code. For some reason it never happens.
And everytime my boss asks me to comment the obvious once again I die a little inside.

I'm not sure what is worse, uncommented code or overcommented code. At least uncommented code says what it does (right there in the code), if comments do the same is always a question.
It's an OO world.

GeneralRe: Commenting code... Pin
BobJanova5-Sep-11 23:04
BobJanova5-Sep-11 23:04 
GeneralRe: Commenting code... Pin
tobep9-Sep-11 7:13
tobep9-Sep-11 7:13 
GeneralRe: Commenting code... Pin
Sander Rossel9-Sep-11 7:22
professionalSander Rossel9-Sep-11 7:22 
GeneralRe: Commenting code... PinPopular
RCoate5-Sep-11 18:37
RCoate5-Sep-11 18:37 
GeneralRe: Commenting code... Pin
Sander Rossel5-Sep-11 19:58
professionalSander Rossel5-Sep-11 19:58 
GeneralRe: Commenting code... PinPopular
Rob Grainger6-Sep-11 0:32
Rob Grainger6-Sep-11 0:32 
GeneralRe: Commenting code... Pin
Firo Atrum Ventus6-Sep-11 14:35
Firo Atrum Ventus6-Sep-11 14:35 
GeneralRe: Commenting code... Pin
Stefan_Lang30-Sep-11 2:59
Stefan_Lang30-Sep-11 2:59 
GeneralRe: Commenting code... Pin
MicroVirus6-Sep-11 2:57
MicroVirus6-Sep-11 2:57 
GeneralRe: Commenting code... Pin
RCoate6-Sep-11 15:07
RCoate6-Sep-11 15:07 
GeneralRe: Commenting code... Pin
Nagy Vilmos5-Sep-11 22:43
professionalNagy Vilmos5-Sep-11 22:43 
GeneralRe: Commenting code... PinPopular
Al_Brown6-Sep-11 0:01
Al_Brown6-Sep-11 0:01 
GeneralRe: Commenting code... Pin
Sander Rossel6-Sep-11 6:46
professionalSander Rossel6-Sep-11 6:46 
GeneralRe: Commenting code... Pin
Al_Brown6-Sep-11 23:34
Al_Brown6-Sep-11 23:34 
GeneralRe: Commenting code... Pin
Ian Shlasko6-Sep-11 2:01
Ian Shlasko6-Sep-11 2:01 
GeneralRe: Commenting code... Pin
CDP18026-Sep-11 21:28
CDP18026-Sep-11 21:28 
GeneralRe: Commenting code... Pin
Keith Barrow6-Sep-11 3:01
professionalKeith Barrow6-Sep-11 3:01 

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.