News for hackers. Stuff that matters.
Re:Don’t Teach During Code Reviews by sidlls on Sunday February 05, 2023 @03:38PM (#34669070)
I use junior engineers’ code review submissions as an opportunity to teach, and any senior engineer who doesn’t is committing professional malpractice. They have to learn, and that requires someone (in the case of a code review) to teach them. One can do it without being condescending, though

The Socratic method for teaching is actually quite good, and it can be employed without condescension.

Re:Don’t Teach During Code Reviews by bsder on Sunday February 05, 2023 @04:08PM (#34669416)
I think the real problem here is that because everything is going online-only, we're falling into the trap of making everything public and recorded forever.

Maybe I'm just too damn old, but I don't like this trend.

When code reviews were in person, as a senior person, I could deliver feedback without that feedback becoming a public albatross stuck around someone's neck. We all screw up and miss things. Sometimes we don't write the best code. Sometimes we don't know something that should be universal knowledge.

My correcting your mistake or lack of knowledge shouldn't get recorded for all to see.

With the way things currently are, I now have to do two code reviews. One to correct actual problems and teach/mentor and the other for the public checkin to the system codebase.

Re:Don’t Teach During Code Reviews by lifeisstillgood on Sunday February 05, 2023 @04:17PM (#34669517)
This.

Emails that have a long list of CCs suddenly become a political hothouse of "If I say X in front of Y it will seem like a criticism and they will clam up and then the whole thing becomes something the "positional authority" has to adjudicate not an experience led discussion"

I feel that this problem is the very reason FOSS mailing lists (ie Linux) were so brutal - it's that or you risk lack of clarity.

I know I sound like someone complaining about woke snowflakes, but there is a line somewhere around here and I wish I knew where it was

Re:Don’t Teach During Code Reviews by dan-robertson on Sunday February 05, 2023 @04:22PM (#34669572)
I’ve written plenty of bad code before, and some of it was released and some of that led to tricky bugs. I don’t feel particularly ashamed of having written bad code though. Maybe I’m thinking of a different kind of feedback? Like, hopefully the worst problems can be figured out before much code is written, and if someone made some asshole critical comment, I would probably consider it reflecting poorly on them rather than me (indeed I find the permanent record of the comments I left and since regretted weighs more heavily than the record of the comments received – or the poor code committed). But I guess different people react to feedback differently, especially critical feedback and maybe you’re imagining some kind of ‘the whole thing is totally wrong and terrible’ discussion? But that feels to me like a case where a bunch of blame belongs to whatever allowed a bunch of totally wrong code to begin to be written.
Re:Don’t Teach During Code Reviews by sidlls on Sunday February 05, 2023 @04:29PM (#34669644)
I agree that submissions that bad shouldn't have a permanent record. If I see something egregious I'll ask the person in person, or via our chat software, and make a vague comment like, "Please make the changes we discussed over lunch," or whatever, in the comments of the submission.
Re:Don’t Teach During Code Reviews by actually_a_dog on Sunday February 05, 2023 @04:52PM (#34669915)
In my experience, the problem you’re pointing out is a non-problem. I’ve never done an in person code review in my life that didn’t take place in an interview context. Yet, somehow none of my mistakes in writing code (and there have been many) have never become “a public albatross stuck around [my] neck.”

Is this a thing you’ve seen or just something you’re afraid might happen? If the former, I would say that’s an unhealthy work environment. If the latter, then why point it out?

Re:Don’t Teach During Code Reviews by SilasX on Sunday February 05, 2023 @05:11PM (#34670148)
>When code reviews were in person, as a senior person, I could deliver feedback without that feedback becoming a public albatross stuck around someone's neck. We all screw up and miss things. Sometimes we don't write the best code. Sometimes we don't know something that should be universal knowledge.

Heh, I actually ran into a funny situation because of permanence of code review.

One time I was onboarding a new employee (call him Bob) to how pull requests worked in GitHub, and I wrote up a sample one from his computer. Just to be silly, and because I didn't realize the implications, I said "okay and you fill out the body, describing what you did. As an example, let me just put in some filler text, 'hey, you people suck'."[1]

I was planning to delete the obvious-garbage PR, but I didn't realize ... GitHub doesn't let you delete PRs, only close them! And it triggers emails!

Mercifully, no one said anything. But then months later, another co-worker (call him Charlie) was venting to me about what he didn't like about Bob: "And, another thing, one time, that asshole wrote up this pull request, where he said, hey, you people suck!"

So I owned up: "Oh, uh, Charlie, that ... was actually me. I was writing a dummy pull request to onboard Bob but sent it by accident."

Then Charlie said, "Well ... he's still an asshole!"

[1] I think I wasn't planning to submit it at all, but after a while Bob probably wanted to see it in action and I forgot to remove that part. (And yes, I also now make sure to use more innocuous filler text.)

Re:Don’t Teach During Code Reviews by thinking4real on Sunday February 05, 2023 @04:13PM (#34669467)
Eh, even the socratic method is quite patronizing in many situations.

For example: underlying does a task that is correct and valid but not what the higher up envisioned or hoped for. In this case you’re just going to come off as a prick for “gently guiding me” to a conclusion I disagree with, but which I’m not allowed to (non confrontationally) articulate as you’ve corralled this conversation down one narrow path based on your personal preference

As someone who while I was a junior was starved for someone to actually teach and mentor me, I’d say this scenario played out much more often than one where I was given valuable education. yrmv

Re:Don’t Teach During Code Reviews by goostavos on Sunday February 05, 2023 @04:45PM (#34669817)
100% Agreed. Just say what you think and why. The Socratic stuff works really well if you're making up a pretend conversation where you get to write both parts, and every question gets the perfect answer, and it all gets to ends with perfect enlightenment. In the real world, your questions probably suck, and the answers probably suck more. Nothing is more obnoxious than enduring someone badly doing "the socratic method" on you.

The main problem with junior engineers is that they have narrow views of the world. Software is complex. Being experienced, is mostly about earning hard won scars through mistakes, missteps, and rewrites. It's tough to convey the scope of impact by just asking them questions. It's much more guiding to just give them what they don't yet have!

I'd much prefer: "Oh, man, so this looks like it shouldn't matter, but let me tell you how I once took down prod for 3 hours by doing this same thing. I can show you how it can fail in this really subtle way".

to: "what is the nature of being?"

Re:Don’t Teach During Code Reviews by mentat on Sunday February 05, 2023 @04:14PM (#34669483)
I ask a lot of questions on code reviews as it's usually less easily perceived as conformational and I have come to assume that I'm missing context when something is really off. Assume that coworkers are competent but may either have or lack context. If your coworkers are genuinely incompetent, then a new position might be better than fighting though PRs.
Re:Don’t Teach During Code Reviews by photochemsyn on Sunday February 05, 2023 @04:18PM (#34669527)
I don't know how easy it is to avoid coming off as condescending. For example:

> "Let's say someone makes the argument that the Socratic method has major flaws related to how it is applied in practice, and that it's better to explicitly state issues with someone's approach or line of reasoning? How might you respond to such a disagreement among your cohort of senior engineers when it comes to code review practices?"

It's always going to come across as "Look I'm patiently trying to lead you arond to the conclusion that you made a mistake or don't understand things correctly, because trust me, I know better."

Also, a lot of junior people know all about how this game is played and will play along, faking the whole 'dawning realization of the error they made' thing and expressing appreciation for the master's wisdom, while secretly thinking, 'am I going to have to go through this every time I make some mistake or other?' I certainly spent quite a bit of time doing that in the past.

I think it's just a lot faster and more efficient to point out errors and issues as you see them, and any decent engineer will absorb that information pretty quickly.

Re:Don’t Teach During Code Reviews by simplotek on Sunday February 05, 2023 @04:19PM (#34669532)
> The Socratic method for teaching is actually quite good, and it can be employed without condescension.

I seriously doubt a PR is the right medium for the Socratic method, or that trying to employ it in that venue cannot sound anything other than condescending.

PRs are the end result of the developer's work to address an issue. Communication through a PR is asynchronous and inefficient wrt time. Engaging in gratuitous chatter in PRs actively blocks the developer from delivering his work. Pushing for needless iterations with cryptic open-ended questions where you force a developer to be on the defensive reads as if you're standing in the way while gratuitously questioning someone's ability in a very public way through a medium designed to persist discussions til the end of time.

If a PR has an issuez just do the right thing and go straight to the point. If you feel the need to get into what you feel are teachable moments, reach out to the developer through your choice of direct chat.

Re:Don’t Teach During Code Reviews by m463 on Sunday February 05, 2023 @04:20PM (#34669542)
what some people don't get is that they're gatekeeper and have to balance that out.
Re:Don’t Teach During Code Reviews by throwaway892238 on Sunday February 05, 2023 @04:36PM (#34669719)
Ask them if they want a lesson first. Not every junior wants their superiors lecturing them.
Re:Don’t Teach During Code Reviews by tremon on Sunday February 05, 2023 @05:46PM (#34670555)
Yes, and not every kid wants to be told what to do by their parents. But it still happens, because that is part of the parents' role. As it is with senior developers.
Re:Don’t Teach During Code Reviews by throwaway892238 on Sunday February 05, 2023 @11:39PM (#34673415)
That is literally Paternalism. You need a pretty impressive ego to, with a straight face, say that grown adults should be treated like children at work.
Re:Don’t Teach During Code Reviews by tremon on Monday February 06, 2023 @12:20PM (#34680688)
You write that as if every -ism contains contains an automatic and universal value judgement. For those of us who don't subscribe to that model, do you think you can rephrase your argument without isms?
Re:Don’t Teach During Code Reviews by throwaway892238 on Wednesday February 08, 2023 @07:38PM (#34718006)
Do you know why children don't like to be told what to do by their parents? It's not because they can't do whatever they want. It's because as a child, your agency is taken away. You have no choices but those given to you, no information but what little is given to you. You live in a world of someone else's rules and decisions, someone else's tastes, someone else's lifestyle. You are forced to live the life someone else wants, rather than your own life. And you are often given restrictions not because it's what's best for you, but it's just what's convenient for the person in power.

Children are often not given the benefit of the doubt. Things aren't explained to them, and they're lied to. Much of the time parents don't even do what's best, but instead whatever they prefer. The child may actually be fine with what a parent wants. But rather than give the child the knowledge and tools to make their own decisions and come to their own conclusions, the parent forces their child to become subservient, removing their ability to be a free human being, making their own mistakes, achieving their own goals. Children often grow up stunted by years of biased information, and the inner working of the minds of others who have grown up in the same system.

Paternalism is wrong because it's wrong to think you know what's good for others. You may know what's good for you. And you may have some experience that tells you some potential consequences of specific actions. But by pushing your own desires and limited knowledge on a child, and not permitting experimentation, growth, or making one's own mistakes, the child does not really grow. They just become a poor copy of the parent, and just as limited. Later they internalize all this and try to justify it by doing the same thing to others or their own children. But it's just a coping mechanism for the trauma they experienced as a small human with no rights.

If you actually respect your co-workers, do not treat them like children. Do not condescend. Do not limit them. And do not prevent them from making simple mistakes. Give them information, teach them, sure. But only if they want to be taught. Not because you think you have some special right to tell people what to do, or force people into situations they didn't consent to.

Re:Don’t Teach During Code Reviews by sidlls on Sunday February 05, 2023 @05:53PM (#34670635)
A junior engineer who doesn’t want to learn from a senior engineer is an engineer setting himself up for a failed career.
Re:Don’t Teach During Code Reviews by PragmaticPulp on Sunday February 05, 2023 @04:38PM (#34669741)
> The Socratic method for teaching is actually quite good, and it can be employed without condescension.

Socratic Method is hard to use without coming off as patronizing, even if you think you're being careful.

If you're genuinely jumping in to ask real questions to understand the problem, that's great.

Most of the time when I see people use Socratic Method in the workplace it's because they think they're doing the other person a favor by asking a lot of leading questions instead of communicating directly. For the person on the receiving end, it becomes a game of navigating the questions and delivering the answers you know the person wants to hear, all done as delicately as possible to avoid disturbing their sense of superiority.

It's almost always better to just approach the conversation as a discussion between peers. If you go in with implied seniority structures or student/teacher methods (including Socratic method) then it stops being a conversation among peers and starts to feel like another social hierarchy game that must be carefully navigated to avoid upsetting your elders.

Just talk to your coworkers like peers, even if they're more junior than you.

Re:Don’t Teach During Code Reviews by NikolaNovak on Sunday February 05, 2023 @04:46PM (#34669835)
Yeah ; I'm super open to coaching as opposed to mentoring, but last few years, when my managers tried to employ the coaching / questions methodology, it was obvious and painful : they did not feel like open questions to discover something together ; they felt like fake questions that had a "right" or rather "expected" answer, so it did not feel at all like "me figuring things out for myself " but rather"me trying to guess what I'm expected to say". Typically after a few frustrating minutes I just ask for straight feedback - I am happy and excited to receive constructive feedback and lecturing.

My boss and I had an open discussion and it may be they just need more practice - coaching is a skill like any other and just because you took a two day class doesn't mean you're an expert yet. So we accepted that while he's more experienced than I am and my mentor in many things, he's junior in "coaching" so we sure working on it together :-)

Re:Don’t Teach During Code Reviews by PragmaticPulp on Sunday February 05, 2023 @05:02PM (#34670034)
I had some college professors who used Socratic style in class and I enjoyed it. However, that was literally a teacher/student relationship that I signed up for. Furthermore, the professors were usually genuinely curious about my responses and wanted to explore them when they didn't necessarily agree with the expected answers.

In the workplace, Socratic method just feels like an unnecessary power move. Someone is trying to cement their role as teacher and the other person as student.

I had a manager who liked to use the Socratic method for everything. He communicated everything in the form of questions. If you gave the "wrong" answer, he'd give a sharp sigh and then rephrase the question, giving you another change to give a "better" answer.

This method was mildly annoying when he was right, but it was completely disastrous when he was wrong. He'd often arrive late to a situation that people had been dealing with for months and assume he knew exactly what was going on, better so than the people involved. He'd start his Socratic questioning, but you weren't allowed to explain the context or how you arrived at a solution. Your only option was to navigate his Socratic questioning until you could gingerly explain that he was missing a key constraint, or that we had already tried that, or that he had received bad information, and so on. It became a tool for him to control the conversation and put you in your place at the same time.

It was a very sad time in my career. I'd arrive to every meeting feeling like I was about to play a psychological game of "guess the right answer" as I navigated the Socratic questions until we could get him to reveal what he was really thinking, or why he was so frustrated, or why he thought we were wrong, or any other number of issues that he just wouldn't tell us.

Re:Don’t Teach During Code Reviews by onlypositive on Sunday February 05, 2023 @04:50PM (#34669876)
+1 I gave up on the "teaching" years ago, it never did anyone any good and wasted a lot of time.

Now I say explicitly what I think is wrong and what needs changing.

This too can come off badly so I limit reviews to one or two remarks. I also build a relationship with these engineers and explicitly explain how I do reviews different nothing that while I give you solid direction, whether you take my advice is entirely up to you to evaluate and that it is 100% ok with me if you explain why I'm wrong and you're not changing it. - the purpose of my reviews is to catch problems you haven't thought of, if you've already thought about it and made a trade off that's your call to make. (And I trust you to make it)

Translation: I'm too old for this tit for tat shit and have bigger hills to die on than where you put your whitespace.

Re:Don’t Teach During Code Reviews by dgb23 on Sunday February 05, 2023 @05:00PM (#34670013)
I think there's value in having a small set of 'goto questions' or maybe rules that are well known and regularly used. Then you can go over them together in the case of a review, a debugging session or to clear up a problem.

I don't know how that relates to the Socratic method. But I think it's useful, if done honestly. It's like a little ritual that you do together and it serves both sides as a guideline in the moment, but also helps to converge to a common way of communicating things and writing code.

Re:Don’t Teach During Code Reviews by BlackFly on Sunday February 05, 2023 @04:41PM (#34669773)
The Socratic method is bad over asynchronous communications because if you, Socrates, made a mistake then it takes 3-5 iterations to clear that up.

1. You post a question with non-specific action intended to stimulate them to critically think and fix a defect which doesn't exist. 2. The bewildered person tries explaining what is going on blindly, not sure what you are hinting at. 3. If the general explanations connect, maybe you see your mistake and resolve otherwise you explain what you were thinking the defect was. 4. The author explains the lack of defect. 5. You apologize and resolve.

If the person has any confidence at all then they will consider this a demoralizing possibility.

Even if the person didn't make a mistake if you know there is an issue and are withholding that from them because you think them figuring it out by being stimulated from answering your question is benefitial to them, then you are not being immediately helpful in an asynchronous process that has a tendency to drag on. Our society would not be capable of the things it was today if everybody needed to reinvent the wheel frequently as a learning experience; direct communication is a strength we have.

All I am saying is, go sit down with them if you want to use the socratic method. It is multiple times more effective then.

Re:Don’t Teach During Code Reviews by aflag on Sunday February 05, 2023 @04:46PM (#34669837)
If you're looking at someone's job title before making a review I'd say you're doing it wrong. Just point out things that are wrong (actual bugs) and things you think could've be done better. If there are no bugs it's probably ok to even approve it already, unless things were really poorly written. It shouldn't matter whether the person submitting the PR is a junior or the highest ranking developer in the company. Code is code.
Re:Don’t Teach During Code Reviews by hgsgm on Sunday February 05, 2023 @04:52PM (#34669907)
"Socratic" method (which was used in a book, not in actual teaching, IIRC), works when the student wants to figure something out on their own but with guidance, like "You Could Have Invented X" blog posts, or tutoring math. It doesn't work when the "teacher" forces it upon an unwitting "student" to trick the student into discovering they are wrong.
Re:Don’t Teach During Code Reviews by impalallama on Sunday February 05, 2023 @04:55PM (#34669949)
Socrates was executed for the Socratic method
Re:Don’t Teach During Code Reviews by azangru on Sunday February 05, 2023 @05:00PM (#34670017)
> any senior engineer who doesn’t is committing professional malpractice

Interesting. Why not turn it around and say that any junior engineer who doesn't use comments left by his more experienced colleagues as a learning opportunity is committing professional malpractice?