Stop Capitalizing Acronyms in Your Class Names

LEGIBILITYMATTERSMORETHANGRAMMAR… or, rather, LegibilityMattersMoreThanGrammar

Dave Taubler
3 min readAug 18, 2022
Photo by Wolfgang Hasselmann on Unsplash

I like to be productive and efficient. So anything that unnecessarily wastes even a few moments of my time… well, it really bugs me.

That is why I am particularly bugged by a particular practice (nay, an anti-practice) that I see too often. FYI, AFAIK most folks would agree with me, so IDK why this anti-practice is so pervasive.

I’m talking about CamelCased class names with FULLY-CAPITALIZED acronyms.

You see these fairly often in Java. EOFException. URLEncoder. ISBNValidator. Mercifully, the good folks who designed the java.net package decided to use Http rather than HTTP in class names, so we’re not cursed with the likes of HTTPURLConnection. Not so with Apple, however, as anyone who’s worked with Objective-C, or even Swift, can attest. The two-to-three-uppercase-letter classname prefix standard (for example, NSThis, NSThat, NSTheOther) is bad enough. But when you couple that with Apple’s overzealous penchant for capitalizing acronyms, you wind up reading AFJSONRequestOperations from your NSHTTPURLResponses.

Class names written in that manner are undeniably harder to read. That reading lowercase letters is easier than reading…

--

--

Dave Taubler

Software architect, engineering leader, musician, husband, dad