• 0 Posts
  • 10 Comments
Joined 1 year ago
cake
Cake day: July 12th, 2023

help-circle







  • Yes. I mean often enough that I wouldn’t call it rare.

    You are a front-end js/ts devel, aren’t you? That makes sense. I can understand why you would have such a skewed view of programming. When everything you write is disposable and might be scrapped every 2 - 3 years, comments would seem like nonsense and a waste of time.

    But that is definitely not everyone’s experience. More than half the code I have written has had a minimum 15 year life expectancy. Comments are essential to remember what I was doing in whatever random language I had to use at a given point. I might not comment on “x++;” but I sure as shit will on “x += (xDelta * yDelta + 31) / 32;” Actually, that’s not true, if the logic is complex enough for the rest of the code chunk, I might just comment on “x++;” to make it clear what x is in this case and why it needs to unconditionally be incremented here. Even if the reason seems ridiculously obvious right now. Because that shit might not be obvious at all in 10 years.