I have taught hundreds of beginner developers through CTROTECH over the past few years. I expected to help them learn. I did not expect they would make me a better engineer.
Here is the pattern I noticed: every time a student struggled with something, it revealed an assumption I had been making in my own code. Fixing those assumptions made my code better.
This article is about five specific patterns I observed across hundreds of students and how they changed the way I write software.
Pattern 1: Beginners Struggle with Implicit Behavior
When students first learn JavaScript, implicit returns cause a lot of confusion.
const double = (x) => x * 2
The confusion comes from implicit behavior, not from the arrow function syntax itself. The function returns without a return keyword. For an experienced developer, this is a convenience. For a beginner, it is magic.
Code that relies on implicit behavior is harder to explain. And if it is harder to explain, it is harder for future readers to understand.
This shifted how I look at my own code.
// Hard to explain — implicit chaining:
const processUsers = (users) => users
.filter((u) => u.active)
.map((u) => ({ id: u.id, name: u.name.toUpperCase() }))
// Easier to explain — explicit steps:
function processUsers(users) {
const activeUsers = users.filter(user => user.active)
const formattedUsers = activeUsers.map(user => ({
id: user.id,
name: user.name.toUpperCase()
}))
return formattedUsers
}
The second version is more lines. But each step is explicit. You can point to a variable and explain what it contains. The intermediate state is visible instead of hidden.
I am not saying you should never chain methods. I am saying that when I catch myself writing something I would struggle to explain to a student, I stop and consider whether it needs to be that way.
Pattern 2: Variable Names Reveal Clarity of Thinking
Beginners use bad variable names because they have not yet learned that naming is part of engineering. But experienced developers do it too, just with more sophisticated bad names.
The names I see most often in beginner code that also show up in production codebases:
-
data— what kind of data? -
temp— temporary for how long? -
result— result of what? -
items— what items?
Teaching forced me to be specific. When a student asks "what does this variable hold?" and I have to trace through five lines to answer, the naming is the problem.
// Before — every name requires context:
const d = await getData()
const r = d.filter(x => x.s > 5)
return r.map(x => ({ ...x, label: x.s.toString() }))
// After — each name tells a story: