General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
xybersurfer
Thriving Technologist
comments
Comments by "xybersurfer" (@xybersurfer) on "If Code Is Self-Documenting, Why Do Comments Exist?" video.
@MikkoRantalainen i mostly agree. but being asked about code, could also be due to them not understanding a fundamental principal. for example: not knowing the syntax to create their own class. i've met someone that didn't know this, after decades of programming
2
a good time to add comments is especially when doing any kind of undocumented hacks, or making weird decisions for a good but non obvious reason. i've taken over as maintainer of a product and it dives deep into the internals of an underlying API, that we were not even supposed to touch. not having any comments explaining the choices turned out to be a disaster when some of the hacks stopped working. the fix was relatively simple in the end in a complicated piece of code, but it got delayed for months because i couldn't figure out what was going on (part of the problem being changing this generic code could fix it for one customer and break it for another). i've also noticed the same behavior in consultants, where they don't document their code. i suspect that the reason is that they think their code is not important and that it's all small one off changes. i think that's a terrible mindset
1
well said. much of our code could use an apology too haha
1
i don't think "all code needs comments, period" means that every line should be commented as you seem to be implying
1
@TrackedHiker i guess what "every" means is causing confusion. i don't think every method needs a comment. i think they are necessary for undocumented stuff like hacks or non-obvious things. i really don't think every file needs a comment. i write them sometimes to summarize large blocks, but i don't consider those necessary. i doubt we'll quibble though (that's not my intention)
1
@TrackedHiker one thing i've found that often helps readability is, not nesting loops in the same method
1