T
2

I finally got called out for messy code and it helped more than I thought

My coworker looked at my Python script and told me my variable names were 'like reading a ransom note'. I started using clear names like 'user_list' instead of 'ul' and now I can actually understand my own code when I come back to it. Has anyone else had a code review that stung but made you better?
2 comments

Log in to join the discussion

Log In
2 Comments
valh32
valh3218d ago
Got told my SQL queries looked like 'a spaghetti monster threw up on the screen' and honestly they were right. I was using single letter table aliases and naming columns 'temp_val', 'temp_val2', that kind of nonsense. After I started using actual descriptive names (you know, 'customer_order_total' instead of just 'x') my queries stopped breaking every time I needed to add one little thing. It stung bad at the time but now I can actually debug stuff without crying.
3
keithbennett
Did the person who critiqued your queries offer any concrete examples of what to do instead?
9