Familiar thing often “feel better” to us even when they’re quite bad. I’ve seen that bias at play when new people join a team.
Their code uses too many classes? Bad code! Its overly factorized? Under factorized? Too many dependencies? Too much reinvention of the wheel? All these things are obviously evidence that whoever wrote this code is inexperienced (and they probably have deep character flaws).
I'm sure other people feel exactly the same way about my code, too. Its frustrating and dumb.
That’s the only situation where you get enough direct, useful feedback over time on whether something is good or not.
This is actually better because you’re bringing the person back to the forefront instead of trying to judge code as objectively good or not
This could mean working with (competent) people who think differently, or working with a different language (my most formative was Clojure, as someone who had never even seen a lisp before), etc.
Initially I bend over backwards in near-total deference, and over the course of a few months I start to feel like I’ve gained perspective. It’s the only way I’ve found to not carry the baggage of “my way” into new situations.
But if it’s any consolation, it’s pretty much the same with any cognitive bias: you can never totally eliminate them, but you can make progress, and the first step is just knowing about it! :)
"Bob doesn't like it when I do this but fuck him"
Me too. But...
Every so often it happens that I read bad code, with functions that are too long and complex or too short, or with misleading variable names, or a way too clever class structure, or whatever; cursing the person who wrote that code ... only to find out it was me who wrote that code.
It makes me put things in a different perspective. I try to judge not too harshly.
It's like Stockholm syndrome for developers.
For example recently learning RxJS and writing a complete mess of state spread across my app feels good because its "declarative" compared to the ugly previous "imperative code".
I think part of it is the reward of the learning process itself, but I can see it being an addictive cycle.
After all how could code be bad if it follows a pattern?
public class C {
int x;
public C(int x) {
int x;
this.x = x;
}
}
and you waste an hour trying to work out why C(5) is not working as expected because god knows who would do that? (summarised from a real life example)"Sometimes I shake my head and wonder. And sometimes, I just shake my head."
It's one thing for a junior dev to do this. But try working with a bunch of amateurs that somehow got promoted to lead because they kind of worked with some technology at their prior job. It's amazing watching a company replace domain expertise with superficial framework-of-the-day knowledge. Especially knowing that these devs will move on in a year escaping the consequences of their actions.