Group code blocks in a logical way:
- Keep your variables close to where they are used.
Use short names:
- Naming a variable “a” or “b” is fine.
- But … I lose context, right? … DO NOT! If you respect rule 1, there is no problem, you will reduce the redundancy and the cognitive load of your code.
Use names that speak for themselves:
- Nothing of “mVal”, “tRows”, etc …
Use the new lines intentionally:
- In the same way that you divide a text into paragraphs, make the new lines in your code communicate something.
If you want to expand this information I recommend this video, it is based on Go but it applies to other languages as well ->
Do you wanna know more about this topic and other interesting tech topics?
Follow me on Twitter: https://twitter.com/carloslfu
Thanks! and happy learning.