Portrait of a Noob
steve-yegge.blogspot.com
Portrait of a Noob
1–10 of 43 posts
Re: Portrait of a Noob
#2"It's denser: there's less whitespace and far less commenting. Most of the commenting is in the form of doc-comments for automated API-doc extraction"
This is right on the button. I prefer writing/reading an overall README.txt which says concisely what that module/package etc. is supposed to do and doc-comments where appropriate when something is not obvious. Anything else and i automatically start seeing that as noise filtering it as i go along. The worst are the obvious and/or the outdated ones.
Re: Portrait of a Noob
#3Re: Portrait of a Noob
#4I want to say I read that entire article, but I only read the first few paragraphs, so, my comment may be off topic somehow. That was a hefty post!
Re: Portrait of a Noob
#5Re: Portrait of a Noob
#6Re: Portrait of a Noob
#7That's a very large function for an experienced programmer. In my opinion, each function should do one thing and that thing should be the name of the function.
Re: Portrait of a Noob
#8I read this a while back and i still remember the takeaway point from it : "It's denser: there's less whitespace and far less commenting. Most of the commenting is in the form of doc-comments for automated API-doc extraction" This is right on the button. I prefer writing/reading an overall README.txt which says concisely what that module/package etc. is supposed to do and doc-comments where appropriate when something…
If you have documentation about the design of the system and write reasonably clear code, you can document sparsely. (Having fewer comments also gives those present added emphasis.) As with most engineering, it's more about trade-offs than hard-and-fast rules, though.
Re: Portrait of a Noob
#9I once had the pleasure of rewriting an Ada avionics subsystem in C. The code was very tersely commented, and the only documentation I could find on the subsystem was a requirement to the effect of "such-and-such subsystem shall exist". So I was left to figuring out what the subsystem worked from the code itself.
That's possible to do, but things would have gone a lot faster if I would have had a few pages describing what the goals and overall architecture of the software was.
Re: Portrait of a Noob
#10When you understand your code, you don't bother to read the comments. As soon as you forget how the code works, you look to the comments for direction.
But if you didn't revise your comments along with your code, the comments will trick and deceive you until you realize that they're out of date. So you must re-grok the code anyway.
Use comments to describe your code's purpose. Let your code self-document the implementation.If you are particularly clever in your implementation, add a quick comment to explain your cleverness. When you realize you shouldn't have been so clever, be sure to remove the implementation comment as well.