11
lxmcf
5y

Just going through some old code from git repo's and code examples and I have a message to every dev out there after seeing some of the code quality...

Never... ever... ever fucking give variables with names like vx, tr and sq.

Give your variables names that explain what they are, it is so fucking hard trying to follow code that has 2 letter variable names and there is a special place in hell for you :-)

Comments
  • 7
    For i in items {
    println(i);
    }

    //quite okay imo
  • 1
    @netikras when it covers to loops like for and foreach by all means it's perfectly fine, it's easy to tell what the variable actually it's when you look at the loop.

    It's more like stand alone ones so for example if someone stored a windows X position, don't use wx, use win_x or the like, be descriptive
  • 0
    @lxmcf it's more about block length than types of operations. If block length is just a few lines, short var names are perfectly fine. In longer blocks var names should be more expressive.
Add Comment