5 ms·
I think everybody hates comments like "getFoo: Get the value of Foo", and huge blocks of commented-out code. However, I _love_ seeing the following types of co
by ekidd 16y ago
I think everybody hates comments like "getFoo: Get the value of Foo", and huge blocks of commented-out code.
However, I _love_ seeing the following types of comments:
1. The high-level overview of how things fit together: This class represents a compiled method at the VM level. It does not contain the actual native code. If native code exists, it is handled using class Blah instead.
2. What should work, but doesn't: You'd think the following two lines of commented-out code would work, but they don't, because libfoo 1.7.1 and earlier has a stupid bug, so we need to do things the hard way.
3. The epic warning: Apple's Component Manager API does not work the way you'd naturally assume. First of all, it constructs a single 'instance' of a class before it initializes the class. Second, the memory reclamation system is really weird... and so on, for a page and a half.
- shaddi 16y agoExactly. Code is for expressing how things are done.* Comments are for expressing why. * Or if you're not into the whole imperative languages bit, what things are done.
- Mz 16y agoTotally OT: How are you managing to use an asterisk as a footnote indicator and not ending up with the two asterisks invisible and the text in between in italic? I've seen this before and I've tried to replicate it and I can't do it. :-/
- prodigal_erik 16y agoAn asterisk followed by whitespace doesn't begin italics, so you get * word * rather than word.
- Mz 16y agoOh. Thank you!
- GrandMasterBirt 16y agoThat says what I wanted in less words. I like it. You probably have good comments.
- GrandMasterBirt 16y agoI believe thats commenting on what your intentions are behind something unclear (or making something that looks wrong look right because of xyz) vs commenting on something that could easily be solved by better naming/conventions.
- Groxx 16y agoI think this implies that .NET people love them. http://submain.com/products/ghostdoc.aspx http://submain.com/products/ghostdoc.aspx Write a function like "getFoo" and it generates that as the description. Similar situation example: http://www.youtube.com/watch?v=yPaNRaub8N4#at=40 http://www.youtube.com/watch?v=yPaNRaub8N4#at=40