Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

Inappropriate Naming

Problems with the naming of the program’s entities are also easy to spot. One area is inconsistency. When you see in the same program CamelCaseIdentifiers mixed with underscore_separated_names, you know that you’re treading on the remains of a battle between different personalities. Similarly, if you find a wanderGet and a setWander method, you know that the programmer who wrote the code probably had his mind wandering somewhere else at the time.

When choosing names, moderation should be the norm. A long and overly descriptive name used for a local index variable that should simply be named "i" is just as bad as a short and cryptic global variable name.

  • + Share This
  • 🔖 Save To Your Account