Click here to Skip to main content
15,886,919 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Code comments - how old is your code? Pin
Greg Utas17-Jul-23 15:35
professionalGreg Utas17-Jul-23 15:35 
GeneralRe: Code comments - how old is your code? Pin
trønderen17-Jul-23 16:16
trønderen17-Jul-23 16:16 
GeneralRe: Code comments - how old is your code? Pin
Gerry Schmitz18-Jul-23 5:39
mveGerry Schmitz18-Jul-23 5:39 
GeneralRe: Code comments - how old is your code? Pin
Gary Wheeler18-Jul-23 2:39
Gary Wheeler18-Jul-23 2:39 
GeneralRe: Code comments - how old is your code? Pin
Gerry Schmitz17-Jul-23 15:36
mveGerry Schmitz17-Jul-23 15:36 
GeneralRe: Code comments - how old is your code? Pin
Derek Hunter17-Jul-23 20:14
Derek Hunter17-Jul-23 20:14 
GeneralRe: Code comments - how old is your code? Pin
Jonas Hammarberg17-Jul-23 20:49
professionalJonas Hammarberg17-Jul-23 20:49 
GeneralRe: Code comments - how old is your code? Pin
Sander Rossel17-Jul-23 21:02
professionalSander Rossel17-Jul-23 21:02 
I never write comments.
As it happens, I just hired a junior and he loves comments.
He writes all sorts of useless comments like // set the variable.
I told him not to do that because we can read code.
Point is, he doesn't read code that well yet and the comments help him see what happens.
He also writes comments like // why does this work?
So he'll be reminded to ask me.

One time we rearranged some code and all of his comments had to moved and/or changed as well.
People sometimes forget that comments are just like code, they're hard to write well and they need maintainance just like code.
Comment maintainance is rare and so most of the time comments are just as unclear as the code, outdated or even plain wrong.
I rarely trust a comment and when I see them I'll try to change the code so they won't be necessary anymore.

That's not to say I never write them.
I once worked with a library (Crystal Reports, 'nuff said) where setting one property would set another one to null.
So the order in which I set specific properties had to be very specific too.
Needless to say I wrote a comment saying // do not switch these lines around, the person who wrote this library was drunk and drugged and the order somehow matters.

GeneralRe: Code comments - how old is your code? Pin
Slacker00717-Jul-23 23:40
professionalSlacker00717-Jul-23 23:40 
GeneralRe: Code comments - how old is your code? Pin
Sander Rossel17-Jul-23 23:43
professionalSander Rossel17-Jul-23 23:43 
JokeRe: Code comments - how old is your code? Pin
trønderen18-Jul-23 6:49
trønderen18-Jul-23 6:49 
GeneralRe: Code comments - how old is your code? Pin
Gerry Schmitz18-Jul-23 5:43
mveGerry Schmitz18-Jul-23 5:43 
GeneralRe: Code comments - how old is your code? Pin
Amarnath S17-Jul-23 21:06
professionalAmarnath S17-Jul-23 21:06 
GeneralRe: Code comments - how old is your code? Pin
_WinBase_17-Jul-23 23:36
_WinBase_17-Jul-23 23:36 
GeneralRe: Code comments - how old is your code? Pin
Gerry Schmitz18-Jul-23 5:46
mveGerry Schmitz18-Jul-23 5:46 
GeneralRe: Code comments - how old is your code? Pin
Mircea Neacsu18-Jul-23 0:51
Mircea Neacsu18-Jul-23 0:51 
GeneralRe: Code comments - how old is your code? Pin
Daniel Pfeffer18-Jul-23 1:04
professionalDaniel Pfeffer18-Jul-23 1:04 
GeneralRe: Code comments - how old is your code? Pin
JudyL_MD18-Jul-23 1:59
JudyL_MD18-Jul-23 1:59 
GeneralRe: Code comments - how old is your code? Pin
decaffeinatedMonkey18-Jul-23 2:41
decaffeinatedMonkey18-Jul-23 2:41 
GeneralRe: Code comments - how old is your code? Pin
WPerkins18-Jul-23 3:00
WPerkins18-Jul-23 3:00 
GeneralRe: Code comments - how old is your code? Pin
trønderen18-Jul-23 6:54
trønderen18-Jul-23 6:54 
GeneralRe: Code comments - how old is your code? Pin
kmoorevs18-Jul-23 3:58
kmoorevs18-Jul-23 3:58 
GeneralRe: Code comments - how old is your code? Pin
Cpichols18-Jul-23 3:59
Cpichols18-Jul-23 3:59 
GeneralRe: Code comments - how old is your code? Pin
Marc Clifton18-Jul-23 5:55
mvaMarc Clifton18-Jul-23 5:55 
GeneralRe: Code comments - how old is your code? Pin
sasadler18-Jul-23 6:05
sasadler18-Jul-23 6:05 

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.