http://qs321.pair.com?node_id=895017


in reply to The path to mastery

I completely agree... Just adding an example why tight code is not proper in every case.
Once I had to tune and slightly change algorithmic part of some data processing sw. Though I knew required new behaviour, I did not know definition or description of already implemented behaviour. And it was horrible journey with many many questions of type "Yes, I understand what it does, but if this and that is undefined, result should not be correct - is it mistake or is it wanted or it does not matter?"
Of course, missing documentation is the point, but more simpler, more primitive code could help me. Simpler variant of my speech could be "Yes, I understand what the code does, but why?"

Replies are listed 'Best First'.
Re^2: The path to mastery
by etj (Deacon) on Mar 23, 2022 at 14:06 UTC
    I believe this thought reveals the truth of Fred Brooks's famous aphorism that there is "no silver bullet" when it comes to managing complexity in software. There is no shortcut to comprehension. Comments can only help a certain amount, whether they be written by/for the original programmer, or someone following them. Often they actually cloud things, or are a distraction, and often do not keep up with the code as it itself is changed.

    The proof of this is in coming back to a piece of code written by yourself or another, and trying to understand why it behaves in a particular (wrong) way when it shouldn't. By definition, comments (and indeed code) are written with the amount of understanding available to the programmer(s) at the time they wrote it, which is by definition finite. There is no shortcut to simply putting in the effort to understand what it is actually doing.