On Wed, Nov 23, 2011 at 23:44, Ethan Dicks <ethan.dicks at gmail.com> wrote:
On Tue, Nov 22, 2011 at 8:06 PM, Huw Davies
<huw.davies at mail.vsm.com.au> wrote:
On 23/11/2011, at 7:51 AM, Eric Smith wrote:
You must have a much better memory than most
people... more than three years ago...
I've got code sitting on a shelf in my study that I wrote nearly 40 years ago. Just
for interest's sake I thought I'd see if I could understand it - the answer is no,
mainly as I can't really read PDP-10 assembler any more :-(
My very earliest efforts (34 years ago) are lost, but are in PET BASIC
anyway, so historians and archivists can sleep well.
I looked at some slightly later stuff (probably
35 years old) written in BCPL - I can read and understand it but don't know why I
wrote it that way. I guess I've learnt something about algorithms in the intervening
time!
The oldest works I still have copies of clock in around 30-32 years
old and I would agree - comprehension is not an impediment, but I do
occasionally scratch my head and try to remember *why* I chose that
technique (and it reminds me how much I've learned over the years).
-ethan
I dug up the oldest source I could find - it's probably the first
FORTRAN program I wrote, from the early eighties. It's not a big
program, it's for reading CP/M floppies on a minicomputer.
There aren't many comments, but those that are there are important.
I'm glad they're there. Commenting everything would have been totally
overkill though, the code is easy to understand because the few
comments are in the right place. Without them it would have been more
work to understand the code. I'm pretty happy with what I'm seeing
there. There seems to be about 10 to 15 lines of code per comment
line. What's important is that the comments describe non-obvious
things (if you only have the source and not, e.g. for this program,
the documentation for the CP/M filesystem):
IF (USER .NE. 229) THEN ;% -- 229 = E5 hex (non-existent entry)
WRITE (1,11)USER, NAME, TYP, EXTENT, RECUSED
ENDIF
-Tor