22
My code review said my variable names were like alphabet soup
I was working on a Python script for a class project and my friend looked it over. She pointed at my screen and said, 'What does 'x' and 'temp' and 'data1' even mean here?' I had to stop and think about it for a minute. Now I try to use names like 'user_input' or 'item_count' so it's clear. How do you guys pick good names for things in your code?
3 comments
Log in to join the discussion
Log In3 Comments
bennett.mason1mo ago
Yeah, that's a good start. But what happens when you have a list of items? Do you call it 'item_list' or just 'items'? I always get stuck on whether to add the type to the name or not.
8
susan_bell1mo ago
What would you call it if you had to explain it to someone new?
5
morgan89829d ago
Wait, you actually add the word "list" to the variable name? That's wild. Just call it items, the brackets show what it is.
1