3 ms·
> A compiler will not call you in the middle of the night to tell you how amazing your code is. A co-worker, however, might call you in the middle of the night
by ccvannorman 3y ago
> A compiler will not call you in the middle of the night to tell you how amazing your code is. A co-worker, however, might call you in the middle of the night during his on-call night shift to ask you why you introduced an object X that has the same meaning as object Y
What a treasure of an article. Definitely felt the leveling up happening as I was reading.
- kazinator 3y agoI don't understand what that passage is supposed to mean. Yes, you write code to please the compiler. Moreover, you first look for ways to make the compiler harder to please, rather than just use its defaults. You don't write code just to please the compiler, but it's a big deal. (Obviously, if you just wanted to please the compiler, it wouldn't have to be indented, and your variables could have names like l0327.) A sufficiently smart compiler could warn you that you're introducing an object X with the same meaning as object Y, so your coworker can sleep at night. Or if not compiler than some other tool. We can imagine tooling that scans the code base and tells you that a class exists that is very similar to what you just wrote. A compiler was written by your de facto coworkers, likely in another organization far away. When their ball-busting attempts turn up nothing against your code, that is a kind of praise.