I’ve been thinking a lot recently about the difference between a junior developer and a senior developer. There’s a variety of tangible and intangible qualities that make up both positions, but the hard skill that has me most curious is the code.

Obviously there’s a lot of subjectivity here, and I’m also not suggesting that junior people can’t write high-quality code (or that senior people can’t write terrible code from time to time). But I was curious about common patterns or knowledge gaps that junior programmers may have over more experienced engineers, and how they could try to improve those technical skills.

The thing main points I was curious about:

What does ‘junior’ code look like? What are the patterns or knowledge gaps that show in ‘junior’ code.

At what level (and with what qualities) is ‘junior’ code passable for your code base?

At what level (and with what qualities) does ‘junior’ code move into ‘mid-level’ and ‘senior’ code?

Let’s use an actual interview question as an example: what’s the difference between these two solutions?

Problem: Jaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his philosophy that he delivers via Twitter. When writing on Twitter, he is known for almost always capitalizing every word.

Your task is to convert strings to how they would be written by Jaden Smith. The strings are actual quotes from Jaden Smith, but they are not capitalized in the same way he originally typed them.

This is admittedly a very small problem, but illustrates some clear differences in thinking.

One, for example, has a lot of variables declared - frankly, more than are needed. One makes good use of string and array methods, such as .map and .chartAt(). One is much, much shorter.

Is that more advanced code? Shorter, using more sophisticated methods? More readable? Would you even allow something similar to the first solution into your company’s codebase? I ask these questions not with judgement, but genuine curiosity.

One piece of advice that I found very helpful:

‘Specific examples are hard to give, there are different styles and opinions. Mainly I consider a good programmer someone who understands that she’s programming for the next person to read, not to make the machine run, and codes appropriately.’

What do you think? What do you look for in junior and senior code, and where’s the line for what you’d allow in a codebase?