a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by rozap
rozap  ·  4282 days ago  ·  link  ·    ·  parent  ·  post: Yes, your code does need comments.

Every place I've ever worked has been completely and utterly devoid of comments and documentation.

One day maybe I'll get lucky and work somewhere where code readability is a goal, but I'm not counting on it. Generally the only thing that matters is that the project gets done on time..and sometimes your superiors care if it works well. Generally, though, management couldn't give two shits about the fact that it's duct taped together and will be a nightmare to maintain 6 months down the road.





briandmyers  ·  4282 days ago  ·  link  ·  

You don't write comments for others. You write them for yourself, 6 months or two years from now. They are still not to be trusted, but can sometimes save your ass anyway. FIXME comments are downright useful sometimes.

b_b  ·  4282 days ago  ·  link  ·  

Here is an interesting piece that revolves around the code for the first email program that was written at MIT. Apparently, no has any idea how to interpret it now, due to lack of commenting.

briandmyers  ·  4282 days ago  ·  link  ·  

Good story - I've heard of CTSS, it had a big influence on the guys who created Multics, which eventually spawned Unix.

I seriously doubt it's a lack of commenting that prevents interpretation - I imagine a lack of hardware or other supporting functionality (missing software) is the only thing that could deter a dedicated historian-hacker.

Speaking of history - here is an oldie but a goodie from the Jargon file, "The Story of Mel" - it's an epic hacker saga from the early days.

b_b  ·  4282 days ago  ·  link  ·  

Commenting definitely isn't the only thing preventing people from running the code, but it definitely contributes to preventing people from reading it. Say, if some historian wants to learn about what the coders were thinking and why they did what they did, even technical commentary could help quite a bit, I suppose. So remember, comment for posterity!

akkartik  ·  4282 days ago  ·  link  ·  

Personally I find the notion of reading code without first running it to be meaningless[1]. We're unable to make sense of that program not because somebody didn't put some squiggles at the ends of lines prefixed by the right header, but because no muchine can run them, so we can't play with making changes and seeing what happens.

[1] Cue Dijkstra rolling over in his grave.

akkartik  ·  4282 days ago  ·  link  ·  

Yeah that's a goodie.

Rereading, I was struck by this quote about the patent office:

    Today, people are filing patents, claiming that they just invented something which we had running back in the 1960s. How can that happen? Well, the patent office looks only at previous patents to see whether or not there is a prior claim. Of course, there are no patents from the 1960s, because they wouldn’t allow them. You were supposed to send the patent office not just a description, but a hardware implementation. Basically the notion of patenting something meant you carried to the office a model of the thing you were building, the thing that you had invented. And this just doesn’t work with software. So they had, for a long time, declared software as an unpatentable thing. Eventually, they decided that there is indeed intellectual property here, but it was quite a while later.

(http://opinionator.blogs.nytimes.com/2011/06/21/did-my-broth...)

b_b  ·  4282 days ago  ·  link  ·  

As a coder (and please all the other coders on here), what's your stance on the patent mess right now? To my mind (and I'm not a programmer, for what it's worth), I think that a computer program is a text, and therefore should be subject to copyright, but not patent rules. The whole idea of patenting, well, an idea, is absolutely silly, in my opinion. And, its ruining innovation in the tech sector (biology, too, for similar reasons).

akkartik  ·  4282 days ago  ·  link  ·  

Yeah I agree with that reasoning.

In addition, there's a broader problem with patents that software is just one symptom of.

I'm still uncertain whether it's affecting innovation, however. Perhaps the patent system was needed to encourage innovation in a different time. Now we pretty much as a society buy that innovation is good. Perhaps patents are a sort of vestigial organ for large swathes of the state space. Broken patents don't cause people to stop innovating. They just cause people to stop patenting true innovations, and to retreat to trade secrets. The only people still filing patents in the tech industry are the dinosaurs and the clueless noobs.

rozap  ·  4282 days ago  ·  link  ·  

Oh I agree. I comment the code I write for myself, and generally keep a readme with an overview so when I come back to the project I'm not totally lost.

Work is a different story, unfortunately.