Commenting code
May. 11th, 2006 01:45 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I think my brain is hardwired to solve problems in the most elegant way. This has good consequences (I got a good degree from Cambridge, am paid £n0k/yr to program, and can beat Tony at noughts and crosses generalisations) and bad consequences (I don't like asking for directions or other help, I find it hard to get on well with people, etc).
When I was young, it used to almost be a point of pride that I didn't comment my code. Now I do so quite well, or so I believe. But I think both stem from the same underlying trait. When I was young, I saw the problem as "Write this program." Now, the problem has evolved into "Write this program so it works, and solves a specific problem, and in the future update it with the least possible effort."
When I was young, it used to almost be a point of pride that I didn't comment my code. Now I do so quite well, or so I believe. But I think both stem from the same underlying trait. When I was young, I saw the problem as "Write this program." Now, the problem has evolved into "Write this program so it works, and solves a specific problem, and in the future update it with the least possible effort."
no subject
Date: 2006-05-11 08:43 am (UTC)Until my first assignment in my previous job was to learn C and take over maintaining 100,000 lines of home-grown system, whose writer had left, and whose comments were restricted to one-liners saying things like "Bet you can't see why I've done it like this!" and variables were called things like isnull and were true if it wasn't and false if it was.
Now I think the standard should be that *someone else* can update it in the future with the least possible effort, and you shouldn't necessarily assume that they've used the language before...
no subject
Date: 2006-05-11 08:53 am (UTC)"Bet you can't see why I've done it like this!"
ROFL.
Now I think the standard should be that *someone else* can update it in the future with the least possible effort
That's about right. As a matter of fact I tend to think of "myself, with no memory of this code whatsoever" which is often close to the truth.
be that *someone else* can update it in the future
Date: 2006-05-11 08:54 am (UTC)no subject
Date: 2006-05-11 12:19 pm (UTC)Why yes I have been fixing other people's code for the last two days, why do you ask?