jack: (Default)
[personal profile] jack
Apropos to my sleepyness my ideas from last night were not amazing, but all were fairly good. A wonderful quote on the subject from The Universe of Discourse is:
The next morning I remembered nothing but that I had had a "clever" inspiration while guzzling whisky from the bottle. "Oh, no," I muttered, "What did I do?" And I went to the computer to see what damage I had wrought. I called up the problematic part of the program, and regarded my alcohol-inspired solution. There was a clear and detailed comment explaining the solution, and as I read the code, my surprise grew. "Hey," I said, astonished, "it really was clever." And then I saw the comment at the very end of the clever section: "Told you so."

I don't know what to conclude from this, except perhaps that I should have spent more of my life drinking whiskey. I did try bringing a flask with me to work every day for a while, about fifteen years ago, but I don't remember any noteworthy outcome. But it certainly wasn't a disaster. Still, a lot of people report major problems with this strategy, so it's hard to know what to make of my experience.
One's subconcious is sometimes witty. And sometimes effective.

Coincidently, recently, I've got the hang of commenting my code well! Cool.

That blog, by Mark Dominus, is very intriguing. I think fanf or senji linked to it, but every few days he has something to say about something obscure but relevent to every day life, that always makes me think. If I had the time it's a good example of the sort of discourse I would like to output.

Date: 2006-04-25 06:52 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Commenting your own code is good. Learning to comment other people's opaque code as part of the process of understanding it after they've left is also useful l-)

Date: 2006-04-26 03:19 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yes. The trouble is, you get lots of comments prefaced with a symbol meaning "My best guess at what Fred was trying to do is explained here, but that bit doesn't make sense yet unless he was smoking crack" which helps someone else[1] understand it, but isn't tidy.

[1] I include yourself, later, as someone else.

Date: 2006-04-26 03:22 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
If you discover a bit that's mad then perhaps that was the cause of the bug you're trying to track down (presuming you're not reading this obscure code for the fun of it) and you might find it best to make it not-mad along the way...

Date: 2006-04-26 03:30 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yes, that's often wise. I'm generally inhibited by the many other people's bits of code working with it that will be broken if I change it in any non-equivalent way on purpose or by accident, and the feeling that once I start rewriting bad code I'll never stop, and a fear that it's doing something clever which I don't get -- the last true empircally about 1/3 of the time :)

Date: 2006-04-26 03:36 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
The example I had in mind I've become probably the main expert on and our project is the main user. So if I break it (more l-) then it's almost certainly me who gets to clear it up.

Date: 2006-04-26 03:58 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Sorry, that is, I assumed something of the sort, but I can't easily. But I'm doing something wrong, because most bits of code it isn't clear if anyone owns them or not, so I should be bolder, but it gets so tedious asking *everyone* if anyone knows why it's done like that.

Some people are bolder, but it's rather annoying when fixes one person puts in are deleted by other people. I guess it encourages people to comment them, but it's still a problem.

Active Recent Entries