Hiring a programmer: read the names they choose
How do you hire the right programmer for your team? You can look at the CV, the diplomas, the list of frameworks. You can also look at something cheaper and more honest: how they name things.
Names are the one decision a programmer makes on every single line. Nobody reviews them in a contract, and nobody measures them in a test. Yet a name tells you what the author understood, and what they decided not to understand. Based on how they name things, programmers fall into 4 categories.
What do we mean by a good name?
Phil Karlton's old joke says there are only two hard things in computer science: cache invalidation and naming things. The joke lasts because the second half is true. A name is a design decision, and a bad one is paid for by everybody who reads the code after you.
Eric Evans gave the practice a name in Domain-Driven Design: the ubiquitous language. The team, the product people and the code use the same words for the same concepts. When a word changes between the meeting room and the code, a translation layer appears, and nobody owns it.
To compare the four styles, I use one example. Let's consider a feature that allows users to securely store contract files in an archive.
1. The tmp-driven programmer 🚴🏽
This style implies immediately giving the component (class, function, variable…) under development a temporary name until we have a better idea… or not. The better idea rarely comes. When the influence of names is underestimated, we often find production code in this state:
const somestring = body.login;
const foo = body.pwd;
Service.save(Toto, somestring, foo);Every developer who comes later must spend a significant effort reading and debugging back and forth until they understand the responsibilities of that component. The cost is not paid by the author. It is paid by the next ten readers.
This kind of programmer is focused on moving his ticket and executing it, no matter how. The ticket moves. The product pays.
2. The mind-mapper 🪄
Let's look at a code snippet first:
loginService.check(login, password);
ftp.save(document);The programmer changed the word "contract" into "document", and the "archive" concept into an "ftp" concept. He also decided that security should not be the responsibility of the archive, but of another application service layer that can reach it in an insecure way.
Each decision may look reasonable alone. Together, they cause indirection and force the team to maintain a mind map that translates product vocabulary into code. Ask the product owner for "the archive", and the developer must think "ftp". Every conversation pays a translation tax.
It also limits the choices of the product team. They quickly become slaves of the developers' choices, which are usually not communicated and taken alone, because they are considered "technical" choices. They are not. They are decisions about the vocabulary of the business.
3. The technical geek 🤓
This one names everything according to how things are done, and rarely says what is done. The code becomes over-detailed and noisy, and hard to read for any experienced reader. The code would be:
const contractFromDb = contractService.loadFromDatabase(id);
archiveService.tryLoginWithHashedMd5OrThrow(command.login, command.pwd);
archiveService.throwIfNoFile(contractFromDb);
archiveService.persistSync(contractFromDb);Every name leaks an implementation detail: the database, the hash algorithm, the synchronous write. Change the algorithm and you must change the name, or the name lies. Names that describe the mechanism age as fast as the mechanism.
This is the programmer who knows many things and says them all at once. The reader looks for the business rule and cannot find it under the plumbing.
4. The architecture-driven programmer 📐
This programmer supports the organization by making simple choices that ease the integration of newcomers and grant fast adaptability to the product. He listens carefully to the domain language. He puts in enough abstraction, and suitable names, to embrace the functional choices. He uses the same language as the business, hides the technical details, and still screams the structure and the architecture. The code would be:
const contract = contractRepository.byId(id);
archivingGateway
.accessFor(User.from(login, password))
.save(contract.file);Read it aloud to a product owner. They will understand it. That is the test. The words are the ones of the business: contract, archive, access. The technical choices, the database and the credentials check, are behind the gateway where they can change without changing the sentence.
"Screaming architecture" is Robert C. Martin's expression: the structure of a system should shout what the system is for. The same goes for a single line of code.
How do you use this when you hire?
Hiring on names is not a trick. It is a way to read intentions. Here is how I would use it:
- Read real code from the candidate: a pull request, a kata, a repository. Read the names before the logic.
- Give a business sentence and ask them to write the signature of the code. Do they reuse your words, or invent others?
- Ask them to rename a noisy snippet, and listen to their questions. "What do you call this in your business?" is a very good question.
- Watch for the comment. If you need a comment, you have not put enough effort into naming it.
Your code may speak louder than your CV!
Of course, this is a heuristic and not a verdict. A candidate under interview stress can write a foo. People also change: naming is a skill, and a team that reviews names together raises everyone. I wrote about this in Naming #1 and Naming #2. The signal is still strong, because the profiles above map to attitudes: care for the next reader, or care for the next ticket.
💡 Not all programmers make the same impact! Choose carefully, hire wisely, and read their names before their diplomas.
Keep learning! Keep reading! Happy coding!
Resources and bibliography
- Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software (Addison-Wesley, 2003). https://www.domainlanguage.com/ddd/
- Robert C. Martin, Screaming Architecture (The Clean Code Blog, 2011). https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.html
- Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship (Prentice Hall, 2008). https://www.oreilly.com/library/view/clean-code-a/9780136083238/
- Kent Beck, Smalltalk Best Practice Patterns (Prentice Hall, 1996). https://www.oreilly.com/library/view/smalltalk-best-practice/9780132852098/
- Phil Karlton (via Martin Fowler), TwoHardThings (martinfowler.com, 2009). https://martinfowler.com/bliki/TwoHardThings.html
- John Ousterhout, A Philosophy of Software Design (Yaknyam Press, 2018). https://web.stanford.edu/~ouster/cgi-bin/aposd.php
First published on LinkedIn: the original article
