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

Non-computer-related chit-chat

Moderators: ChrisThornett, LXF moderators

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

Postby Bazza » Mon Jun 17, 2013 6:44 pm

...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...
User avatar
Bazza
LXF regular
 
Posts: 1476
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby guy » Mon Jun 17, 2013 7:00 pm

: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!!? :oops:

Yeah, but I also wrote THIS ten years before it became standard practice! :twisted:
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby towy71 » Mon Jun 17, 2013 8:46 pm

That's the problem with not commenting your code :roll: :roll: :roll:

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

oops :wink: :wink:
still looking for that door into summer
User avatar
towy71
Moderator
 
Posts: 4263
Joined: Wed Apr 06, 2005 2:11 pm
Location: wild West Wales

Postby nelz » Mon Jun 17, 2013 9:31 pm

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

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)
User avatar
nelz
Site admin
 
Posts: 8498
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Bazza » Mon Jun 17, 2013 9:42 pm

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/578 ... er-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...
User avatar
Bazza
LXF regular
 
Posts: 1476
Joined: Sat Mar 21, 2009 11:16 am
Location: Loughborough

Postby nelz » Mon Jun 17, 2013 10:21 pm

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)
User avatar
nelz
Site admin
 
Posts: 8498
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby guy » Tue Jun 18, 2013 2:16 pm

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
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 0 guests