Ask HN: What tone to use in code review suggestions?
Review: a formal assessment or examination of something with the possibility or intention of instituting change if necessary.<p>None of your examples provide feedback as to why you want a change. That may be why you have been led to ask this question.<p>Consider:<p>* There is a potential overflow in this code. The library function xyz already does this and can log when the app is in debugging mode.<p>* This portion duplicates the same set of processes as over there. Refactor these into a single function, and we&#x27;ll be good to go.<p>* While I don&#x27;t have feedback yet on this function, it&#x27;s too long for me to follow. It would be easier to read and for future maintenance if you refactor this part into a function.<p>* Since we&#x27;re in closedown we can only take certain types of changes. If you refactor this into a separate function in the library, this change can be accepted.<p>* Or, I hate to be the process person, but the internal guidelines for this team call for all code to be structured the same way. Refactor this part into a separate function and I&#x27;ll approve the PR.<p>There are lots of ways to provide feedback. I suggest stating the problem with the code and providing a solution. If that&#x27;s the only possible solution to get past your review, state and don&#x27;t ask. You can also give a carrot with &quot;do this and I&#x27;ll approve the merge.&quot;<p>How would you speak when sitting next to the person face-to-face? What tone do you want your boss to use when providing a performance review during a 1on1?