Loading lesson…
Good names make code clear. AI can rename messy stuff for you.
Code is full of names: variables, functions, files. AI can suggest better, clearer names so the code reads like English.
Show AI any tiny code. Say 'rename everything so a kid could read it.' Compare before and after.
Imagine you're reading a book and the main character is named 'X' and the sidekick is 'Z2.' You'd have no idea who was who! Code has the same problem. When variables have bad names like 'x,' 'temp2,' or 'thing,' code becomes very hard to read — even for the person who wrote it just a week ago! 📖 Good variable names tell a story. Instead of 'x = 5,' you write 'numLives = 5.' Instead of 'fn(),' you write 'calculateTotalScore().' When code reads like English, it's much easier to understand, fix, and share with others. AI is great at suggesting better names. Paste any code and ask: 'Rename the variables and functions so a beginner could understand them.' AI will suggest clear, descriptive names that make the code tell its own story. Here's a challenge: paste a small piece of code into AI and ask it to give you two versions — one with bad names and one with great names. Then compare them. The great-names version should feel almost like reading sentences! This is why professional coders spend real time on naming. There's even a famous joke: 'There are only two hard things in computer science: cache invalidation and naming things.' Good names are that important!
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-explorers-ai-coding-AI-and-the-name-things-well-r10a5
What is a 'variable' in coding?
Why is 'numLives = 5' better than 'x = 5' in a game program?
What should you ask AI to do to improve variable and function names in your code?
Good variable names should sound like what?
The 'naming test' for a variable is: can someone read the name and immediately understand what it holds? Which name PASSES this test?
What does 'future-you will thank you' mean when it comes to good variable names?
Why does a function name need to describe what it DOES rather than what it IS?
What is the 'before and after' challenge when working with AI on naming?
Why does a variable name that needs a comment to explain it probably need a better name?
What does asking AI to 'rename everything so a kid could read it' achieve?
There's a famous joke: 'There are only two hard things in computer science: cache invalidation and naming things.' What does this tell you about naming?
Which scenario shows that bad naming caused a real problem?
When is it okay to use a short name like 'i' in code?
AI renames 'calc()' to 'calculateStudentFinalGrade()'. The new name is much longer. Is this better or worse?
A student shares their code and another student can follow exactly what it does just by reading the variable and function names, without any comments. What has the first student achieved?