20 ms·
No code reviews by default
- weatherlight 5y agoWe do code reviews because people make mistakes, because code reviews are learning opportunities; not because we trust or not trust each other.
- passive 5y agoI think a key thing here is that they are only doing releases every other week. So when changes skip a code review, they are still subjected to a good amount of peer testing before they ever reach a customer. I think that's a reasonable approach in the situation, and I can see why they have gotten good results from it.
- tpoacher 5y agoCode review: the process by which a team member learns something useful from another team member (and occasionally also vice versa), by reviewing their code with them. "We unashamedly don't do code reviews unless requested explicitly" == "We are proud to announce we don't like learning from each other unless shit hits the fan*" * which it will
- northisup 5y agocongratulations on finding engineers without egos that know when to ask for it, i've worked with a ton of great, if not over confident, people that 100% needed code review to be policy to not take the whole system down. why i like code review: 1) code review is a great place for mentorship 2) people mess up, its ok, major issues have been caught in code review
- pxllh 5y agoI always really enjoy reading both the Raycast and Linear engineering blogs because they’ve really got a great approach to empowering distributed teams, and giving engineers the autonomy to work well. I can’t necessarily say this approach would work everywhere but it’s nice to see companies critiquing and challenging methodologies.
- mixedCase 5y agoI'm glad this works better for them, or at least they feel that it does. I'd also bet that they're either a small minority of teams that jell so well that they manage to scale a codebase without it turning into a disgustingly inconsistent mess; or that indeed their codebase qualifies as such or is still too small for the effects to be very visible. Code reviews are not a tool intended mainly to catch bugs. Types, automated tests and manual tests are going to do the bulk of your bug-catching after all. Code reviews' more relevant purpose is to act as QA for the code itself far more than it is to verify if the code achieves what it sets out to do. This is in service of both maintainability (which impacts your ability to make future changes and staff retention) as well as performance (by introducing the chance for another dev to detect suboptimal approaches). Once your teams grow, code piles up, and static analysis can't cover all your bases, either your team corroborates the code that you write matches/defines group standards; or each developer's careful design accumulates as "organic growth" carefully duct taped together to barely work. And just to state the obvious, code reviews are merely a tool to achieve this. Pair programming is another.
- commandlinefan 5y ago> Code reviews are not a tool intended mainly to catch bugs Well, not to detract from your point (I agree), but what little research has been done in this area suggests that code reviews are actually one of the best ways to catch bugs: https://kevin.burke.dev/kevin/the-best-ways-to-find-bugs-in-your-code/ https://kevin.burke.dev/kevin/the-best-ways-to-find-bugs-in-...
- kubanczyk 5y agoThe source actually says that informal code reviews are very poor way to catch bugs, while formal code reviews are one of the best. I don't have "Code Complete" at hand to follow up on that, but I strongly suspect that the formal code review was defined in this research as reviewing the entire codebase line-by-line on meetings. As opposed to reviewing just a single change to the system. Can you/anyone shed some light on this?
- deleted 5y ago
- cdaringe 5y ago> Pull requests don't prevent bugs Pull requests find bugs on every software and hardware team I have ever participated in. I cannot imagine living without this process. PRs increase knowledge and awareness of features. I fully concede that it is discouraging in some circumstances, but those tend to be the exception, not the rule. Most often it’s discouraging around a core set of individuals who bring more dogmatism and policing to PRs, which aren’t entirely welcome. Power to this team, but either they’ve discovered the holy grail, or they will be compensating for this in some other internal process, certainly not user feedback.
- geoah 5y agoCouldn't agree more. I'm fairly certain that I'm a better coder and team member than I used to be because I was part of both ends of many many PRs.
- anthonyskipper 5y agoLuckily Raycast work in an unregulated industry. In a lot of regulated industries this would not be an option as 4-eye reviews are a mandatory policy requirement. I also don't know how smart it is to brag about, seems like just asking for something to go wrong.
- brokencode 5y agoI think this would work really well for a small and experienced team, though where I work, we have a lot of developers fresh out of college, and I would be pretty nervous setting them loose without close review of their work.
- klabb3 5y agoThe idea is not that everyone has to be omnipotent, it's that you trust people enough to send for review and ask for help when appropriate, instead of always. I.e. when you're new to the code base or language.
- brokencode 5y agoI don’t think I’ve ever reviewed code from a new hire that didn’t have multiple problems or style issues that needed to be addressed. That’s also actually true for code from most experienced devs too. And it’s rare for my code to get through code review with no issues found. So bottom line, I just don’t think this would work for most teams and developers.
- ReleaseCandidat 5y ago> I just don’t think this would work for most teams and developers. Most teams and developers don't do code reviews because the only person that could do code reviews would be the developer himself.
- brokencode 5y agoDo you mean to say that most developers work alone, so don’t have anybody to review their code? That’s probably true for hobby projects and the like, but companies rarely have teams of one working on anything.
- ReleaseCandidat 5y ago> Do you mean to say that most developers work alone, so don’t have anybody to review their code? Yes and no. They do work in teams, but this teams are so small, that everybody has 'their' part of the code, where nobody else even takes a look at, much less changes anything. I'm talking mostly about non-software companies. Btw. most people that actually do work alone are self-employed. But code reviews don't make a sense if there is no other developer.
- tus666 5y agoHe mentions "trust" a lot. Is that why we do code reviews, because we don't trust each other? I find this attitude problematic. We do code reviews because humans make mistakes. Requirements can be misinterpreted. Different work in progress can be in conflict with each other. Reviews are a good way to learn from each other and keep abreast of what work is occurring outside your own bubble. Not doing code reviews because of "trust" kind of misses the point. I find even just cursory and brief code reviews are beneficial and often pick up on issues. It also creates a more collaborative team and gives me a reason to communicate with devs I might not otherwise communicate with, even if that is just a brief comment on a PR. Rejected.
- islon 5y agoI have an open source project in which I work alone. I never work directly on master, always on a branch, and when I'm done I create a PR for myself. Can't remember a single PR that I reviewed where I didn't find some issue or bug. I guess you can say I don't trust myself...
- ljm 5y agoIf something hit production and caused a major fuck-up because there was no peer review process, then in all the places I've worked at the first action item in the post-mortem would be "we should introduce peer review." Otherwise someone would ask how we could ensure it wouldn't happen again, and no one would be able to say "because we trust them," and leave it at that. It would sound more like "I trust you will never make that mistake again," which sounds more like a threat. You also can't go to your clients and say "sorry, we let our team deploy stuff without reviewing because we trust them... so please continue to deal with our avoidable problems." Thing is, I've lead my fair share of teams and I trust my team-mates and colleagues implicitly. It makes for a strong team. But we still do code review (peer review) because we want to build software that works well and support each other. We're not in the job to simply deploy code to prod as quickly as possible. I'd also add that I think any software engineer should try and have the experience of working in a highly regulated field, like healthcare. It's hard to get an appreciation for why these things exist until you realise you're held to a much higher level of accountability because your oopsie moments can have much larger consequences. For me, it's been hard to go back to my old, cavalier attitude after that.
- dan-robertson 5y agoI’m curious how they avoid pushing changes that break the build. Maybe they have some other reason that this doesn’t happen or is hard but having a large number of people trying to collaborate on a constantly broken repo is not a recipe for productivity. I also wonder if there are typically 0 reviews or typically 1 — that is, are people even reading their own changes before they push them.
- ReleaseCandidat 5y ago> I’m curious how they avoid pushing changes that break the build. By not pushing changes that break the build. In other words: that does not work if you can't test (actually test, not just try to build) your code before pushing it to main.
- AlfeG 5y agoIs there anyone on the planet, that always run all tests locally even for last second minor change that definitely will not break a build? Especially funny for distributed around globe teams. When You spent half a day fixing a build issue from the "night" workers. Have eat a lot of this.
- yupper32 5y ago> Pull requests don't prevent bugs. Is this some anti-vax satire? Of course pull requests (code reviews) reduce bugs. And of course some slip through. It doesn't need to be 100% to be useful.
- Abroszka 5y agoI haven't seen any research that supports either. I wouldn't be surprised to learn that code review does nothing other than share knowledge, or to learn that it reduces bugs by 50%. I just honestly have no idea, I do code reviews, because we do code reviews. In fact I have seen alarmingly little research about code management. Code review, standup, agile, etc. does any of it do anything useful? I only came across anecdotal evidence which can be dismissed.
- buttersbrian 5y agoI think pull requests are synonymous with code-reviews here. I think it is unquestionable that code-reviews catch bugs. Its value as a use of time is another question.
- Abroszka 5y ago> I think it is unquestionable that code-reviews catch bugs. Yes, it does catch some, but does it catch more than no code review? There is no point in catching bugs if it also creates bugs to catch.
- yupper32 5y agoSorry, are you saying that it's possible that code reviews cause more bugs than they solve? That's absurd...
- Abroszka 5y agoWhy would it be absurd? If there is a process to reduce risks, then people take more risks. I have been guilty of submitting code review when I'm not 100% sure it's perfect, just because I know that there is a code review process. So this definitely exists, not sure how common it is though.
- eyelidlessness 5y agoIn my experience, code reviews promote trust. They make changes a collaboration and a conversation, where reviewers and implementor(s) bring different intuitions and concerns, and help expand understanding of risks and goals. Sure, a lot of that can happen before any code is written, but it’s inherently more abstract. Code reviews aren’t just about code, and probably shouldn’t be framed that way.
- integrate-this 5y agoThis is a great way to end up in a situation where you have to re-write entire modules whenever you need to update old code... which is kinda where our teams tend to end up anyway so I guess it's not _that_ awful?
- Puts 5y agoThis can not be posted too many times. https://www.youtube.com/watch?v=4XpnKHJAok8 https://www.youtube.com/watch?v=4XpnKHJAok8 Linus Torvalds talk on Google about how GIT is more a way of working then a piece of software. Everybody commits upwards in a tree of trust. If you do it this way you get automatic code reviews and in any team someone should be responsible for the "product" anyway and highest up in the hierarchy.
- jeffbee 5y agoIt's a great example of how Linus has a massive blind spot for the failings of the git model. He's "sorry" they use Perforce. Git is "better than everything else out there" but he doesn't mention Perforce. And yet, the Perforce model is the one that got Google to be one of the fastest-moving organizations on the planet, with the biggest code base.
- deleted 5y ago[deleted]
- nix0n 5y ago> the Perforce model I've used both Git and SVN enough to understand how a VCS might change how an organization creates code, but I've never used Perforce. What is "the Perforce model"?
- jeffbee 5y agoIn Perforce the concepts are different. You have a client, with a view that includes a subset of the repo, and you have changelists which incorporates your related edits. When done with a changelist, you submit it to trunk, usually, because while you can branch a Perforce repo, you mostly don't need to. Basically all the stuff in the first half of the talk where he whines about stepping on toes, conflicting with other people, politics, special write access groups, are all non-issues that do not sound familiar to Perforce users. If two people are using Perforce they can both work on changes to the same files taken from the main branch (trunk) and submit them separately without conflict or even awareness of the other person. As a bonus this is all dramatically faster in Perforce than in git for large repos. In this talk Linus demonstrates that he believes git is a state-of-the-art SCM system, without being familiar with the actual state of the art.
- jolux 5y ago1. Let's separate the idea of code review from the GitHub Pull Request feature. They are often coupled, but they don't need to be. You could easily have a policy and a workflow that requires reviews, but doesn't care whether they happen before or after a merge. I'm pretty sure this is how things work at Etsy, and I know there to be a diversity of code review practices more broadly in high-performing engineering organizations. 2. Of course code reviews don't catch all bugs. This is the same argument that is frequently used to reject static type systems and memory safety. The purpose of code review is to ensure that more bugs are caught, the kinds of bugs that can be caught through code review. It also helps ensure that a high level of code quality is maintained, and that at least two people understand how a change works, which is good for team cohesion and resilience.
- siva7 5y agoHe basically described the classic subversion workflow using git. I feel like people rediscover subpar approaches using technologies which intended to evolve those approaches into a better workflow
- abstract_put 5y agoI've heard it referred to as "trunk-based development". I think it's not so much subpar as contextual. If there's a team of 2 developers pushing as hard as possible to get something out, I completely agree with OP that code reviews are a waste of time (unless requested). If there's a team of 100 developers, I can't imagine the insanity of pushing directly to the shared branch without review. Somewhere between those the context is such that the benefits of code reviews outweighs the costs. Do you think otherwise?
- geuis 5y agoAbsolutely not. This is a recipe for disaster and a terrible example to set for any upcoming engineers that haven’t had much industry experience yet. Code reviews help me be more confident in my own work. Even if 90% of the time it’s fine, there’s always that 10% where a second pair of eyes catches a mistake or offers a suggestion that makes the code even better.
- mdaniel 5y ago> offers a suggestion that makes the code even better plus, software engineering is a team sport, so if something works but is opaque, that's a fine thing to point out in a review, otherwise one runs the risk of being The "Foo Component" Owner™ and that's usually no fun and is for sure not healthy for any reasonably sized org I am also a monster fan of the "Apply Suggestion" button in GitLab, which allows me to meet the reviewer half-way by even doing the legwork for the suggested change. If they agree, push button and we're back on track. It's suboptimal for any process that requires/encourages signed commits, but damn handy otherwise
- klabb3 5y agoMeh. If 90% of the time it's a mindless ritual there is probably a better way to achieve the same goal. Code reviews are a huge time sink, especially for unimportant style- and naming nits. Code review as mentoring can be great, if it's a directed 1:1 effort. Usually, it is not.
- watwut 5y agoHours long discussion about whether to call it "thing" or "thingId". True story.
- LaserDiscMan 5y agoAs well as a time sink, code review can be detrimental if it's used as a KPI gaming mechanism or for passive aggressive one-upmanship.
- marcinzm 5y ago>Code reviews are a huge time sink, especially for unimportant style- and naming nits. This isn't a problem with code reviews, this is a problem with your team's processes that code review has highlighted. These problems will show up in others ways if not during code reviews since clearly there's strong disagreement on coding styles and conventions. So go and fix or implement the style guides, linters and so on. This is like saying that the way to fix fevers is to get rid of thermometers.
- pearjuice 5y agoCode reviews make sure the other party at least thinks a bit about the code they write. "Someone is going to look at this, let's at least tidy it up or not be cobbled together underperforming spaghetti". Sure, you can trust your co-workers but do you trust them enough that they have that thought every day of the year?
- foxbarrington 5y agoAgreed. It's amazing how code magically gets better when you know someone else will be reading it.
- micromacrofoot 5y agoGood luck getting any sort of security certification without reviews. This works fine for small companies, but once you start getting customers at a certain scale it will be a dealbreaker. Run without reviews as long as you can, it feels great!
- DaveEM 5y agoThis is an interesting read and I'm glad to see that the closing paragraphs emphasize the need for each team to evaluate their own needs. That said, for me it all comes down to the definition of "best product" in this statement: "They all want to build the best product in the shortest time possible" From my perspective, the "product" is not limited to what customers see or the code itself. It's the set of outcomes from the code being written and executed. For example... Do other engineers understand the code? Can they support it efficiently? Does it fail gracefully? What is the impact of failures? Are failures automatically detected? Does it lead to security breaches? Did the code author learn things they could do better that they didn't know to ask about? Did other engineers learn from reading the code or asking questions? Are customer requirements satisfied? How much is customers' trust impacted by failures, bugs, and feature that don't meet requirements? How big is your cloud provider bill? Etc... If the priority is quickly delivering and iterating on features that satisfy customers' needs AND engineers will be supporting their own code, then the "No Code Review by Default" approach has its merits. In fact, I have personally found this approach to work well on constrained, isolated pilot projects where the priority is to unblock key scenarios for a limited set of customers and/or learn about customer needs before building a the "real" solution. For anything else, I would suggest following the author's own advice: "ask yourself if the circumstances of others apply to you".
- alkonaut 5y agoSounds nice but perhaps a best fit if you are 1) a small team 2) people know and trust each other already 3) people are all and equally comfortable asking for reviews (disturbing others, essentially). 4) the code has a priority on feature progress rather than stability and correctness. The situation can be very different in any of those aspects and mandatory review can still be a good idea. Are you building code that runs on surgery equipment together with 4 people you just met? I think you should probably have a formal review process. Or are you iterating towards an MVP for some webapp with a few people you consider friends? Lgtm just deploy to prod.
- brunojppb 5y agoEarly in my career I was like "cool, I can just merge this to master". Now after working in several projects and in several small and large teams, I am like "Gez, I can't merge this straight to master. I need a second pair of eyes on this"
- renewiltord 5y agoMost small tech companies probably operate in this manner. We do, too. The practice is that devs do want a second pair of eyes on the code since they want other people to detect flaws in their assumptions or choices before there is pain. If I'm doing something trivial, I might just push to `master`. For instance, I don't run tests on a `README.md` change. Interesting to encode it explicitly, though. Strong culture choice, for sure. And probably well suited to their product since they are probably all dogfooding `master` and pushing only periodic tags off it.
- Someone1234 5y agoWhen my code has been code reviewed I've had bugs found, improvements made, and edge cases brought up. I genuinely believe my code is better for having been reviewed, and I work harder on the quality of my code because it is going to get reviewed. Now, code reviews aren't a panacea, there's an awful lot of bike-shedding going on (in particular whenever interfaces are reviewed) but they're a net positive in my view. It isn't about trust, it is about creating a quality product, along with postmortems (an under-utilized philosophy) and automated tooling (inc. testing, validators, etc).
- larsrc 5y agoApart from the other reasons for code reviews already mentioned, there's this: an inexperienced developer (in a particular area) may not _know_ when a code review is appropriate. A change that looks innocent may have wider consequences than expected. Code reviews spread knowledge, and knowledge is the true output of software engineering.
- sbeckeriv 5y agoThe only thing I agree with from this "Make your own rules". I feel like it is click bait otherwise. Reading this I would apply for a job here personally.
- bob1029 5y agoThere is a Russian proverb I heard used very early on in my career that has really stuck with me over the years: "Trust, but verify" I think a lot of other commenters nailed the trust equation in more verbose terms. I would add that in some industries or for certain customers, a 2+ person code review rule is mandatory for compliance, regardless of any perceptions around how mundane the changeset might be.
- alexhf 5y agoI wish this talked about the engineering time lost when a bad PR makes it to production. Fixing those may eliminate any time gains from skipping code review. Also, this violates security compliance standards (e.g. SOC2).
- notmyfuture 5y agoFor a small team of capable engineers, working on something that has low consequence for any single change failing plus a strong business motivation to move fast: sure, do without code reviews if you want. There is no universal "best practise" for building software, there is just whatever works best for your context. Practices can, and should change as your business context does. There are some things that are net beneficial for a team in the majority of situations though, I'd consider code reviews one of these things and make that the default.
- revskill 5y agoCode review in real world means peer review, it's the PEER part that matters, not the CODE part. I do think collaboration matters here, not about trust or code. Good software comes from good collaboration.
- simonbarker87 5y agoI can see their point of view but it sounds like they focus on the downsides of code review and not the benefits. Code reviews increases awareness of changes, helps with desiloing, gives junior devs a chance to see how others write code in their own time, reduces chance of mistakes, encourages collaboration. To stop the endless ping ponging back and forth I advocate for Must/Should/Could in all code reviews. So long as everyone gets it, it massively speeds up code review and increases team happiness around the process. https://careerswitchtocoding.com/blog/moscow-the-best-code-review-technique-youre-not-using https://careerswitchtocoding.com/blog/moscow-the-best-code-r...
- jsiaajdsdaa 5y agoMy current company (dinosaur insurance company) has a one developer per service mapping right now and it is absolute HEAVEN on Earth. The best services rise to the top, and the other ones are refactored until they are ready to be consumed.
- system16 5y agoI guess it depends a lot on the company's dev culture or team dynamic. In my current company, our code reviews are essentially a second set of eyes by a peer. When things are "flagged" in code review it's never confrontational. Mainly they provide insight for those who haven't worked on the code base as long as to "why" things are the way they are, and it can open up discussions for improvements (or at least things to ponder for the backlog.) The odd time neat language or platform tricks are also learned. I've worked in other places though where code reviews are done by rockstars or ninjas just looking for a reason to criticize or find fault with another's code so they can stroke their own ego. And if their code is ever questioned, expect a tantrum. Toxic environments like these say more about the company and people there than code reviews though. Looking forward to the follow-up "no QA by default".
- canyonero 5y agoI could see this working well for teams that are engineering led and where customers don't expect a ton from the software. If you're trying to ship fast and get to market quickly, then fine, skip the tests, skip the code review. Once you have lots of engineers shipping many different apps and need to work within and across teams. This system is not going to be fun. When a nasty bug ships and you're responsible, you'll wonder "should I have requested review for that one?" When one of your colleagues ships a few bugs that force you to paged during your on-call. This system is likely to erode trust on both ends. IMO, a no code-reviews model is going to stunt junior engineers career growth as they will not be performing what is common practice on software engineering teams. It's also going to keep out many other stakeholders who may wanna weigh in on the software you're delivering, be it UX, Accessibility, Security, Documentation, Product experts. Pull requests keep others on your team in the loop and educated. I agree that this model gives you the advantage of speed, but I don't think it builds trust. I trust my colleagues and we do pull requests. I don't feel like I'm missing trust because I can't push to `main`. Code reviews have very little to do with trust. They serve as a communication tool and serve a tool to give the best possible experience for customers and provide an opportunity for alignment with our colleagues.
- blank_dan 5y agoIf your code is unimportant then so are your bugs that get into production. So I guess I agree. Don’t waste time writing, testing, reviewing unimportant code.
- PeterWhittaker 5y agoWe're very small (3 full time devs, a mostly full time tester, a part time student, and another student temporarily full time), and the three full timers are pretty seasoned, so this may not apply universally, but.... We don't review code as a matter of course. But if anyone of us writes code that doesn't pass our personal smell test, or that we think it won't pass someone else's smell test, or <insert criteria here>, screens are being shared and ideas tossed about. We almost always <solve the problem we were having|create a better solution|decide to accept the debt and open an issue until we have a better way>, in pretty short order. So it's sort of JIT/OnDemand code reviews. Kinda.
- that_guy_iain 5y ago> Pull requests don't prevent bugs. I remember once I was giving a talk on code review and I said that code review doesn't prevent bugs and people were shaking their heads. Everyone hangs on to this one thing, but if you look at the majority of pull requests that have been approved you'll see a lack of comments about pontential bugs. Also, if you do see a comment about bugs they'll often be disregarded. This drives me up the wall when I've previously pointed out bugs and they've been found to be actual bugs and had to be fixed. I think the biggest problem with code reviews is it often becomes adversarial and people want to come out on top. I've had it more than once that someone has suggested another way of doing something, when I asked what the benefit of that way was or what was the downside of the way I was doing it no answer was forth coming however I was expected to implement their way. This becomes enraging when you point out flaws in their way but they can't find any benefit of their way. As well as, often people just don't want to do the extra work. You point about a bunch of small improvements. It's a pain. You end up with people asking for code style changes even tho there is a code style and the changes they're asking for aren't in those guidelines- In my opinion, code review is a massive waste of time that is often done purely as cargo cult. People know it's a good thing to do but people have no idea how to code review and what is and what is not benefical during code review.
- zzzeek 5y ago> I remember once I was giving a talk on code review and I said that code review doesn't prevent bugs and people were shaking their heads. Everyone hangs on to this one thing, but if you look at the majority of pull requests that have been approved you'll see a lack of comments about pontential bugs. that's because the UX for github PRs sucks. Use Gerrit instead. It's not as pretty but it's super productive. > I think the biggest problem with code reviews is it often becomes adversarial and people want to come out on top. I've had it more than once that someone has suggested another way of doing something, when I asked what the benefit of that way was or what was the downside of the way I was doing it no answer was forth coming however I was expected to implement their way. This becomes enraging when you point out flaws in their way but they can't find any benefit of their way. that's not a problem caused by code review, it's caused by people who don't know how to work with others (or otherwise simply refuse to). to the degree that the code review process shines a light on this, that's good news, because that's a people problem that should be fixed. > As well as, often people just don't want to do the extra work. You point about a bunch of small improvements. It's a pain. when you look at a code review and you see problems in what's there, catching them in the code review is great, because that means less chance of having to fix it later. if you see a code review and nothing's wrong with it, you just approve it. sometimes you can note things as "nits", meaning, fine for now but maybe next time do it this way. > You end up with people asking for code style changes even tho there is a code style and the changes they're asking for aren't in those guidelines- syntactical style and formatting should be automated, if not with tooling that actually rearranges the code in that way (e.g. [black](https://github.com/psf/black https://github.com/psf/black) for Python) then at least including well tuned linter rules. We use black, my own zimports tool for sorting imports, flake8 with four or five plugins as well as "black check", so we spend exactly zero time dealing with anything to do with style or code formatting, including having to even type any of it. if people are fighting over code style then there need to be tools that lock all of that down so there's no disagreements. > People know it's a good thing to do but people have no idea how to code review and what is and what is not benefical during code review. I work on the Openstack project and that is where I learned to do code review with Gerrit, it is completely essential for large projects and is an enormous productivity enhancement. Decades ago before CVS was even invented, the notion of using source control seemed crazy to me. That position was obviously insane, even though we were stuck using Visual Source Safe at the time. That's how it feels to me to be doing a real project today without code review and formatting tooling in place. Like even for myself, if working alone, for a large project with lots of changes I still use a code review tool, just to review myself.
- deleted 5y ago[deleted]
- zzzeek 5y agoso they didn't like github PRs so...they ditched code review altogether? how strange and sad. there's lots of tools that can be used for code reviews that don't have any bearing on whether or not you also use github for source control. We at the SQLAlchemy org actually have Gerrit integrated with Github PRs so you can use both UXes for the same patch at once, and other orgs do this too.
- curious_cat_163 5y agoCode reviews help. However, it is unclear to me if PRs are the best way to do them. I often find a walkthrough on a screen share a lot more helpful to receive/give feedback. It also ends up saving time. The downside of this approach is that it has to be synchronous.
- jyounker 5y agoGitHub's & GitLab's review systems are atrocious.
- tombert 5y agoI think I largely agree with this article. When I worked for Apple, we had a strict "all code needs to be reviewed" policy, which I had no problem with. Then, after being there for about 1.5 years, I make a PR, ask two different people to approve it, which they do, and it gets merged. A week later, the code is released, it looks like my code caused a fairly major bug. My manager's manager and my manager had a meeting with me, and told me that this was unacceptable. I ask "what exactly was I supposed to do differently? Clearly this bug was sneaky enough to where two other people also didn't see it." Their response was "the code needs to work, you wrote the code, the code was sloppy. This is your fault." Apparently they took the bug pretty seriously, since it was actually mentioned in my yearly review. This is fine, I probably should have tested the code a bit better, but it always annoyed me that my "sloppy" code managed to pass code review [1], and yet I'm the only one to get in trouble over it. If the PRs aren't catching bugs and I still am going to get in trouble, then I'm failing to see why I should bother waiting an hour for someone to look through it. Instead, why not make it so we can merge quickly, test it quickly, and revert it if something breaks? [1] Obviously I'm biased here, but I honestly think that in this particular case I was pretty easily the least-liked person on the team, and it was easier to throw me under the bus than anything else.
- igetspam 5y agoYou had shitty management.
- tombert 5y agoNo argument here. I should probably have switched teams, since some of my friends who are still at Apple seem to have had a better experience.
- dsjoerg 5y ago> test it quickly Yes, in your scenario the lack of testing stands out as the major opportunity for improvement. If a bug is so important that it's mentioned in a performance review, then it's important enough that there should be tests that would have caught it. Automated preferably, or manual if necessary. And everyone involved with the software, from you on up and sideways, should be calling for this testing. It's clearly important / worthwhile!
- arnvald 5y agoPrevious discussion (from June 2021): https://news.ycombinator.com/item?id=27606066 https://news.ycombinator.com/item?id=27606066
- przemelek 5y agoI used to love code reviews when I worked for Motorola in 2004, it was doing wonders, we observed showing up "phantom developer" where mix of inputs from different people was causing new look on code. Those were Fagan-like code inspections. A lot of paperwork (we were doing formal reviews on paper, with one person in role of reader), but it was working. This whole paperwork was forcing people to follow rules and it seemed to work (but was sometimes very painful). Latter in other companies I found out that code reviews are in most cases bullshit placeholders, and in many cases are only for making some developers feeling more important, or other devs not loosing contact with code. I saw most stupid things in code moved to position of examples how to write code only because of code reviews... Good code reviews are doing wonders, but as I can see without very strong culture in dev teams and whole company those code reviews don't add anything useful. And this strong culture is difficult. From observations it seems that this is easier to build in team culture to work with "master/main only" without branches and code reviews, than to build culture of code reviews which are working. From my observations most of comments in code reviews are variations on "I would code it in different way", or "why you are doing it in this way/I don't like your variable name" of course usually written in less direct way. Last year problems with Log4J2 showed that even in OpenSource peer reviews don't help. Good developers let to introduce to one of most used libraries something what never should be introduced there. For sure variable names were nice, but somehow whole "why we are adding this" was lost, because devs were looking only for some easy to spot things. So.... yep, good code reviews are important, but my guess is that most of code reviews are only to make some devs happier that they still know what happens in code, and that variables are named in acceptable by them ways....
- atomashpolskiy 5y agoThe problem is not with code reviews but with how adversarial they have become. Instead of making the best attempt to comprehend and embrace the author's style and intention and finding compelling arguments for the question "why this code is probably fine and should be merged as-is?" people nit on all kinds of stuff, mostly highly subjective. Along the way they don't actually catch that many problems or bugs but instead new problems and bugs are introduced while implementing their nits. All surrounded by a lot of noise that has to be dealt with in an already stressful multitasking environment. I agree with other posters in this thread that most people can't code review for crap and have very perverted idea about code review aims and goals. Code reviews as they are practiced now only serve to destroy trust, velocity and team morale. As someone noted elsewhere in this thread, if it's me (directly or indirectly) who's going to be held accountable for a deficiency in my code, whether it has been reviewed or not, why do I have to adjust my code to someone's arbitrary criticism? Common sense tells me that not requiring to have my code reviewed at all times and, by doing so, stressing my personal responsibility for the things I do, would actually increase my sense of ownership and keep me on my toes, more likely leading to better coded/tested changes, wouldn't it? I.e. it is not about blindly trusting all code that I produce but rather trusting in my ability to judge and make final decisions: to request code reviews or not, to address comments or not, to do my job as I see fit or not.
- RegW 5y ago> The problem is not with code reviews but with how ... they have become. Perhaps "banal" is the word you are meant to use. There's a saying about that a 10 line PR will get 10 comments, but a 1000 line PR will get a "looks good!". Of course this is not really what is happening. A 10 line PR can be completely unintelligible and a 1000 line PR might be a joy to read. Once the code base has become a ball of mud, no one really bothers to review anything properly - it's going to take as long as writing it yourself. So perhaps, we get picky about some worn out code style point (incorrect indent etc) just to show we are alive.
- theonething 5y ago> Once the code base has become a ball of mud, no one really bothers to review anything properly This is the standard code review experience I've had across companies I've worked at. It's just theatre, bad and irritating theatre.
- windows2020 5y agoI've seen a number of flavors of code reviews in practice: * Superficial - Omission of optional lagging comma * Valid in context - Quadratic logic on small finite set * Ensure intention - Task not completed/completed with adverse effects Each takes progressively more effort, skill and context knowledge. There's a constant battle between resiliency and efficiency. There also tends to be a gradient of skill involved. Context is king when it comes to an opinion on this.
- 0xbadcafebee 5y ago> we trigger an internal release every night [...] This allows us to test new changes within 24 hours [...] This workflow helps us to consistently ship updates every other week. If instead of testing 1x a day, you tested 3x a day, you'd debug 3x faster, meaning you could ship 3x faster. Now imagine testing 100x a day. Every merge to main should test immediately and ship immediately. That's how you build trust, speed, and quality. Your developers should be going, "fuck. I'm not merging this piece of shit yet and breaking production. I need more tests." Some people will say that waiting until you have enough tests is crazy because it's not fast enough. But the only way to get fast is to have trust, and the only way to have trust is more quality. More quality means less bugs, which means less cost and delays, which means shipping faster, cheaper. Go slow to go fast, shift left. Tests are better than code reviews. With a code review, you're only reviewing one change at one point in time. 300 commits later, you're not reviewing how the 1st commit is affected by the 301st commit. But a test around the 1st commit is verifying against the 301st commit. Tests are the eyeballs that never stop looking.
- azov 5y agoComing up next: “We don’t use source control. Git just slows us down. Our engineers don't want to spend time writing commit messages when they can be writing features instead. We keep all our code in a shared folder and we trust our team members to not mess it up!” Well, this can be done. Lots of software was written before code reviews or source control existed. But I’m not longing for that time.
- mslate 5y agoEarly Facebook is one notable example.
- deleted 5y ago[deleted]
- codeptualize 5y agoGood CR's are great, bad CR's are an incredible waste of time and you might as well not do them at all. We had a similar system where you trust people to know when you can skip the CR, worked great. We also ranked CR comments on importance, focussed on preventing issues, and avoid subjective discussions as much as possible. It meant CR's were mostly about bug catching, sometimes constructive conversations weighing pro's and cons, and other times making suggestions that may or may not be applied. It's so much nicer than a dogmatic nitpicking CR culture that completely forgets about what's valuable and not. Maybe it's my relative small sample size but I feel they always go together.
- mkl95 5y agoCode reviews where some coworker looks at the changes, types "LGTM", and proceeds to approve it do next to nothing to prevent bugs and bad decisions. Code reviews where some coworker runs the code on their machine and has plenty of time and power to express the ways it could break or it could be improved are useful. When the former review happens more often than the latter, if often has to do with soft skills rather than hard skills. Some requirements for a good review are honesty, mutual respect, and ability to handle criticism. Other than that, some engineers struggle to understand there may be more than one good approach to a problem. Ultimately, engineers are not entirely to blame for bad reviews. In my experience it is often a company culture issue. Authoritarian leadership trickles down to middle management, senior engineers, etc. If people don't feel empowered to challenge others code regardless of their seniority or perceived status, weird or downright bad technical decisions will be made.
- ryanbrunner 5y agoI don't trust myself to never, ever introduce a bug. I'd rather that my teammates look it over, because they may have more context on certain areas of the system than I do, or even can just a typo. I trust my teammates, but if "trust" means "assume they are perfect developers with perfect knowledge of every part of the system who will never make a mistake", sure I don't trust them I guess.
- lazyant 5y agoAccording to LinkedIn, this company has 12 employees. Once they hit like 20 - 50 engineers and some decide to write code "their way" and some leave, it's going to be a mess to be onboarded there and make sense of code you haven't written yourself.
- abstract_put 5y agoI completely agree. I have worked at a company that had exactly this trajectory. It's also not just the number of employees, but also the age of the code and the number of micro-pivots that nobody bothered actually refactoring through the code. Specifically the company went: - All senior developers who had a strong sense of the actual product and what they're trying to do -> no pull requests, everybody happy - An awkward middle area where eventually they had tripled in size and code quality was haemorrhaging customers and paralyzing attempts to release -> "what do we change?", nobody happy - Another doubling in size, giant organizational change -> PRs are mandatory, people aren't happy but any attempts to reduce PR burden has almost a straight line to bugs in production
- likelyharrison 5y ago
- LenP 5y agoInteresting read, and it may be working well for Raycast, but it didn’t resonate with me. The main drawback of code reviews, as they correctly note, is a lack of velocity due to engineers looking at code review as a “not my real work” thing. That’s a cultural issue in my opinion. At my current startup, we are trying something different: the code reviewer fetches the feature branch and writes tests for the change as part of the review. As ridiculous as that sounds, it’s been working better than we’d imagined. First, it’s really forced us to design modular and testable APIs. Separation of concerns at the file or library level gives a false sense of good, modular, reusable design. However, having an engineer write a test for your implementation (essentially a second client to consume your interface) really puts this to the test (!). The quality of feedback emerging from this process is often much richer than what a “skim the diff” code review offers. Additionally, writing the test suite is an “unavoidable” task for engineers. This works two-fold: firstly, we don’t put it off as an “end of the day” item as with traditional code reviews on which you can spend as much or as little time as you have (it’s a ‘compressible’ task, unlike writing tests). Secondly, people send smaller, focused, easy-to-test PRs as a courtesy to the reviewer - and perhaps in part due to what we call MARBs... mutually-assured review-bombs :)
- wreath 5y ago> At my current startup, we are trying something different: the code reviewer fetches the feature branch and writes tests for the change as part of the review. As ridiculous as that sounds, it’s been working better than we’d imagined. How is this different from the "traditional" QA-writing-tests-for-devs process?
- LenP 5y agoQA writing unit tests for devs is not “traditional” - it’s a signal to leave the place ASAP. As an engineer, you’re expected to write, review, and test code. We simply shuffle responsibilities such that you usually test other engineers’ code and not your own (there is some discretion involved - for very small changes we often write or tweak the test ourselves)
- 5y ago
- etchalon 5y agoThe only time I make anyone on my team submit a code review is if they're a junior developer, and we're actively trying to make them a better developer. Otherwise, my experience with code reviews has been that it's one developer telling another developer how they'd approach the problem, or their preferred style, or some such nonsense, with the originally submitted code good enough to get the job done. Everything else this author says rings true to me when code reviews are a universal practice. They slow everything down, and only occasionally is that slow down worth it.
- efxhoy 5y agoThere is obviously a tradeoff here with the optimal amount of code review that varies with impact and difficulty. Dogmatically doing and waiting for an in depth review on a tiny and likely insignificant change is silly. Blindly pushing big db migrations is also silly.
- SkyPuncher 5y agoI feel like this article is written with a bunch of false dichotomies. You can still have code reviews and still have trust. We're required to do code reviews for SOC II compliance. Even if we werent, I'd likely still encourage my team to do them. I trust everyone on our team. They're all extremely talented and competent. They could all ship things to prod everyday without a peer code review and I doubt we'd notice any difference in quality. The reality is code reviews serve way more than making big brother happy. They help to avoid silos. They help to gain perspective. They help people mentor and grow. They help the team build a collective understanding of how to work effectively.
- lxe 5y agoCode reviews are kinda forced if regulatory compliance is necessary.
- bhawks 5y agoTwo things I love about code reviews is the whole team has a general awareness of the changes happening in the code base. The other thing is how as the team grows/changes cultural norms ranging from testing, style, interface design and so on gets established, normalized and strengthened. Having worked in places where there were no code reviews the software development culture was all over the place. I wouldn't go back.
- adam_arthur 5y agoThere are other ways to solve the problems the author calls out. Reviews being slow can be largely solved with review SLAs/automation to ping reviewers. Code review themselves can be quite fast if you know the code author well. Some people you can trust to make high quality changes and the review covers more high level/directional questions. Others are more junior/haven't built the trust yet and require more scrutiny. But having done a large number of reviews, it really doesn't take long to do even an in-depth review, if you're already familiar with the area of the code in question. The goal of a review is not to test the code for the code author, or to identify bugs for them... which is where things could really slow down. I used to do 10 or so reviews a day and it would take an hour or so to get through them, while still writing a lot of commentary on them, where applicable... not a rubber stamp. I know the author mentions not wanting there to be a lack of trust, but its pretty evident they'll realize the need to build trust first as they scale. There is also an aspect of the code author writing code to a higher standard when they know it will have to go through another set of eyes before being merged. The best people can set this standard for themselves regardless, but it's unlikely that you could run an org at scale on this premise without a drop in code quality. It is an interesting idea to try to run a company only hiring people that have the skills/attitude to be implicitly trusted. I think this approach is very feasible at a small scale if you can maintain very high hiring standards and are able to nab mostly 10x style engineers. These people will make mistakes, but will recognize them and self correct. Then you could just have people contributing under a guiding set of principles/standards, and "retroactive" review to ensure standards being followed. But almost certainly impossible to hire at this quality/bar at scale. Having said all that, I did work in a startup where in the early days certain people had write access and pushed directly. It mostly worked well at that small scale, but lots of technical debt developed in certain areas of the product that took years of effort to reverse/fix.
- keithnz 5y agoI feel their "responsibility" and "trust" argument is maybe a little oversold here, but their final paragraph is right on the money. I would argue a better title is "No rules/process by default". Which doesn't mean you go wild, having a strategy to develop software is very important, but strategies need to be customized. It means you apply just enough and constantly adapt so you have just enough of whatever you need to make sure development works smoothly. People will say PRs improve communication, can help prevent problems, help understand what changes are going into the code base etc, but all of those things can be done in many different ways, and depending on the group of people, there can be more effective ways of achieving that. So adopt what you need ( which may be PRs, or some variation ). But whatever you do, don't go overboard with justification. The dangers with overselling and defending your justification for doing or not doing something can be a problem. It also can mean you don't adapt quickly to change. By overly emphasizing your approach being about "responsibility" and "trust" you kind of make out that PRs are about a lack of trust and responsibility, which is incorrect and may prevent you from adapting because you have misattributed a quality to a practice/process. This often happens when people go from A (problematic) -> B ( much better). They attribute too much weight to what makes B better than A when they may need to change those things to go to C (even better). In my 40 odd years of observing software development, this is really common, especially for many devs with around 5-10 years experience (including myself). You find much better ways of doing things, and you start becoming advocates for those things. In reality, you always need to be adapting and questioning and always deconstructing and reconstructing your strategies about how to do software.
- honkycat 5y agoCode reviews are a great opportunity to mentor newer developers as well.
- zarzavat 5y agoThis comes under "do things that don't scale". If you have 100 developers is this an efficient way to work? Absolutely not. If you have <10 is it an efficient way to work? Yes, it can be. Replace the formal process of code reviews with an informal process of reviewing new commits. Encourage everyone to regularly read the code and not silo themselves away.
- sinaa 5y agoThe core value of code reviews is knowledge transfer and increased harmony across the codebase. You certainly don't want to work in a codebase riddled with different ways of doing the same thing. Code reviews help with making the patterns more structured and more widely adopted. It also helps everyone at all skill levels to learn something from their peers, through reading their code and sharing thoughts. It also makes more people in the team familiar with the codebase, such that more people are capable of changing and improving the related parts rather than just the original author. The potential benefit of finding defects is only a nice to have!
- codeapprove 5y agoIf you view code reviews as expressing a lack of trust, you're probably doing them wrong. Code reviews should be a conversation among people who trust each other. You're saying "hey I'd like to know your thoughts about this, and I'd also like you to learn a bit about what I am doing" When done right code reviews spread knowledge and build trust among team members. Of course there are certainly situations which call for a push without a code review, but those should be exceptions not the rule. While a lot of the issues around code review are cultural, I also think there's a lack of good tooling. That's why I'm building CodeApprove which makes reviewing code on GitHub faster and more enjoyable: https://codeapprove.com/ https://codeapprove.com/
- jkingsbery 5y ago> They can request a review if they want somebody else to take another look at their code. This can work sometimes and with some groups of engineers, but the engineers I worked with in my career who most needed this (1) would never ask for another set of eyes and (2) were the exact type of person who think a code review equals "people don't trust me." When I started at my current large tech company as a senior software engineer, I learned a ton from having "more junior" engineers review my code. I also learned a ton from reviewing other people's code. Even now that I have the fancy title of Principal Software Engineer, if I want to make a change to our team's code, I need two ship-its from my teammates, same as everyone else. It's not about "not being trusted," it's about earning trust of others by not pretending your poop doesn't smell. > Code reviews aren't high priority for engineers. Well there's your problem. On teams I've been on that do code reviews well, code reviews are considered a high priority. When code reviews are given high priority, and when engineers take the time to plan their work so that changes are small enough to understand, code reviews really don't take that long and are not a blocker to productivity. > It's up to you and your colleagues to set the rules for your team. Don't adopt best practices in a dogmatic fashion. Rather, ask yourself if the circumstances of others apply to you. This is true - companies shouldn't blindly copy practices from other companies. I have been a part of teams before that didn't have required code reviews and were still effective, but this required a unique set of circumstances in which all engineers were pretty senior, and so we were doing a lot of owning features end-to-end. It is fun to be part of a team like that, but it doesn't scale very well. What this article also doesn't address is that reviewing code is its own skill, and many engineers are not naturally good at it. Just as it is bad to blindly copy other companies, it's also not great to blindly equate "we're not good at a thing" with "this thing isn't useful."
- da39a3ee 5y ago> PRs are an afterthought and not what you want to spend your time on as an engineer. Couldn't disagree more, and don't even understand where it's coming from. When you've dome a substantial body of work, it certainly makes sense -- and is satisfying, and enjoyable -- to explain what it is and how it works and present it to people. And it makes sense for those reviewers, given that they work on the same codebase, to learn about the code change. I get the impression that the authors of TFA maybe just aren't writing any interesting code.
- autarch 5y agoI think the word "trust" is covering a lot of ground in this piece and the discussion here. There are a lot of different things we may or may not trust about our colleagues and ourselves. Here's how I think about it: * I trust my colleagues and myself to do good work to the best of their ability. * I trust my colleagues and myself to care about the quality of their code. * I trust my colleagues and myself to follow coding standards. * I trust my colleagues and myself to write tests and to do manual testing when needed. * I trust my colleagues and myself to pay attention to CI and code quality tool output and to act appropriately on that output. * I _do not trust_ my colleagues or myself to do perfectly bug-free work all the time. * I _do not trust_ my colleagues or myself to be able to model the entire system we are working on in their heads. * I _do not trust_ my colleagues or myself to always come up with a complete set of tests, including all corner cases and paths through the code. * And finally, I _do_ trust my colleagues and myself to be human, which means we are not perfect, we get tired, we get distracted, we forget things, and we make mistakes. But I _also_ trust my colleagues and myself to try to help each other avoid problems in the face of this imperfection, and one of the best ways to do this is with code review.
- ec109685 5y agoI wonder how much refactoring is _not_ done because of the need for a code review. In the era before code reviews, I used to go to town on my codebase when I saw something I wanted to fix. Are folks more hesitant to make such changes now because they are afraid of the burden on the code reviewer?
- justrudd 5y agoNot really. But if I start doing a major refactoring while working on a new feature, I’ll generally cut a new branch, move the refactoring over to it, and do a PR of just the refactoring. That makes it easier for the reviewer to only have to look for degradation of current functionality. While the refactoring is being reviewed, I’ll then usually start working on the new functionality on top of that branch. It can get a little unwieldy if I’ve got a lot of refactoring going on which I currently do. I inherited a codebase that never said no to any “hey. That’s a neat blog post. Let’s try that way for this feature”.
- deleted 5y ago[deleted]
- touchpadder 5y agoThis may work in a small colocated team where everyone is experienced/smart cofounder and knows the codebase by heart but in a larger team where new devs keep joining it would be a total disaster. Undoing errors that were pushed to master is a bigger waste of time than doing reviews. If all developers are good the reviews usually take a minute and only a quick scan for anything alarming. In my private projects when going again over my code in i.e. Source Tree I'm tempted to stage stuff that is messy with many comments and should be rewritten hoping I'll come back to this another day. The temptation is too big when there's no one looking. The fact someone will be reading your code encourages a proper cleanup before creating a PR.
- jayd16 5y agoI don't think every single commit needs to be reviewed, especially early on in a dev cycle especially if there is no production environment to even screw up yet. In that sense, I think they should be optional. Code moving to prod gets reviewed though.
- CivBase 5y ago> Pull requests discourage trust. Good. You shouldn't trust my code until it's been reviewed. I don't even trust my own code until its been reviewed! I've gotten much better with time specifically because of the things I've learned from reviews, but having another pair of eyes on my code still frequently uncovers things I overlooked while in the weeds. > Pull requests don't prevent bugs. This is just wrong. It doesn't prevent all bugs, but nothing does. Reviews, testing, static analysis, requirements, proofs - they're all designed to improve confidence in software. They all work to varying degrees, but none of them are perfect. > Pull requests slow down. Good. This is a feature. If a change is big enough that it takes significant time for another qualified engineer to review, there's a high chance that an issue will be uncovered. At the very least, it ensures another engineer is familiar with the changes. If reviews drag on because engineers don't treat them as high priority, then that's a culture problem - not a problem with reviews.
- dboreham 5y agoI think the underlying problem with this debate is a widespread failure to understand the purpose and practicality of reviews. Actually I see this pattern repeated with many other practices in our field : tests for example. It's a kind of mass delusion, imho. Yes having human #2 look at whatever code human #1 wrote with the goal of improving it and catching errors, is in the abstract a good idea. But _requiring_ all code to be reviewed before merge to main, while allocating no real resources to that activity, while also expecting high velocity of development, is magical thinking. It typically leads to "software engineering theater". Code reviews look to be happening, but for the most part they're not. And worse: some things don't get fixed because the participants see review as an obstacle unworthy of their energy to surmount. Some great features don't get developed because the engineer with some spare creativity perceives that their weekend efforts may be for naught due to ensnarement in review webs. I think the author is on the right track by at least refusing to enter into the delusion, and rejecting the magical thinking.
- the_arun 5y agoOP is mentioning their side of the story for what they did. I feel people are going overboard with their emotions. Few points As OP says, team members could ask for review if they do not have confidence in what they are changing. But code reviews usually makes everyone wiser - domain context, design thinking etc., So we need to find other channels to ensure that. Few Questions: 1. Do we have data on how many bugs do we fix at review stage? 2. How many times we blindly approve based on our "trust" with our colleagues? Biases definitely play a major role in reviews. 3. What happens if one engineer quits with others not having any context? So we cannot say Code Review is not needed for every team. It may work for some. 4. How many PRs we merge using our admin rights without getting any peer review (because of delays or getting attention from our peers)?
- voidfunc 5y ago
- kgeist 5y agoIt probably makes sense when all the developers are experienced seniors with deep knowledge of the codebase, but often it's not the case. I don't think it scales beyond a small team of senior founders who only start making their first MVP. According to Crunchbase, they were founded 2 years ago and have below 10 employees. At our company, code reviews help: 1) onboard new devs and teach them about the codebase, catch silly rookie mistakes early on 2) code reviews encourage to write readable code, what I write is readable to me, but can be incomperehensible to others, and code reviews help figure it out 3) seniors make mistakes, too, and it's nice to have another line of defense (some mistakes can be ticking bombs and not catchable in testing immediately) In my opinion, as a developer, you shouldn't even trust yourself, let alone others, to deliver good product (especially if it's mission-critical software with a large userbase), because errare humanum est.
- fjfaase 5y agoThe article is not saying that no code reviews are done, but that it is not manditory. For on boarding code reviews are useful, but you could also do some pair programming or work together on the code.
- kgeist 5y agoWe have not only code reviews, but also mandatory architecture reviews. Everyone dumping random code to main doesn't scale in the long term without a coherent architectural/technical vision. Without it, it's very likely to end in a Big Ball of Mud. We started that way too - faster iterations, little design, and it did help us gain some foothold, but after a few years it became unmanageable and hard to extend/mantain. It's been 3 years since we started untangling our legacy system built that way and our growth is still impeded by it. Context matters: their approach works OK if you're only starting out, but at some point you're going to rethink your processes. Many (most?) companies start that way, foregoing code reviews, even tests and proper QA, to release earlier; but eventually you start to appreciate them as your product matures. It's important to not miss the moment when your codebase becomes large/complex enough that you need to rethink your processes.
- bawolff 5y agoI think code review is like any other quality control: they come at a cost, but its worth it if implemented well. If the culture around code review is bad then its utter hell.
- loosescrews 5y agoIf you find code reviews are significantly slowing down your process, the problem might be your code review tool. My employer switched from Github to Gerrit and I have for the most part stopped feeling like code reviews are slowing me down. I just keep stacking my changes and the reviewers can get to them when they have time. This also allows me to review others' changes when I have time and not feel like I need to drop everything in order to unblock people.
- donatj 5y agoThis is a remarkably frustrating read. Of the value we get from code review, catching bugs is one of the smallest. Things we catch include - Duplicating functionality we have elsewhere. - Duplicating business logic we are elsewhere. - Recommending cleaner abstractions, particularly with younger devs. - Query optimization - The time for your DBA/data developer to review things is well before they are a problem. Developers with this focus on “speed” in my experience tend to build a lot of throwaway code.
- wreath 5y ago> - Duplicating functionality we have elsewhere. - Duplicating business logic we are elsewhere. This is especially important when you have people otherwise working in silos, which seems to be the case for Raycast.
- ram_rar 5y agoThis works great when team size is tiny and everyone is an experienced engineer. I grew my team from just 2->8. Without a robust CI/CD pipeline and establishing code review practices we would have been breaking prod every other day. I agree with author that trust is proportional to velocity. But it takes sometime to build that trust. Writing code reviews is skill that engineers need to acquire. A lot of that is emotional quotient than IQ. Code reviews should give context to the PR owner that {s}he doesn't have by just going through the code. Let the review bots and other integration tests take care of breakage etc. I check PR stats for my teams repo and track mean time of PR approval and few merge time metrics. This is just to make sure, that there is no back and forth happening during reviews and median time to merge PR is relatively constant. One can leverage these metrics to know which team member is being a douchebag.
- spamizbad 5y agoThis is written by a company that recently raised a series A[1], so I'm not surprised they're willing to optimize for velocity at all costs. It's not the worst trade-off you can make at that stage, but it's a trade-off only worth making early on. And I would argue trust (or lack thereof) shouldn't be a factor in code reviews. Most of the value of code reviews comes into play when working on more mature systems that sit on top of a stable foundation. And the benefits of those reviews are significant: they help socialize the codebase (I'm using socialize rather than "understand" because I don't think you can get a complete picture of it by doing them, but you can lay down a mental foundation from them) to the team, they let you share techniques and information on how to best utilize a given tech stack, catch missing test cases, identify faulty assumptions, and help Jr/Associate level engineers to be stronger contributors. I've also seen them used successfully as glorified whiteboards/sketchpads to share and develop ideas between engineers. To extract this value out of code reviews, there are a three key things that must be done. First, automate as much dumb bikeshedding as you can: have precommit hooks for code formatting, linting, type checking, dependency validation, test coverage etc. Tools already exist for most languages to do this, so you're not stuck having to write your own. A few dozen lines of YAML eliminates hundreds of hours of worthless debates and churn. Nobody should waste time commenting about this stuff. Second, avoid "large" PRs. Don't get too caught up in change sizes, but think more about "How many major components will people actually need to review?" Sometimes a 2000-line changeset has 1500 lines you just skim and 500 lines of real stuff you have to pay attention to. Third, you need to give some context in the PR message. Link out to relevant things, explain what you doing, and even call stuff out you want people to see "Please draw your attention to FooBar in baz.py - I'm a little unsure this handles all situations" Code reviews often get wedged into SDLCs because someone broke something in prod and people concluded "code reviews would've prevented this!" -- I personally think this is the wrong mentality. You should instead see them as a way to improve the quality of the codebase and your team's skills and knowledge. Rather than trying to "catch" a catastrophic production bug, focus instead on reducing the number of catastrophic bugs that get created in the first place - via better tests, better shared understanding, and sharper skills. [1] https://techcrunch.com/2021/11/30/developer-productivity-tools-startup-raycast-raises-15m-from-accel-and-coatue/ https://techcrunch.com/2021/11/30/developer-productivity-too...
- rmk 5y agoThis was the way most software was built. In the past decade, there has been a heavy reliance on code reviews, perhaps because of the rise of dynamic languages where it helps to have test coverage and eyeballs on the code to get close to the help that a compiler provides. Is the software of this decade much better quality-wise than the stuff built without resorting to extensive code reviews? I doubt it somehow. Code review has become a way to design by committee: if every team member gets to critique one aspect or another on every code review, most design paradigms will fail to make it through the gauntlet of the ad-hoc design process the code review entails. Code review has also become a way to micromanage individual contributors without explicit effort from the engineering manager or similar authority figure. It can now be administered by your colleagues who can now revel in the power that it gives them over you. Finally, code review is the ultimate busy-work that caters to the conceit of today's software developers: that they are craftsmen who produce bespoke objects of art and beauty. After all, if each piece of code is so thoughtfully critiqued and subjected to such scrutiny, it must be exquisite indeed! Oftentimes the reality is that the team comprises a half-dozen overqualified people polishing a turd that exists to squeeze both sides by creating a cozy monopoly or an oligopoly in a two-sided market. But that is too embarrassing to admit, and it certainly doesn't bode well for pulling in obscene amounts of funding and prestige!
- wreath 5y agoThe article mentions fast user feedback and dogfooding as alternative ways to get feedback to code reviews. I think these are two different things, user feedback and dogfooding are great ways to know if you built the right thing or you built an intuitive solution but they have nothing to do with the underlying engineering of the solution. I much prefer (software) design reviews, they make code reviews a sort of a sanity check to see if the design was followed (reasonably), we're testing the right thing, and maybe there were some business rules that weren't followed because they weren't obvious in the design process. This is especially important when you have a lot of engineers in the team/organization. Clicking around in Raycast's jobs page, I get the impression they prefer ICs to work individually and ship things on their own with little to no collaboration, so no code reviews seems to be aligned with their values.
- deleted 5y ago[deleted]
- maxehmookau 5y ago> Code reviews aren't high priority for engineers. This a far bigger issue for me than a lack of trust. Code reviews should be a high priority for your engineers, especially the senior ones.
- lwhi 5y ago> "Every company or team is different, but one thing is the same: They all want to build the best product in the shortest time possible." Maybe this is part of the problem? Why do we need to build so incredibly quickly? Is this the only way?
- fiala__ 5y agoIt's definitely part of the problem and a big reason why software engineering is in the state it's in. To me it always seemed almost like a religion. I wish we took more from the stereotype of traditional engineering, where standards, thorough testing and reliability trump satisfying some trust fund kid founder's impatient demands.
- hsn915 5y agoI seem to be one of the minority of people for whome this post has resonated well. In my experience, code reviews are awful in the same way that micromanagement is awful. It's based on a lack of trust, first and foremost. It's also insulting. What's more insulting is being forced to deal with unreasonable review comments. More than once, I had the experience of spending several days working on a feature, only to be blocked by some unreasonable "team member" who has weird fetishes about spacing and variable names and such fluff. It's really frustrating and insulting. What's more, it doesn't really contribute anything to actual code or product quality. The overwhelming sentiment I see on comments supporting the mandating of code reviews on every single commit seems to be based on the idea that everyone is a junior who makes obvious mistakes that are easy to catch by just having someone else take a look at the code. I suppose this should not be very surprising. I've noticed in the last few years more and more companies prefer to hire beginners (since they are cheap), and there's a huge wave of people who are learning programming to improve their careers and their lives -- which is a good thing for these people -- but it means a lot of teams are full of newbies. So it makes sense in this context to install a lot of "guard rails". What I don't understand is why everyone thinks mandating code reviews is a good idea in the general case.
- Emigre_ 5y agoCode reviews are great, they prevent silos. It gives other teammates the chance of looking at your code, and understand what it does. It’s a knowledge-spreading tool, apart from their bug-catching aspect.
- nikolay 5y agoWell, you don't have this luxury if you're SOC-2 compliant - code reviews are mandatory.
- cryptonector 5y ago> Side note: We use rebase instead of merge to keep a much cleaner project history and eliminate unnecessary merge commits. Yes!
- cfer43432t 5y agoThe biggest mis-conception about code reviews that it is for catching mistakes and improve quality. Well, you know what improves quality? QUALITY ASSURANCE. If you never heard about it, THAT is the issue, and your group/section/company should really educate itself if this is a new concept. Also code review as a communication tool? Maybe yes, but again there are better tools for the job.