BigDumbDinosaur wrote:
Who said anything about rules or anything about efficiently solving a problem?
You provided rules. I was talking about efficiently solving a problem. You may disagree with doing the latter; there's probably not much point in arguing about that.
Quote:
Programs are commented so anyone who is reasonably fluent in the language will understand what the program is doing. Programs are not commented to teach the language to the reader. Anyone who has worked in a production programming environment quickly learns that.
Again, lack of imagination here. Not all code is written for "production programming environments."
If you're the sort of person who insists that the code examples on a Wikipedia page intended to give someone an idea of the flavour of a language must be written for those who already know the language, you have completely missed the point of the code, and you'll write code that is bad for that particular purpose. You may dislike code like
this example, but that's good code with good comments because it better fulfills its purpose than what you're saying should be written.
This works the other way around, too. You mentioned that it's important to explain "why you're incrementing X," but often it's detrimental to do this. For almost all code designed to be read by reasonably experienced 6502 programmers, I would say it's bad (not horribly bad, but definitely not good) to add comments to someting like:
Code:
inc curpos
beq +
inc curpos+1
+ ...
When your readers already know the pattern (or will very soon learn it and use it regularly), adding a comment as to why you're doing the
inc curpos+1 is a waste of your time and a waste of the reader's time and attention.
Quote:
Commentary has nothing to do with the efficiency of a program. So I fail to understand why you might think otherwise.
Commentary absolutely has to do with the efficiency of a program when you account for costs beyond just the run time of the program. You yourself provided an example in your SCSI routine: why did you spend the extra time and effort on those comments, which were clearly a short-term cost? Because you were concerned about the overall efficiency of your software development effort in the long term, and you know it was likely to save you more time later than the time you'd spent earlier to write those comments.