O'Reilly logo

Refactoring Workbook by William C. Wake

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Names

The creation of a good mental model is one of the key challenges in developing software. There are several tools people use to help with this:

  • Project dictionaries

  • Domain vocabularies, ontologies, languages

  • XP-style metaphors

How we name things is important. Good names perform several functions:

  • They provide a vocabulary for discussing our domain.

  • They communicate intent.

  • They support subtle expectations about how the system works.

  • They support each other in a system of names.

It's hard to pick good names, but it's worth the effort. Ward Cunningham describes using a thesaurus to get just the right sense (seehttp://c2.com/cgi/wiki?SystemOfNames).

Some teams have coding standards and naming standards that affect how names are chosen. I generally ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required