4 ms·
I think it's more that bad programmers focus on surface details like code style. All too often I've seen a code review of a complex feature get derailed by nitp
by ludocode 6y ago
I think it's more that bad programmers focus on surface details like code style. All too often I've seen a code review of a complex feature get derailed by nitpicking of inconsequential things like variable names, formatting, etc.
I rarely comment on code style for this reason. I want the review to focus on functionality, not style. I don't really believe the notion "imperfect code style is a code smell" anyway.
- nkuttler 6y ago> I don't really believe the notion "imperfect code style is a code smell" anyway. Blaming developers for something that can be automated? Yeah, something is off here, though not necessarily the review. > nitpicking of inconsequential things like variable names To me it sounds like a good thing when there's nothing else to comment on. Making code more readable is a win for everybody.
- ZephyrBlu 6y agoI have a contrary view on code style. If there's no semblance of consistency to the code you write, how can you possibly formulate a consistent and sensible architecture? The style itself is inconsequential, but no consistent style is a red flag to me.
- abernard1 6y ago> how can you possibly formulate a consistent and sensible architecture? Similar arguments could be made about actual architecture: "If you can't have well-designed and consistent houses, how can you possibly have a well-designed city?" The best architectures I've seen, by far, had the worst code. Code is not a systemic level issue. The way the pieces fit together is. A sad fact of good architectures is they actually enable bad code to exist without severe consequences, because that badness is localized.
- quacker 6y agoYes. For example, a distributed system composed of various microservices, where the microservices can use different code styles, different programming languages, be maintained by different teams, etc.
- deleted 6y ago[deleted]
- redisman 6y agoVariable names are the nouns of programming though. It’s not really related but I think having an “editor” try to read your text and give you improvement ideas is not “shallow”. The code is there for programmers to read and reason about so optimizing for “easy to load into your brain” code is important too. let c = ... versus let customer_address = ... can save a lot of sanity throughout the years
- Ar-Curunir 6y agouseful variable names are absolutely a win though
- Phelinofist 6y agoI check both when doing reviews. Style and "cleanliness" of the code is important as other people are also expected to work with it. Also I follow the saying that code is more often read than (re)written, so that should not be neglected. Structure of the code, as in relationship of classes, data flow and high level design is also important and checked during review.
- roguas 6y agoVariable names are the only thing that can reasonably guide you in time of need. Thinking that variable names are not all that important is not a good take.