Skip to main content
added 1 character in body
Source Link
Mario
  • 1.5k
  • 2
  • 11
  • 14

IMO the best documentation is the documentation you don't actually need. I also hadhate writing documentation and comments.

With that being said:

  • Pick readable and talking names. Don't use n, but instead numberOfItemsFound for example.
  • Don't shy back from storing parts of a calculation in a constant variable rather than pushing everything into one line.
  • Move partial tasks from branches into their own (inline) functions, if you're reusing them or the parent function becomes long and tedious to follow.
  • Be more elaborate and only optimize code over readability where it's really required.

IMO the best documentation is the documentation you don't actually need. I also had writing documentation and comments.

With that being said:

  • Pick readable and talking names. Don't use n, but instead numberOfItemsFound for example.
  • Don't shy back from storing parts of a calculation in a constant variable rather than pushing everything into one line.
  • Move partial tasks from branches into their own (inline) functions, if you're reusing them or the parent function becomes long and tedious to follow.
  • Be more elaborate and only optimize code over readability where it's really required.

IMO the best documentation is the documentation you don't actually need. I also hate writing documentation and comments.

With that being said:

  • Pick readable and talking names. Don't use n, but instead numberOfItemsFound for example.
  • Don't shy back from storing parts of a calculation in a constant variable rather than pushing everything into one line.
  • Move partial tasks from branches into their own (inline) functions, if you're reusing them or the parent function becomes long and tedious to follow.
  • Be more elaborate and only optimize code over readability where it's really required.
Source Link
Mario
  • 1.5k
  • 2
  • 11
  • 14

IMO the best documentation is the documentation you don't actually need. I also had writing documentation and comments.

With that being said:

  • Pick readable and talking names. Don't use n, but instead numberOfItemsFound for example.
  • Don't shy back from storing parts of a calculation in a constant variable rather than pushing everything into one line.
  • Move partial tasks from branches into their own (inline) functions, if you're reusing them or the parent function becomes long and tedious to follow.
  • Be more elaborate and only optimize code over readability where it's really required.