Naming

Names really matter in programming. When we get the name of something right, understanding the program becomes a breeze. Get the name of something wrong, however, and understanding even our own code can be a bit of a nightmare.

Take this little method. You gotta feel sorry for whoever’s responsible for maintaining this. It’s not at all clear what the author was thinking when they wrote it.

images/programming/no-idea.png

Yet when we change a few words and rename a couple variables—bam! The intent suddenly becomes clear.

images/programming/i-get-it.png

It’s hard to give super concrete advice on naming, ...

Get The Way of the Web Tester now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.