How to name variables

前端 未结 24 1252
抹茶落季
抹茶落季 2020-12-01 00:37
  • What rules do you use to name your variables?
  • Where are single letter vars allowed?
  • How much info do you put in the name?
  • How about for exam
24条回答
  •  情深已故
    2020-12-01 01:15

    I always use single letter variables in for loops, it's just nicer-looking and easier to read.

    A lot of it depends on the language you're programming in too, I don't name variables the same in C++ as I do in Java (Java lends itself better to the excessively long variable names imo, but this could just a personal preference. Or it may have something to do with how Java built-ins are named...).

提交回复
热议问题