> If a guy brings me his code, and it has mistakes, it brings insane pleasure from how smart I feel [...] And if you tell me that you haven’t had this feeling ever, then you’re lying. Tell me about higher goals, training rookies and all that — I know you’re simply too full of themselves. And if you try to tell me that you learned to defeat that feeling (however it manifests in you), then I must be a pink unicorn.
I really can't relate at all. I feel the opposite. I often feel angry (I realize this is not a GOOD response either!) and always feel sad. I don't want to have to do more work. I don't want a reminder that my previous feedback didn't click with them.
I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work. I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
My takeaway from that has been to try to intercept people earlier in the planning and designing and start-of-coding process. If a bunch of bad code gets to code review, someone failed at explaining what this thing needed to do and how it should be done beforehand. The article claims this is always just itself a confrontational form of argument, but... it doesn't have to be. Stop being an asshole, and find non-assholes to work with.
I have worked with people like the author. They suck. They destroy entire teams and often times the feedback is 99% pedantic personal preferences because why would they do something useful like setup the linter and propose the silly things they always nit pick.
These people don’t last long and I have gotten pretty good at screening out this personality in interviews after having it cause huge issues at two different places I worked.
I'm curious to know if you or anyone else reading this has run into the opposite problem. Or maybe I'm just "that guy" although I am reasonably certain that I am not.
As a rule, so far throughout my 5 year career as a full stack web developer, my coworkers have neither understood or cared about what clean code entails.
I don't berate, I don't criticize, I've taken to mentioning it once and then doing my utmost to never mention it again in an attempt to avoid labeling myself as the odd one out.
Granted, I've turned down a handful of much higher paying (and presumably higher quality teams) for various reasons. At first, it was because I was a bootcamper and high paying jobs are difficult to pick up out of the gate without the appropriate piece of paper. Since then, I've worked for various organizations on a consulting basis, and most recently landed at an early stage YC startup. Pay isn't great, but I have aspirations to start my own startup, so I'm cool with the pay cut for now in return for the opportunity to learn the ropes, business wise. Founder knows what he's doing at least.
But the devs, man. They just don't care. 500-1500 line React function components are the norm. No standardized way for retrieving data from the back-end. I dread assignments that require me to modify or otherwise integrate with previously written code, because the best way I can come up with to figure out what the fuck is going on is to rewrite it sanely. I'm being a little hyperbolic, I do my best to avoid rewriting wherever possible, but I'm not mis-characterizing things by much.
It's honestly depressing, especially considering I've had multiple other teams offer triple what I'm making right now, but neither of them were pre-seed startup SAAS companies which this one is, so here I stay for the time being.
Invariably, I garner a reputation as "that guy" on any team I work on, although granted this is only the second multi-dev team I've ever worked on. Still though, it feels terrible to get a bad reputation for writing good code. Founder likes my work ethic and output though, so I guess I've got that going for me.
Apologies if this turned into a bit of a rant, it just started pouring out, ha!
I know of a few startups with relatively 'senior' people who just don't care at all or are seemingly unaware about 'best practices', and will happily write tens of thousands of the most messy code, neglecting standardizing anything or refactoring their code to be more modular or easily understood.
It does seem to be something the big co. interview gauntlet is designed to weed out, whether it's worth it or not. I'm sure it's still relatively common, but probably a lot rarer than at the median startup.
I think this is par for the course in that subfield.
Part of it is the speed at which things change, both in the software ecosystems and in the change requests to sites. The reliance on comprehensive frameworks (which often need tons of workarounds and glue anyway) also reduces people's desire or experience in actually constructing good abstractions.
Compound this with the fact that startup environments generally don't care about anything other than shipping & pivoting, and want to defer all aspects of longevity.
The same problems exist all over the place, but I think are pretty prominent in these situations in particular.
Couple things about this, because there are levels. First, understand to be a successful engineer you need to be a bit pedantic, so start by forgiving yourself and take a deep breath.
Once you become competent enough to identify clean code, understand that your perception of clean code is colored by your own experience and current mental context. As you learn, you will undoubtedly be aghast at your own code that you wrote at any time before 6 months ago. After you've been at it for a couple decades you will come to the horrifying conclusion that your mental model is always incomplete, the human brain is weak, and it's hard enough to not get caught in the wrong local maxima without facing up to the immense challenge of choosing between global maxima in the incomprehensible problem space where software meets human needs in the hybrid meat/mental/cyberspace ecosystem where they exist and evolve over time.
The other implication is that no two engineers will ever see things the same way. It's not purely about technical strength—a weaker engineer might come up with a better solution given more time to think about it, or due to some other blind spot or skillset gap from the more senior engineer. Also, there are many issues of style and perspective where the important thing is consistency more so than some specific choice. In those cases there's a high risk of bike-shedding, and it leads to a fundamental truth of large scale software development which is that in practice you will never get everyone on the same page. Of course there are controls for this, but unless you have the budget and operational scope constraints of NASA (or perhaps medical device manufacturers) you can't actually enforce this without losing so much development velocity that your company is utterly uncompetitive in the market.
As you move up the seniority and scale ladder to larger projects and architectures, you will realize that you still only have 24 hours in a day, and it doesn't matter how smart or how right you are, the only tool in your built to increase your impact is a simple cliche: "pick your battles". There is absolutely no upside in nitpicking every line of code that could have a conceivable improvement. If you want respect from your colleagues, you need to get good at filtering what is important and what isn't, and only pointing out the most important issues, and doing it as early in the process as possible.
I appreciate the reminder and the helpful tone of your comment in general!
> As you learn, you will undoubtedly be aghast at your own code that you wrote at any time before 6 months ago.
Just checked, and my code from 6 months ago looks identical to what I write at work. My programming style went through a few different phases but its variability has mostly leveled off since I've started writing in a mostly-functional style.
> It's not purely about technical strength
It's simple stuff like putting together a base Modal display component for re-use instead of copy/pasting that div with the inline-styled zIndex of 99,999 for the umpteenth time.
> As you move up the seniority and scale ladder to larger projects and architectures
I hope to side-step a lot of those pitfalls by exiting the ladder altogether and starting my own company where I take a fine-toothed comb to the process of onboarding new hires. Time will tell if the demands of scaling a company end up sidelining my desire for good hires, but software is still a somewhat nascent field, so the sky's the limit if you ask me!
> the human brain is weak, and it's hard enough to not get caught in the wrong local maxima without facing up to the immense challenge of choosing between global maxima in the incomprehensible problem space where software meets human needs in the hybrid meat/mental/cyberspace ecosystem where they exist and evolve over time.
This is a good way of putting it and it's why it's the problem I've chosen to work on for my first product as a startup founder. I call it Pidgin, and my vision for it is a GUI tool for refactoring and even writing code in a more deterministic and reliable way. I spend my mornings before my day job working on it. I think the fact that I think about code quality intensely at all hours of the day probably contributed to the emotional tone of my initial comment. :)
> It's simple stuff like putting together a base Modal display component for re-use instead of copy/pasting that div with the inline-styled zIndex of 99,999 for the umpteenth time.
Is this on the critical path to solving more ambitious goals or just the Sisyphean task you've appointed yourself? It's fine to take pleasure in the small details, and if you want to set up a company to feed that obsession more power to you. However I will go out on a limb and predict two things: 1) unless you are independently wealthy, you are going to stop worrying about this level of detail pretty quickly once you are focused on how to make enough money to afford to hire talented engineers and 2) if you micro-manage style and details to this degree, you may find it hard to retain the level of talent you aspire to.
I took a look at your github profile and looked through your csv_builder repo project in particular. It's good, clean code. Well done! Given that you apparently understand what clean code looks like, I can't help but feel I may be misrepresenting the nature of the 'bad code' I provided an example for. Let me expand on my modal example and perhaps you'll better understand things.
Here's a snippet from the code I had in mind when I wrote my comment:
This was copy/pasted from some other modal in the application. Have you ever heard of the DRY principle? Don't Repeat Yourself. Now, I could wax poetic about just how far one ought to go to embody this principle when considering the time pressures and business demands in a startup environment, but I don't think it should be controversial to say that repeating those 11 lines throughout the codebase for every modal is a Bad Idea, especially considering they could have used the much simpler one-liner, <Modal>.
I won't go deeper into that because that seems like a pretty air tight assumption, but feel free to let me know if it's an invalid assumption on your part nonetheless.
Now, one might say, maybe he didn't know about the other component? And, in fact, I think this was probably the case. And so I can, to some extent, forgive him for copy and pasting due to ignorance of the other component. It's a big codebase and it's impossible to stay up to date on all changes all the time. Nevertheless, this isn't an isolated case, this kind of sloppiness is the rule in the codebase rather than the exception.
> 2) if you micro-manage style and details to this degree, you may find it hard to retain the level of talent you aspire to.
Good engineers make these kinds of mistakes occasionally, it isn't their default mode of programming. I wouldn't have to worry about micro-management because the need for it, at least of the variety concerning this particular example, would never arise. Surely you understand that bad programming can and does exist?
> 1) unless you are independently wealthy, you are going to stop worrying about this level of detail pretty quickly once you are focused on how to make enough money to afford to hire talented engineers
As long as I am responsible for the construction of any kind of software, I will never stop worrying about these kinds of errors because over time they are immensely costly. Team velocity slows drastically due to the unreadable, verbose and repetitive nature of this kind of code. That is unless, of course, the product I'm building manages to embody the vision I have in mind for it and appropriately and sufficiently addresses these kinds of issues such that they are impossible to make anymore. If and when that happens, I will stop worrying because I will rest easy that an automatic process catches these errors and I will be ready to dedicate my brain power to other more interesting problems.
I have no way of knowing exactly how much, but my suspicion is that, in aggregate, sloppy coding such as this likely costs many, many companies building software around the globe millions or even billions of dollars worth of development time every year. I want to alleviate that waste with Pidgin.
And, yeah, devtools aren't exactly the cash cows of software, but they do exist and are occasionally successful. I've got a whole list of SaaS companies in the space, but for brevity I'll simply drop a reference to one I found on HN just this evening. It's called Replay (https://www.replay.io/), and it's a standalone time traveling debugger for web code. They're backed by Andreesen Horowitz, so I think it's likely they have managed to strike on something true.
My aim is for Pidgin to target the process of construction rather than debugging or design as I've seen some other tools do, while still retaining the power of plain text that is invariably lost when using other so-called "low-code" tools.
If you think you might be interested, I would be happy to note your contact details down for when the alpha version is released!
It’s possible there are things you are still learning, or context you are missing.
You sound still early career enough that the years will likely mellow you out and teach you to better appreciate the ups and downs of building things fast.
You know what’s worse than no abstractions? The wrong abstractions.
Oh c'mon graybeard, you can't honestly be defending 1500 line components right now can you? It's not even a matter of abstraction choice, it's a matter of simple hygiene.
You know what's worse than the wrong abstractions? Copy and pasting your inline-styled div with a zIndex of 99,999 for the fifth modal in a row because you can't be assed to write a damned display component in anticipation of the next time you'll need to put a Modal together.
No pushback here, I’m moreso suggesting that length is not intrinsically the enemy. I would much rather be debugging or wrangling a long functional component with duplication than a messed up or poor abstraction that’s leaked out elsewhere in the codebase.
Levels to it all. Keep track of painful modules and have strong intent to fix them. Prioritization is a mf.
Not the OP but also a full stack at my five year career mark and your last point was an appreciated reminder.
I dread cleaning up solutions that I designed earlier where with hindsight, I made a lot of wrong assumptions. I still make wrong assumptions today, they are just designed less brittle.
You are right on the value of building things fast.
However one thing I have learnt is more coupled the code is with no or poor incomplete abstractions less likely anyone is going to change it.
In the interest of shipping fast I would rather have some abstraction today rather than none, simply because nobody fixes spaghetti code which is already working.
Building new things start slowing down more and mode and you end up taking weeks for what should have been an afternoon's effort .
There are no right answers, however sometimes wrong abstractions can be marginally better than none.
It’s certainly possible they don’t care, or they don’t know how to write good code.
Another possible reason could be that they know it’s temporary. A lot of startup code gets rewritten at least once in the first 5 years, there is some art to knowing what code might stick around and be worth the effort to do well, and what you should just bang out fast and move on.
It sounds like it’s possible you haven’t been able to have a conversation with your colleagues about their choices, which might be worth having candidly if you can find the opportunity to do so. If it is ignorance or negligence better to know and decide how you want to proceed if that makes sense.
> Why not? If the other devs truly don't care, you could take it upon yourself to clean up the code base little by little when you can.
I used to do this simply because it makes the code difficult to read for me to review if for nothing else.
Linters and style check tools only go so far, and bottom line is you have to ship software not write complex and expensive to maintain tooling, so automation beyond a point is not a solution.
The devs ended up relying on me as the their clean up guy for all the code all the time. I also becoming gatekeeper/bottleneck of sorts.
It is used make blame and dissection more difficult as more times than not I had cleaned up the code and the last one or two commits are mine.
Also the time spent in reviews reduce and you tend to miss important things as you have focused on what should be basic hygiene so much.
One of the reasons I contribute a lot less to production code is this. It is a losing battle if most devs don't care about it as much as you .
Even now the occasional pull request I would make would be peppered with such corrections , it is just automatic reflex for me, but it doesn't make that much difference.
Don't do this, people either have to value the cleanliness enough to do it as well, or you have to tolerate what is the common minimum or find another team/organization.
You'll always run into that problem if you care. Most of the time this results in having a clique against you who'll make your life hard, for example with increased bureaucracy.
If the manager is on your side, it's possible but not fun.
How do you typically screen for such personality characteristics? I'm curious since my current role involves interviewing a lot of engineers. I too have noticed similar traits in others in the past and I shamefully admit that I myself was pedantic about silly semantics and syntax in code reviews. Sometimes criticism of someone's code was warranted, and sometimes it wasn't and it was just me being picky (I like clean, readable code).
Being picky is not the problem. Being picky and detail oriented is good quality to have as a developer.
We aren't artists, engineering is exacting field, more details you notice and remember better you can be.
The character trait you should look for how do they present that feedback, is it constructive , is it positive , the kind of language they use and how patient they are able to be.
One interview technique/tool that works for me is asking them to review some sample code mine or a junior devs.
It is easy to gauge how many kinds of issues, how many are actually important and how well they present feedback.
The other technique that worked for me is when I review their code in a interview, people who are agressively bad almost take it poorly and can't take feedback positively .
Interviewing is not 100% representative of on job behaviour, however this helps a lot in filtering out
"These people don’t last long and I have gotten pretty good at screening out this personality in interviews after having it cause huge issues at two different places I worked."
Well, now everyone is curious for more details on this. Do share :)
It is possible that the person is accidentally projecting their internal state as a model of how other people feel when they do code review. It's easy to accidentally fall into that trap. I've probably made that mistake before.
The truth is that people's emotions can be a lot more different from yours than people may be willing to imagine.
No one is perfect. But not everyone derives 'insane pleasure' from criticizing, either. And if you do, that may not be obvious.
I agree with the 'stop being an asshole' line, but to do that we need to help people realize when their qualia is way out of the ordinary. If you think everyone else is power-tripping, too, then will you think you're really being an asshole, or are you just doing what everyone else does?
It's scary to think that you might have something else you think everyone else does, but is really just you accidentally being oblivious. Speaking for myself, I'm going to try to be more mindful of this trap in the future.
>Stop being an asshole, and find non-assholes to work with.
I think the process of realizing he needs to do that and doing it is what he's describing in his article. Generally people don't open up about how their behavior is toxic unless they recognize it as a problem. And, though my experience with Russian culture is limited, I understand that competitiveness and criticism is the rule, at least in the STEM fields there. So this guy has been behaving the same way (most) everyone else does, but now he's realizing it's bad and trying to fix himself. I don't think he deserves the criticism he's getting in the comments here. We all start somewhere, and trying to improve should always be encouraged.
We are all products of our environment/the past. Things change when someone says "I don't like what I've become and I don't want to be this way anymore."
Those folks often get undue criticism, especially if they choose to speak up in hopes of fostering positive change in others.
Yeah, I was afraid I'd see myself in this post, because I'm known for giving tough reviews. But I don't. I feel terrible whenever I give a tough review. I agonize about how to say the difficult things that need to be said but do it in a way that won't sting as much, and I know that often, it's going to sting anyway. I feel like I failed for not helping the other developer know how to do things better in the first place. I'm still figuring out how to make my process more constructive, but I've got a long way to go.
One thing that I find that helps is, instead of saying that this thing is wrong, I just put in what would be right, and I do so with little commentary; usually `code block` -> `code block`.
Another thing that I think helps, at the CR stage, is asking after their thoughts for putting the thing together the way that they did. This DOES run into the potential problem of showing that they didn't put thought into it (or that part of it), but....
...there's a certain extent to which it's not your fault if they get to the CR and get a tough review. It's your organization's, "a month of work saves an hour of planning"-style. The developer who wrote the code getting the tough review wasn't set up to succeed, and IMHO that's more a comment on your org than any of the developers involved.
To bring it back around to your personal process, my (unsolicited, haha) advice is that if you're finding yourself giving a tough review, switch to a 1:1 review / pair programming session. Async text communication is hard and prone to miscommunication.
Same here. For me, code review is a good time to share knowledge and help other people. If a problem often comes up, I usually try to see if a tool can solve this. I'll admit that it can be really hard to know what level of tolerence people have for nitpicks and things like that, and at which point you're starting to sacrifice team spirit/people's feeling for small things.
That's why I love pipeline integrated scans that point out issues like excessive cognitive overhead (big fat if/else waterfall with loops everywhere) or "code smells" so the team doesn't get bogged down in munitia during code reviews. If someone needs help getting a piece of code tested to 100% or resolving a code smell they can reach out or bring it up in a standup.
Same, I've never felt anything like this. I find code review tedious and the only thing I really care about is if their code is properly tested or not.
I concur. I'm not a coder but I do review things every 2 months as part of the release cycle, and whenever I see mistakes, especially silly mistakes, I don't feel smart at all, it doesn't even cross my mind.
I feel, in order: disappointment - because how could they make this stupid mistake, then anger - why the f do I have to waste time to correct stupid mistakes, then a bit hateful - we need to fire this person and hire someone competent, then sometimes a bit scared - what else has this person got wrong and I missed, then a mix of all of the above.
What would make me feel good, as far as reviews go, would be to say "hey, this person did this way better than I would have".
> I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
I mean maybe you're working on extremely repetitive code, but the idea that you don't learn anything from reviewing bad code, and hopefully writing comments designed to help not humiliate, seems pretty bad to me also...
You want to learn from others who review your code, but become angry when you have to teach those whose code you review? That seems bad...
It's certainly bad to get angry - I mentioned that there. I should clarify the anger happens when it's repeated more than on a one-off. E.g. if you have the same sloppy signs for 6 months (where I can tell by reading the code that you didn't even try to run your code locally), then I'm not learning anything and I'm getting frustrated because you're clearly not taking feedback to heart.
I try to avoid letting this show, but it's frustrating.
Sometimes I’ll look over PRs early on, notice the entire approach is bad, and leave a comment.
People often got annoyed, they would say their PR isn’t ready yet.
That’s fair, I kind of understand, my intention was to just save them time going down an incorrect path though, because I know it’s going to be difficult to convince them later they need to rework days of work.
If team work isn't in the culture at your place it's very understandable they would react like that. If they don't see the benefits at your place and they've also only had bad experience with that at their previous places it's the natural defense mechanism.
You could do the first step for example. Put up your own stuff for early on RFC. Invite them to work collaboratively on it with you and give early feedback and see how you react. Basically: be the role model and let them follow.
Not guaranteed to work but it's one way to start some of it.
Sidenote: most teams don't actually do team work. It's a bunch of people thrown together that work on more or less loosely related stuff but everyone is out for themselves. It's a matter of the environment they have to work in in most cases. Individual metrics driven productivity culture. You can't expect someone to do good team work and collaboratively come up with the best approach when their incentives from management's side is to get as many PRs merged as they can to get that bonus and a good end year rating etc.
The other thing to keep in mind is that most code is fine.
When one company buys another the quality of the code is a calculation in the sales price. But it's a small one, and it takes a real dumpster fire to move that needle.
> I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work.
What kind of automation or tools are you using for code review?
I really can't relate at all. I feel the opposite. I often feel angry (I realize this is not a GOOD response either!) and always feel sad. I don't want to have to do more work. I don't want a reminder that my previous feedback didn't click with them.
I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work. I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
My takeaway from that has been to try to intercept people earlier in the planning and designing and start-of-coding process. If a bunch of bad code gets to code review, someone failed at explaining what this thing needed to do and how it should be done beforehand. The article claims this is always just itself a confrontational form of argument, but... it doesn't have to be. Stop being an asshole, and find non-assholes to work with.