Friday, May 20, 2016

one time when you might actually want to use a code comment

When an enum in an application parallels a database table as suggested here, but not every value in the database table is used in the application because the application isn't the only application using that database, maybe the unused line items should just be commented out with a note. The two other bad alternatives are:

  • letting the numeric assignments to the line items to appear as if goofy encodings one would at a glance interpret as something ununderstood or understandable, you could just remove the unused line items
  • all line items stay leaving the false impression that all line items are used

No comments:

Post a Comment