An just 30-something Software Dev that enjoys gaming, woodworking, electronics and plenty of other hobbies. Too many hobbies.

  • 0 Posts
  • 130 Comments
Joined 3 years ago
cake
Cake day: June 9th, 2023

help-circle

  • I often use z as a temp variable when i need something to compare to when creating new code but don’t want a separate window to the side or to experiment with something but don’t yet know what the result can or will be. I use z purely just because i know z is very very unlikely to have been used elsewhere, and if for some reason it has, then i just name it ‘zz’.

    This is actually temporary by the way. It does not stay in my code. Once I’m done with it, i delete it.



















  • This is why you have style guides, policies and safeguards, with others checking PRs as they go through to catch this sort of stuff.

    Plus I’m not saying everything should be commented. By default things should be explainable through the code and making sure variable and method names are descriptive, along with strong typing if your language has it.

    Comments are there for when the code itself is not enough. But you’re right shit always creeps in eventually regardless of the best intentions. Which is why teams need tech debt breaks where no new features are added and they go through the code fixing the niggly things that haven’t been worth fixing whilst doing other features, and ensuring critical sections (the kind that usually have comments on them) are still working as intended and described accurately.

    This is from a senior dev in the industry.