R
4

A friend said my code looked like alphabet soup and it made me start using comments

I was showing a pal my first Python script last week, a simple program that added up some numbers. He looked at it and said, 'This looks like alphabet soup, man. What does any of this do?' I realized I hadn't written a single comment. So now, for every 4 or 5 lines, I try to write a short note about what that part does. It only takes a second and it helps me remember my own work when I come back to it. It also made my code way easier for him to help me fix a bug. Do you have any other simple habits that make your code easier to read?
2 comments

Log in to join the discussion

Log In
2 Comments
parkerm56
parkerm568h ago
What about using better variable names?
7
jasond56
jasond568h ago
Better variable names aren't that big a deal.
8