I’ve worked with a few people who are just incomprehensible. One refuses to write commit messages of any detail. Just “work in progress”. Cast him into the pit.
There was another guy that refused to name his tests. His code was like
He was like, “Test names are like comments and they turn into lies! So I’m not going to do it.”
I was like, a. what the fuck. b. do you also not name your files? projects? children?
He was working at a very big company last I heard.
edit: If you’re unfamiliar, the convention is to put a human readable description where those empty strings are. This is used in the test output. If one fails, it’ll typically tell include the name in the output.
I get the hesitation that things can turn into lies, but that’s a sign that you’re doing things wrong. That also tends to happen to comments that are far away from the relevant code, like the documentation of a 100 line function. The function can change while the comment is no longer visible on the screen, so it’s easy to forget to also fix the comment.
But test strings like that are designed to avoid that problem. They’re right there next to your tests for a reason. You should always be right next to them when you’re changing the test.
Fundamentally, this is something that has to be addressed with code reviews. If someone can commit their changes to a group repository without anybody else seeing them, you’re going to get stuff like this. As soon as you get decent code reviews, you can just reject a change where there are tests without documentation, the same way you can reject a change to a test where the documentation is now out of date.
Code reviews are important. Unfortunately, no-test-text guy convinced his whole team that he was right, and I wasn’t able to block it. I’d scheduled a meeting to try to get the wider org to adopt a more sensible standard, but then there was a mass layoff 🤷
The other guy with the bad messages is at a tiny startup where they’ve laid off almost everyone, and the other 2 guys don’t want to make waves. The CEO is big on “just ship it” (and also “why are there bugs in production? this is unacceptable!!”)
I’ve worked with a few people who are just incomprehensible. One refuses to write commit messages of any detail. Just “work in progress”. Cast him into the pit.
There was another guy that refused to name his tests. His code was like
describe(''. () => { it('', () => { expect(someFunc()).toEqual(0); } it('', () => { expect(someFunc(1)).toEqual(0); } it('', () => { expect(someFunc("").toEqual(1); } }
He was like, “Test names are like comments and they turn into lies! So I’m not going to do it.”
I was like, a. what the fuck. b. do you also not name your files? projects? children?
He was working at a very big company last I heard.
edit: If you’re unfamiliar, the convention is to put a human readable description where those empty strings are. This is used in the test output. If one fails, it’ll typically tell include the name in the output.
I get the hesitation that things can turn into lies, but that’s a sign that you’re doing things wrong. That also tends to happen to comments that are far away from the relevant code, like the documentation of a 100 line function. The function can change while the comment is no longer visible on the screen, so it’s easy to forget to also fix the comment.
But test strings like that are designed to avoid that problem. They’re right there next to your tests for a reason. You should always be right next to them when you’re changing the test.
Fundamentally, this is something that has to be addressed with code reviews. If someone can commit their changes to a group repository without anybody else seeing them, you’re going to get stuff like this. As soon as you get decent code reviews, you can just reject a change where there are tests without documentation, the same way you can reject a change to a test where the documentation is now out of date.
Code reviews are important. Unfortunately, no-test-text guy convinced his whole team that he was right, and I wasn’t able to block it. I’d scheduled a meeting to try to get the wider org to adopt a more sensible standard, but then there was a mass layoff 🤷
The other guy with the bad messages is at a tiny startup where they’ve laid off almost everyone, and the other 2 guys don’t want to make waves. The CEO is big on “just ship it” (and also “why are there bugs in production? this is unacceptable!!”)