@topspin said in No Comments on Funny Stuff:
Nobody sane would take that idea and come up with a policy of not allowing code to have comments.
Have you met people? Or even worse - people in IT?
A group for kurwas
@topspin said in No Comments on Funny Stuff:
Nobody sane would take that idea and come up with a policy of not allowing code to have comments.
Have you met people? Or even worse - people in IT?
@Gustav said in No Comments on Funny Stuff:
@MrL if you can't come up with names for the parts of your 250 line function, I don't think your one-line comments will do any better. Double so for #regions.
A firm believer I see. Cargo is bound to arrive any moment now.
@Gustav said in No Comments on Funny Stuff:
Even better would be splitting that longer block of code into multiple functions. Yes, I know that's not always possible, but whenever possible, that's the preferred way.
If those functions have sensible names describing what they do, sure. But splitting just because 'that's the rule' and inevitably making up nonsensical names is just another one of those IT cargo cult things.
@Bulb said in The Official Funny Stuff Thread™:
@MrL said in The Official Funny Stuff Thread™:
@ixvedeusi said in The Official Funny Stuff Thread™:
@MrL said in The Official Funny Stuff Thread™:
your idea of finding out is to go through all commit messages for this file?
Have you ever heard of the magic of the "blame" command? It brings me right to the commit message I want to see.
There is no commit message you want to see. The file you are looking at was changed 120 times during last 2 years. Good luck piecing together what it does and why from that soup of messages.
Perhaps we work on very different projects.That's what
git blame
and “pickaxe”,git log -S
andgit log -G
, are for. They will give you the one of five commits that actually introduced the specific piece of code you are interested in. They work fast and give good results—provided your commit messages contain useful information, of course.
Let me repeat myself
The file you are looking at was changed 120 times during last 2 years.
There is no specific commit that will tell you what this method does and why. If you want to learn this from commit messages (assuming they are 'good'), you have to go through tens of changes and piece in your head the whole history of this functionality evolution. Alternatively you could have 3 lines long comment specifying what it actually does currently. But no, that would be bad.
@ixvedeusi said in The Official Funny Stuff Thread™:
@MrL said in The Official Funny Stuff Thread™:
your idea of finding out is to go through all commit messages for this file?
Have you ever heard of the magic of the "blame" command? It brings me right to the commit message I want to see.
There is no commit message you want to see. The file you are looking at was changed 120 times during last 2 years. Good luck piecing together what it does and why from that soup of messages.
Perhaps we work on very different projects.
@ixvedeusi said in The Official Funny Stuff Thread™:
If you can't be bothered to write decent commit messages, your comments will be just as useless.
Not at all, I just consider commit messages as utterly useless. You look at a piece of code and you don't know why it is like it is - your idea of finding out is to go through all commit messages for this file? Really?
[edit]
This whole 'self documenting code' bullshit is extremely stupid. Like every fucking thing in IT - take a somewhat decent idea that may work in some situations and religiously push it everywhere with no exceptions.
: Hey, I'm reviewing your PR and I have just one thing - can you remove this comment?
: It explains why this seemingly idiotic thing is done in this flow.
: Well, yeah, cool, but you know, code should be self documenting.
: You can't make this ad-hoc-managerial-decision-idiocy self documenting.
: Um, yeah, that's bad, but the policy is self documenting code, so remove the comment.
Every. Fucking. Thing. Ruined by cargo culting idiots.
[/edit]