Hacker News new | ask | show | jobs
by geofft 2727 days ago
Why do you want to abort when prio is in endidle or busy, and not in other cases?
2 comments

Exactly. True, code could be self-explanatory, but sometimes you need to explain why code does what it does.
If you care to understand the code I pasted, here's the full listing:

https://github.com/chrislgarry/Apollo-11/blob/master/Comanch...

Well, the first 500-ish lines of that 1500-line file are comments, and there are block comments throughout, too...

You did, to be fair, say that comments at the top shouldn't count. But I think that depends a lot on personal (and language) style towards multiple files and multiple units within a file - for instance, none of this code is object-oriented, and comments above each class make sense in an object-oriented language. I think as the language gets more concise - Go is a lot more concise than the Apollo assembly language - you're going to need to have the same amount of prose to explain what you're doing but a lot fewer lines of code to get anything done, and it makes sense to have comments above each function or each block, because that's really the comparable unit.