Skip navigation

Variable Names

Why can't I use short variable names such as EV1 and EV2, instead of longer, more descriptive names? Short names make my code lines shorter.

Typically, variable names should be long enough and friendly enough to describe the variable contents without being so long that they make your code harder to read because of a line wrap. I try to keep names at about eight characters. If you ever get involved in some serious debugging, you'll find %datetime% easier to understand than %EV4%.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish