Meaningful Identifier Names Flashcards
All 3 cards in this deck
Why should a programmer use meaningful identifier names?
The names show what each variable, constant or subroutine stores or does, so the code is easier to understand, debug and update, e.g.
totalScorerather thanx.What is an identifier?
The name a programmer gives to a variable, a constant or a subroutine, e.g.
totalScoreorcalculatePrice.Why can't
number of itemsbe used as an identifier?Identifiers cannot contain spaces. A name such as
numberOfItemsoritemCountcould be used instead.