Today I Learned

Some of the things I've learned every day since Oct 10, 2016

Category Archives: software development

128: Git Commit Message Subject Conventions

Some conventions that should be followed when writing the subject of a commit message in Git:

  • Separate the subject from the body (if it exists) with a blank line
  • Keep the length at no more than 50 characters
  • Capitalize the first letter, don’t end it with a period
  • Use the imperative mood. For instance, “Update getting started information” instead of “Updated getting started information”, “Refactor X for readability” instead of “Making X more readable”.

Additionally, a commit message subject should convey information about not only what was done but also why.

127: Linters

Linters in the modern sense generally refer to programs which check code for potential errors (or even just style errors) in a static context (without running the code). Potential such errors might include syntactic errors, “variables being used before being set, division by zero, conditions that are constant, and calculations whose result is likely to be outside the range of values representable in the type used.” [Wikipedia]

The name comes from a program called Lint that performed this function for C code, but has since become a more general term.

Linting can be helpful for debugging interpreted languages like Python, since they don’t have a compilation phase where things like syntactic errors would be caught.

122: Hotfixes

In software development, a hotfix is similar to a bug fix but differs in that it is

  • applied to the system while hot, i.e. currently deployed and running
  • commonly not publicly available but instead only released to a small audience of clients who have encountered a given bug in the deployed system
  • applied outside of the usual release schedule

As a result of insufficient testing, hotfixes can easily become a source of even further bugs developing, and are thought of as kind of an ’emergency’ measure used when a fix for a client cannot wait until the next scheduled update.

Hotfixes are commonly released in packages called cumulative updates.