How to name variables

BCS picture BCS · Oct 15, 2008 · Viewed 14.3k times · Source
  • What rules do you use to name your variables?
  • Where are single letter vars allowed?
  • How much info do you put in the name?
  • How about for example code?
  • What are your preferred meaningless variable names? (after foo & bar)
  • Why are they spelled "foo" and "bar" rather than FUBAR

Answer

Tony BenBrahim picture Tony BenBrahim · Oct 15, 2008
function startEditing(){
   if (user.canEdit(currentDocument)){
      editorControl.setEditMode(true);
      setButtonDown(btnStartEditing);
   }
 }

Should read like a narrative work.