Code never lies, comments sometimes do. Great quote. Do you agree?
@nixCraft Yes. Never comment, only document.
Comments considered harmful | ACM SIGPLAN Notices

ACM SIGPLAN Notices

@nixCraft Yep, I usually ignore the comments if I try to understand what some code does.

If the code somehow doesn't seem to make sense, or something isn't obvious, I glance through the comments for a hint.

@nixCraft Yes, absolutely. But people who fundamentally believe code doesn't need comments are still wrong:

Summarising sections of code with comments is extremely valuable, so you can quickly skim over sections and find the one which is important for your task.
Even more so however, code can't explain design decision, non-obvious limitations, assumptions (that can't be represented in an assert-call) or any other rationales. Comments are crucial for that.

So, don't be one of those people who fundamentally disallow comments in a project because "code is documentation".

@nixCraft The comment needs to explain the bigger picture,
What is the INTENTION of the code.
Pre/Post-Conditions
Possible return values and meaning.
Limitations.
...
@nixCraft Function and class names sometimes lie.
Morten Grøftehauge (@[email protected])

Programmers: The code does what the code says! *vigorous finger-jabbing* Also programmers: Naming things is the hardest problem in computer science 😭 *dramatic hair flip, exit scene*

Sigmoid Social
@nixCraft totally agreed. i avoid comments in code because I forget to change them when my code change
@nixCraft what if my code doesn't have comments?
lmfao

@nixCraft Not only do comments lie, but the documentation often does.

Why is it that we hear about code reviews but seldom if ever, hear about documentation reviews?

As somebody who has maintained a personal wiki for over 20 years, and now can't live without it, I can tell you, even my own documentation is often WRONG!

@nixCraft code maybe doesn't lie, but it can hide the truth (as we have seen with xz). I vote for code that represents better and transparently what it does.
@florenciocano yeah if you want to see code lying...just work on reversing malicious code... :)
@nixCraft Thank you for providing ammo to my comment-free lifestyle
@nixCraft "A common fallacy is to assume authors of incomprehensible code will somehow be able to express themselves lucidly and clearly in comments." - @kevlin
@lazydev @nixCraft @kevlin "a miracle happens here. Seriously, if anyone knows how or why this code works, please let me know. If you don't know how this code works, please don't try to modify it." - will that do?
@lazydev @nixCraft @kevlin A common fallacy is to assume that if code is not intrinsically obvious then it's clearly the fault a of a bad developer.
@nixCraft
Code never lies, but only if you can read it like a machine. If you read it like a human being, you can easily miss important things. Because code is a linear representation of a piece of logic, it is only ever able to tell one story line explicitly. However, complex business logic can be viewed from different angles, resulting in different story lines. You can either choose one of these and stick to it or try to include others in a different way (comments or documentation).
@nixCraft My documentation may be incorrect so I don't do it is a really bad justification for not documenting.