Naming convention is important

I stole this quote from reddit user tdammers

There are only two difficult problems in programming: naming things, cache expiry, and off-by-one errors.

I will admit that I have made a mistake with my naming convention, and that mistake is plurals.

Naming convention is important for the obvious reasons;

  • Readability
  • Remembering variable/field names later
  • etc

In my case I did not keep a standard with the naming convention when it came to plurals. Some database tables/fields are with a suffix ‘s’ and other are not. This makes it extremely hard to remember what I have done and wastes time as I have to look up the table/field.

My solution – remove all the plurals and make all tables/fields singular. A statement that is too easy to say and most likely a nightmare to implement. This database change will not be occurring during this branch as it will fall under “Development” and not a bug fix.

The moral of this whole story – have consistent naming convention at the start of your project and then stick with it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.