Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Went back to some old code of mine and...

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Off Topic
View previous topic :: View next topic  
Author Message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1474
Location: Loughborough

PostPosted: Mon Jun 17, 2013 7:44 pm    Post subject: Went back to some old code of mine and... Reply with quote

...thought to myself:-

1) Did I actually write that?
2) What on earth does that bit do?
3) If I can't read my code then by definiton it must be crackproof... ;o)
4) Why did I do it that way?
5) I can do without that bit, (then cut it from the code), only to find when it is rerun that it is needed and I have lost the original copy...

Anyone else been there?

;oD
_________________
73...

Bazza, G0LCU...

Team AMIGA...
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1071
Location: Worcestershire

PostPosted: Mon Jun 17, 2013 8:00 pm    Post subject: Reply with quote

:chortle:
And lots of other bad places too.

Like, I left a note that there was a bug still in there but I can't recall how the code is supposed to work so I couldn't recognise the bug even if I tripped over it.

Or, "Sheet 3 of 4". Where the **** is Sheet 4?

Or, I wrote THAT!!? Embarassed

Yeah, but I also wrote THIS ten years before it became standard practice! Twisted Evil
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
towy71
Moderator


Joined: Wed Apr 06, 2005 3:11 pm
Posts: 4259
Location: wild West Wales

PostPosted: Mon Jun 17, 2013 9:46 pm    Post subject: Reply with quote

That's the problem with not commenting your code Rolling Eyes Rolling Eyes Rolling Eyes

;this is supposed to do that
#that was supposed to make something happen

oops Wink Wink
_________________
still looking for that door into summer
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Mon Jun 17, 2013 10:31 pm    Post subject: Reply with quote

On the other hand, if you don't comment it at all, you can deny all responsibility for it Smile

When Mike left Future, he sent me the DVD build scripts, which were only lightly modified versions of the one I'd sent him five years earlier. I could make no sense of them at all and all but point 5 were applicable - 5 didn't happen because I used a VCS.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
Bazza
LXF regular


Joined: Sat Mar 21, 2009 11:16 am
Posts: 1474
Location: Loughborough

PostPosted: Mon Jun 17, 2013 10:42 pm    Post subject: Reply with quote

Hi nelz...

"On the other hand, if you don't comment it at all, you can deny all responsibility for it"

Ha ha, nice one...

Hi towy71...

Sometime ago on I think it was the Python ML some big gun said comments are not necessary as professionals can read the code and understand it.

So I placed a challenge on code.activestate.com here...

http://code.activestate.com/recipes/578013-amplitude-modulation-tremolo-was-an-audiosound-sni/?in=user-4177147

The answer is in the title now but from the code alone would you have guessed what it did without comments?

No one came back and I gave them at least a month...
_________________
73...

Bazza, G0LCU...

Team AMIGA...
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Mon Jun 17, 2013 11:21 pm    Post subject: Reply with quote

Bazza wrote:
Sometime ago on I think it was the Python ML some big gun said comments are not necessary as professionals can read the code and understand it.


That's like saying that spelling and grammar are unnecessary because if you try hard enough, and give it enough goes, you can understand the message.

Comments are to make understanding easier, not possible. Also that statement contains the implied arrogance of assuming your own code is of professional quality - like what mine ain't.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1071
Location: Worcestershire

PostPosted: Tue Jun 18, 2013 3:16 pm    Post subject: Reply with quote

nelz wrote:
Bazza wrote:
Sometime ago on I think it was the Python ML some big gun said comments are not necessary as professionals can read the code and understand it.


Also that statement contains the implied arrogance of assuming your own code is of professional quality.

Nope, true professionals know to add profuse comments. Rather, it betrays the sadly unprofessional habit of never going back to support your own code.
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Off Topic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast