blemay@factorycard.com
Having been coding in RPG since "II", I have found that long introductory comments tend not to be kept up-to-date, so I avoid them. I will have a general program overview and special compile/execution notes, but I stay away from details about files, indicators (ESPECIALLY!), data structures, etc. When structures are added, changed or deleted, I have found--unless you have very strict standards and code review procedures--that comments more than a few lines (or a "page", at most) away tend not to be updated. I, too, think that "obvious" comments or pseudo-code ("Add 1 to counter and check for > 99") should be eliminated--tell me "why" you are doing something. Don\'t just repeat "what" you are coding. And while I am also a believer in "self-documenting" code (easier now, with RPG/IV), I still like to see "non-essential" comments used to give an overview of the next block of code. It is much easier to understand "Read PO Details for type \'X\' items with order quantities less than minimum & delete" than to decipher the multiple file accesses, edits, and loops necessary to implement it. And with the comment within 10-30 lines of the code, it is much more likely to be adjusted if the code is. And the comments help to structure the code--showing where loops, edits, and processes begin and end. My biggest problem is with programmers who copy existing programs (a very GOOD idea to standardize structure and function) but neglect to modify the comments when they change the details!
Please login to make comments.
User Rating: / 0
PoorBest 

   MC-STORE.COM