Live data from Hacker News

The primary purpose of code review is to find code that will be hard to maintain

mathstodon.xyz

191–193 of 193 posts

Re: The primary purpose of code review is to find code that will be hard to maintain

#191
post #38

Earlier quoted context omitted.

Personally, I would tell you that whatever understanding you gain may still have bugs. Unless your understanding is as complete as a formal treatment of the code, then there may still be bugs in the code due to shared misunderstandings between author and reviewer. The biggest one is both having an incomplete understanding of what a library function does. So while there may be some overlap, particularly if each person…

If, by your definition of understanding, you can understand something without knowing how it works, then what would be the point in understanding it? Your argument underscores the fact that understanding exists on a spectrum and that deep understanding can be difficult, or even impossible to achieve. Even formal verification seeks to verify certain properties of a system, and doesn't represent anything close to compr…

You’re confusing the difference between understanding and comprehending. The former is partial but useful within a context, the latter is total and is the result of mastery. One may understand an abstracted interface and how it works from the perspective of what it does in relation to solving a domain problem, but that doesn’t require them to know how it works at the level of any function/procedure’s mechanism.

While it may be true that formal verification doesn’t yield comprehensive understanding of code in certain forms, in a way it does by ensuring the code is only able to perform up to isomorphism with what the domain requires. Further understanding of how it accomplishes that is meaningless due to abstraction. But there are a number of techniques of formal methods that do require comprehensive understanding to be taken as valid, such as the structured proofs Dijkstra was famous for promoting. Also the classic example of Temporal Logic specs don’t compose, so the specifier must design the spec from scratch basically every time. Even using Hoare logic would require one to verify every line and all functions that are called for the purpose of solving a particular problem because of the difficulty of formally describing a function’s behavior in total.

So while I understand where you’re coming from, I do think that for any meaningful understanding regarding code, formal verification will provide it to the verifier. That is, as much as may reasonably be understood from the code is learned during any formal verification process.

Re: The primary purpose of code review is to find code that will be hard to maintain

#192
post #91

Earlier quoted context omitted.

Thank you! I find it somewhat ignorant to say, most people do not understand the reason behind a peer review, while obviously being missinformed. To even believe that it only serves a single purpose somewhat tells me, that the author is missing experiences with other teams / people.

> To even believe that it only serves a single purpose There are a lot of people who incepted the word "single" into this post in order to have something worthless to argue about. Even with "primary" as the second word of the headline.

You are right. Let me rephrase and my argument still stands: „To even believe there is a primary purpose…“

Re: The primary purpose of code review is to find code that will be hard to maintain

#193

I work with someone who tends to rejects PR suggestions. I also work with someone else who accepts suggestions. I think that the for the person who accepts suggestions, it's made me wonder if they accept them in part to share ownership with me. I feel like we both maintain and understand the code, and are on the same page. For the person who rejects PR suggestions, it makes me less inclined to participate in those PR…

[flagged]
Post reply on HN