Skip to main content

Naming Things

  • Chapter
  • First Online:
Clean Ruby

Abstract

Coming up with names for the variables, classes, and methods in a program is not an easy task. We must be gurus to think of a name at a moment’s notice. It’s part of our everyday coding lives, and we can’t let down our guard. Choosing the wrong name has significant implications and can determine whether code is easy to read or confusing and cryptic. It doesn’t end there, because poor-quality names have a compounding effect. One bad name encourages creating more bad names; those bad names promote even more bad names. Progress crawls to a halt because these bad names make our code impossible to understand.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Super classes are classes with the most lines of code in your entire application. They try to do everything for a concept and are extremely hard to support. Any other classes that need these methods can do the same thing.

  2. 2.

    Single Responsibility Principle is a concept that dictates our code should only be responsible for one thing.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Carleton DiLeo

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

DiLeo, C. (2019). Naming Things. In: Clean Ruby. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5546-9_2

Download citation

Publish with us

Policies and ethics