The Best Practices suggests that a need for a lot of comments explaining things might indicate that the section of code is confusing and could be written more clearly. Rather than writing words to try and explain it, can the code itself be clearer? (more…)
Archive for the ‘Perl Best Practices’ Category
PBP: 096 Indicative Documentation
Monday, May 4th, 2015PBP: 095 Defensive Documentation
Thursday, April 9th, 2015This practice is simple, and probably covers a lot of the places I appear to have been waffling between one view and another. The book says to comment anything that puzzled or tricked you. Pretty simple? The questionable part is that everyone will find different issues tricky. (more…)
PBP: 094 Elucidating Documentation
Monday, April 6th, 2015The Best Practice discussed here is to use short comments at the end of the line to provide extra detail and make possibly obscure code a little clearer. I think this can be very useful, but I’m not sure it plays well with a 78 character margin as suggested elsewhere, especially if the function involved is complex and you’re more than a couple of tab stops from the margin. (more…)
PBP: 093 Algorithmic Documentation
Thursday, March 26th, 2015The Best Practices suggest using a full-line comment before a paragraph of code to explain the algorithm. This is, in my experience, good advice, and what comments should be used for. (more…)
PBP: 092 Comments
Monday, March 23rd, 2015The Best Practices suggest creating a template for block comments that are suitable for your team. On the whole the reasons given in the book are good ones and it sounds like a great idea, but I find it harder to implement in practice. (more…)
PBP: 091 Technical Documentation
Thursday, March 19th, 2015The Best Practices suggest breaking your documentation apart by audience. Different audiences need different documentation. It then goes on to suggest where this different documentation belongs… and that’s why my opinion diverges. (more…)
PBP: 090 Position
Monday, March 16th, 2015The PBP suggests keeping all the POD at the end of the file. Considering I feel it should be with the code, I naturally disagree. (more…)
PBP: 089 Contiguity
Thursday, March 12th, 2015The PBP likes documentation in POD, in your source files, but wants it all in one chunk, separated from the code it documents. This is one of the suggestions in the PBP I not only disagree with, I find damaging. I feel strongly that the documentation goes as close to the code as possible, to minimize the distance between them and make the tendency to avoid updating them harder to forget. (more…)
PBP: 088 Location
Monday, March 9th, 2015The Best Practices suggest putting your documentation in your source files, and provides some reasons. This is okay. (more…)
PBP: 087 Extended Boilerplates
Thursday, March 5th, 2015The Best Practices make some suggestions on additional things to include in your POD, and suggest those items get listed in your general boilerplates to fill out. Some of the suggestions are interesting, but I’m not sure they belong in every POD ever. (more…)