Re:Please do not attempt to simplify this code
by geofft on Thursday December 27, 2018 @05:23PM
(#18773178)
Why do you want to abort when prio is in endidle or busy, and not in other cases?
[ Parent
| on HN ]
Re:Please do not attempt to simplify this code
by Koshkin on Thursday December 27, 2018 @05:27PM
(#18773203)
Exactly. True, code could be self-explanatory, but sometimes you need to explain why code does what it does.
Re:Please do not attempt to simplify this code
by newnewpdro on Thursday December 27, 2018 @05:33PM
(#18773235)
If you care to understand the code I pasted, here's the full listing:
https://github.com/chrislgarry/Apollo-11/blob/master/Comanch...
Re:Please do not attempt to simplify this code
by geofft on Thursday December 27, 2018 @05:47PM
(#18773335)
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.