Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Che Delilas
Nov 23, 2009
FREE TIBET WEED

MadFriarAvelyn posted:

I had one reviewer have a very ageist stance during a pull request today and I'm debating whether or not to shrug it off or drop it on HR to deal with.

You could always talk to the person, especially if you're in a position of seniority. Let them know that it's not an attitude that's acceptable to the rest of the team, or even just to yourself if that's not the case. Doesn't matter if you don't have firing authority, losing the respect of your peers is a legitimate threat. But it sounds like it bothers you, so ignoring it doesn't seem like a good option, and if it's the first time it's happened taking the nuclear option (HR) might be a bit much. You can always escalate if it happens again.

Adbot
ADBOT LOVES YOU

Doom Mathematic
Sep 2, 2008

Ghost of Reagan Past posted:

On that note can I just say how liberating it is to select a code style and enforce it from the get-go so there's no debate? My boss (the CTO) asked if I'd used it at previous jobs. No, no, I just don't want to debate code style. Black is good enough, it enforces a style, that's literally all I care about : ending debate about about style and forcing everyone to write code in a particular way.

Being able to just unilaterally make these decisions is so great, and I can't wait to see what awful decisions I make...but these are the right ones.

We also find this to be very useful. So many long and tedious discussions just immediately disappear.

Pollyanna
Mar 5, 2005

Milk's on them.


Working go fmt into the standard dev workflow is phenomenal for this.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

How do people work linters into their team’s flow? Ideally (to me) everyone would just use a real editor that could reliably run on-save hooks, but apparently this is too much to ask... Simply marking a PR as failing unless the code matches linted output feels a little petty, but actually committing linted code and pushing from CI feels a little inflexible.

Sign
Jul 18, 2003

good jovi posted:

How do people work linters into their team’s flow? Ideally (to me) everyone would just use a real editor that could reliably run on-save hooks, but apparently this is too much to ask... Simply marking a PR as failing unless the code matches linted output feels a little petty, but actually committing linted code and pushing from CI feels a little inflexible.

pre-commit it hooks into git and runs the script before committing. If it changes the files it doesn't actually commit.

Doom Mathematic
Sep 2, 2008

good jovi posted:

How do people work linters into their team’s flow? Ideally (to me) everyone would just use a real editor that could reliably run on-save hooks, but apparently this is too much to ask... Simply marking a PR as failing unless the code matches linted output feels a little petty, but actually committing linted code and pushing from CI feels a little inflexible.

We do exactly what you're describing. The linter runs as the very first step of the CI build, and by "runs" I mean it inspects the code to see if it is formatted correctly or not, but doesn't actually proactively do any reformatting. If inspection fails, the build fails. That happens very quickly, like within a few seconds. I agree that it does seem petty to completely fail the build because someone put an extra line break between two functions, but as mentioned above we get real gains from that standardization of formatting. (My personal favorite: I can grep confidently for particular code constructs because I know exactly how the whitespace has to be placed across all of our code.)

Beyond that, it's on individual developers to format their code correctly in order to pass CI. They can run the linter step locally, run it with the --fix flag, add save hooks to their editor, learn the rules and format the code by hand, whatever they want.

We don't have an automated step during CI which fixes and commits the linted code. Possibly we could save ourselves a little effort by doing this, but there are quite a few linting rules which can't be automatically fixed in this way, so it doesn't help in the general case.

Clanpot Shake
Aug 10, 2006
shake shake!

good jovi posted:

How do people work linters into their team’s flow? Ideally (to me) everyone would just use a real editor that could reliably run on-save hooks, but apparently this is too much to ask... Simply marking a PR as failing unless the code matches linted output feels a little petty, but actually committing linted code and pushing from CI feels a little inflexible.

We use formatters with configurations that can be read by our IDEs with format on save. There's a build command you can run locally that does the same thing as our build pipeline, to run all the tests and whatnot. If you forget to run the code format step the pipeline will run it and commit the changes for you. Worst case you just have to do a pull afterward.

prom candy
Dec 16, 2005

Only I may dance
We used containers for development but the real world performance of docker on MacOS was so bad we ended up going back to figuring out how to just run everything locally on our machines. Our one developer was on a slightly order MBP (like 2015) and every request to his local containerized web server was taking 4+ seconds.

Truman Peyote
Oct 11, 2006



I combine the git pre-commit hook and the CI step. If the linter fails, the CI job fails. The project readme includes a pre-commit hook script so that it's easy to avoid this.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


If you say that you require a particular coding style but you don't fail the builds on lint errors, then you don't actually require it.

smackfu
Jun 7, 2004

Also, having both pre-commit and CI checks reveals how many people skip the hooks.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Just bear in mind you'll want to have an escape hatch of some kind, in case of linter bugs or legitimate, articulable reasons to not follow the guide in a particular place.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Pre-commit hooks are dumb because they negate one of the great things about git. Immediately before running a tool that's going to gently caress with your source code is exactly when you want to make a commit so that you can undo it in the off chance that something goes wrong, and then if it doesn't go wrong you can just amend the commit. pre-push commits are a bit more sensible, but there's still plenty of times you'll want to push some WIP stuff.

Slimy Hog
Apr 22, 2008

Plorkyeran posted:

Pre-commit hooks are dumb because they negate one of the great things about git. Immediately before running a tool that's going to gently caress with your source code is exactly when you want to make a commit so that you can undo it in the off chance that something goes wrong, and then if it doesn't go wrong you can just amend the commit. pre-push commits are a bit more sensible, but there's still plenty of times you'll want to push some WIP stuff.

That's why you have --no-verify

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Volmarias posted:

Just bear in mind you'll want to have an escape hatch of some kind, in case of linter bugs or legitimate, articulable reasons to not follow the guide in a particular place.

Ideally this is by some marker in the source code (such as a // NOLINT comment or similar), so that
- it doesn't end up failing for the next person to edit that bit of code
- if the same exception happens a lot, you're motivated to fix the linter so that you can get rid of those ugly comments

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal
Alright, now I'm getting frustrated.

New PR, I refactored my work multiple times before submitting. I cleaned up the edges. I paid closer attention to structure and function location. I did more testing work to catch edge cases. I improved my comments to explain why the code existed the way it does. I reviewed my code as critically as I could and made tough edits.

Once again, absolutely obliterated in code review. This time with way more "you" statements that make it seem much more personal.

Did I make some mistakes across my couple hundred lines of code? Yeah, I'll own those, it was a hard PR. But to slap a "you're not really close here" in the comments on initial review is pretty painful.

Especially when I worked my rear end off to get the loving thing to actually work in the first place.

Wibla
Feb 16, 2011

About time to have a chat about expectations and feedback?

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Judge Schnoopy posted:

Alright, now I'm getting frustrated.

New PR, I refactored my work multiple times before submitting. I cleaned up the edges. I paid closer attention to structure and function location. I did more testing work to catch edge cases. I improved my comments to explain why the code existed the way it does. I reviewed my code as critically as I could and made tough edits.

Once again, absolutely obliterated in code review. This time with way more "you" statements that make it seem much more personal.

Did I make some mistakes across my couple hundred lines of code? Yeah, I'll own those, it was a hard PR. But to slap a "you're not really close here" in the comments on initial review is pretty painful.

Especially when I worked my rear end off to get the loving thing to actually work in the first place.

What I've found is that when people do something like this, they disagree with your approach on the high level. Unfortunately they might have what this "high level" approach is in their heads and not actually articulate what it is (there might even be a design doc somewhere they're assuming you have read), and then go through and mark the PR up using your code as examples of "hey, you're doing a bunch of stuff you shouldn't have to do or won't work in all cases because the PR didn't adhere to the high level design."

So I guess the steps here would be:
a) Do I have a high level design for this PR (100's of lines of code implies a new feature to me)?
b) Did this person go over the high level design?

If your reviewer disagrees on the high level design, it doesn't really matter how much you've tested etc, they're just going to keep tearing the PR up. That's pretty lovely on the reviewer's part, but sometimes it's worth asking how they would implement the feature if it were up to them and see if they have a response.

marumaru
May 20, 2013



Yeah, it's not going to be a comfortable conversation but it sounds like it is necessary.

Prism Mirror Lens
Oct 9, 2012

~*"The most intelligent and meaning-rich film he could think of was Shaun of the Dead, I don't think either brain is going to absorb anything you post."*~




:chord:
Re that comment: Not really close to what? Correct functionality, or the exact design the reviewer has in their head?

Queen Victorian
Feb 21, 2018

Even as someone who can take a beating in critiques/reviews thanks to design school, I can say that that code review process feels problematic. Two main issues I see:

- Lack of earlier communication in regards to what the reviewer/team lead is expecting from you. Was there any sort of planning that happened in which you talked about how you were intending to execute this feature? Were you given specs detailing high level implementation or just bare bones input/output requirements with no structural guidance? If they didn't specify how they wanted you to go about designing/structuring the thing, then that's on them. Did your reviewer communicate with you about your progress throughout the sprint and make sure you were moving in the right direction? They should have done that, especially for a new person.

- Being dickishly coy. This is also a communication problem but distinct from the aforementioned lack of pre-review communication. A code review isn't a loving mystery novel where you keep things hidden from the reader until just the right moment for maximum suspense. If there's a problem, the reviewer needs to not only say so, but also explain, in plain terms, why it's a problem and how they want it fixed.

"You're not really close here," is not only utterly useless and unhelpful, but below-the-belt mean. Appropriate response, in my book, would be more like, "Your solution to X is incorrect/suboptimal/falls short because it fails to account for scenarios A and B. To properly handle all scenarios, you need to change Y and add Z" or whatever. No mystery, no dickishness, only information you need to correct the code at hand. Explaining what the issue is will help you learn and help them get the result they want. Making you try to read their minds will not help you learn and not help them get the result they want.

Paolomania
Apr 26, 2006

Feedback that is not concrete is garbage. Even if they want a whole new approach they should be asking for you to do a design doc or other write up that you can hash it out over rather than waste your time going over and over the same code while playing "guess my intent".

Brain Candy
May 18, 2006

Judge Schnoopy posted:

Alright, now I'm getting frustrated.

New PR, I refactored my work multiple times before submitting. I cleaned up the edges. I paid closer attention to structure and function location. I did more testing work to catch edge cases. I improved my comments to explain why the code existed the way it does. I reviewed my code as critically as I could and made tough edits.

Once again, absolutely obliterated in code review. This time with way more "you" statements that make it seem much more personal.

Did I make some mistakes across my couple hundred lines of code? Yeah, I'll own those, it was a hard PR. But to slap a "you're not really close here" in the comments on initial review is pretty painful.

Especially when I worked my rear end off to get the loving thing to actually work in the first place.

Yeah this means schedule a one-on-one because communication is hard. As a bonus your reviewer will probably find it harder to be aggressive.

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with

Grimey Drawer
At the very least, something like "You're not really close here" needs to be followed up with very specific critique. Is it in violation of style guides? Is the run time bad? (if so, how?) Is there actually just a set of bugs at run time here that they spotted?

Furthermore, you don't need to actually pepper that kind of feedback with that attack. You can just say, 'The runtime here is super bad. You shouldn't be searching a list n times for a result, you should be using a hashmap which saves substantial time' (or whatever the problem would be).

+1 to schedule a one-on-one

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Brain Candy posted:

Yeah this means schedule a one-on-one because communication is hard. As a bonus your reviewer will probably find it harder to be aggressive.

However, they may not wish to meet, in which case they're finding it easier to be passive.

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal
The "not really close" comment was an addendum to a shopping list of specific critiques in the code. More of a summary of the thoughts. And it still stings a bit.

I got another review from a senior who added a few good points but said overall it looked ok. This is the senior that I spoke to about high level design, which the other senior called into question during the review. The design was not written out, the user story was severely lacking details, and the scope wasn't accurate, all leading down this trail of disappointment. I would say it's a lesson learned but I didn't know any of the code around this feature when I started, and expected the ones handing me the work to have a grasp of what that work entailed. If I could go back in time I still wouldn't have been able to fill out the design / story / scope.

I talked it over with my manager today, who said he's been watching this PR (albeit silently). He thinks I'm doing a good for just starting out. I reassured him that I know there is a lot of learning and improving ahead of me and I'm not asking for review to be a pillow fight. Overall feeling better in general but still kind of salty.

I'm definitely going to get him on the phone for the re review so I can talk through his comments and immediately address new feedback.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Judge Schnoopy posted:

The "not really close" comment was an addendum to a shopping list of specific critiques in the code. More of a summary of the thoughts. And it still stings a bit.

I got another review from a senior who added a few good points but said overall it looked ok. This is the senior that I spoke to about high level design, which the other senior called into question during the review. The design was not written out, the user story was severely lacking details, and the scope wasn't accurate, all leading down this trail of disappointment. I would say it's a lesson learned but I didn't know any of the code around this feature when I started, and expected the ones handing me the work to have a grasp of what that work entailed. If I could go back in time I still wouldn't have been able to fill out the design / story / scope.

I talked it over with my manager today, who said he's been watching this PR (albeit silently). He thinks I'm doing a good for just starting out. I reassured him that I know there is a lot of learning and improving ahead of me and I'm not asking for review to be a pillow fight. Overall feeling better in general but still kind of salty.

I'm definitely going to get him on the phone for the re review so I can talk through his comments and immediately address new feedback.

Ask your friendlier reviewer to address the comments that the less friendly reviewer has made, see if you can get them to argue in your comments. Let them fight.

Carbon dioxide
Oct 9, 2012

Volmarias posted:

Ask your friendlier reviewer to address the comments that the less friendly reviewer has made, see if you can get them to argue in your comments. Let them fight.

Is this also how to deal with good cop/bad cop during an interrogation?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Judge Schnoopy posted:

Alright, now I'm getting frustrated.
As you should as shown by everybody else. These senior engineers need to tell you what their expectations are instead of having you guess a number they're thinking of between 1 and 5 billion. It's time for them to be actual loving senior engineers and be some kind of force multiplier instead of acting like they're kind of poo poo Mountain and can roll it all downhill. Their first fuckup was not engaging with you before the first review. You can beat yourself up over possibly not getting them involved before that but they should have been thinking, "hey, maybe we should talk a little about this with Judge Schnoopy beforehand because we're inherently lazy people, a bad code review is a waste of all of our time, so let's get this right the first time." Instead they seem to think the place to be doing design review is when the code is complete. gently caress them. Also, gently caress your boss for silently watching all this unfold.

Prism Mirror Lens
Oct 9, 2012

~*"The most intelligent and meaning-rich film he could think of was Shaun of the Dead, I don't think either brain is going to absorb anything you post."*~




:chord:
Oh, you have two warring seniors and a manager who apparently doesn’t want to openly get between them. This should be a fun ride :allears:

Brain Candy
May 18, 2006

Prism Mirror Lens posted:

Oh, you have two warring seniors and a manager who apparently doesn’t want to openly get between them. This should be a fun ride :allears:

Nah, sounded like one who is chill and one who is unchill, and a manager that doesn't care about code reviews that much.

marumaru
May 20, 2013



Brain Candy posted:

Nah, sounded like one who is chill and one who is unchill, and a manager that doesn't care about code reviews that much.

"How's this going to affect our burndown chart, again?"

Riven
Apr 22, 2002

marumaru posted:

"How's this going to affect our burndown chart, again?"

And by 2023 we’ll employ everyone on Earth.



And we don’t have the parking for that.

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal

Brain Candy posted:

Nah, sounded like one who is chill and one who is unchill, and a manager that doesn't care about code reviews that much.

It's this except the manager is trying to mentor the unchill senior into being a force multiplier, which he still has a long way to go.

I looked back over the last 4 months of review at this company. Nobody got half the comments or attitude as I get from unchill senior. Either I'm the worst, which manager doesn't seem to think so, or this guy just really doesn't like me.

CPColin
Sep 9, 2003

Big ol' smile.
There's maybe a small chance that Unchill thinks they're being Socratic

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Judge Schnoopy posted:

It's this except the manager is trying to mentor the unchill senior into being a force multiplier, which he still has a long way to go.

I looked back over the last 4 months of review at this company. Nobody got half the comments or attitude as I get from unchill senior. Either I'm the worst, which manager doesn't seem to think so, or this guy just really doesn't like me.

it's entirely possible unchill senior is just poo poo

lots of people get to senior not by being good at their job but instead by being an obstacle to progress in the sense that 'we need this person to make progress'. often it's because of their own lovely behavior and actions like gatekeeping others from being meaningful contributors

do you have any kind of mentor relationships you can fall back on here? share the code and the review comments with someone with your interests in mind and not the companies (like your lovely manager who is probably terrified to piss off unchill senior because they're seen as critical to business continuity) and see what they think. if you don't have that kind of relationship with anyone feel free to pm me and i can take a look

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal
Nah I mean I totally made some technical mistakes and am owning those. Both chill and unchill have been with the company from the very start, they built the product from the ground up. Unchill seems the type to want ocd levels of control over making all the code up to his quality.

He's an extremely talented engineer and his reviews have this insane understanding of exactly how the new code interacts with every bit of the software.

My only problem is the approach of "you're not meeting the quality standard, do better" instead of "hey let me point you in the right direction and give you some exercises to improve your weaknesses"

Brain Candy
May 18, 2006

Many 'seniors' are senior at individual contribution but terrible at communication,. esp. if freshly senior. Find out whether this person is truly an rear end in a top hat or only bad at expression with you.

Sometimes the frustration that bleeds through is the frustration of the person being unable to express themselves. Obv. this is not fun and is not something you have to roll over for, but the best reviews happen after a mutual agreement on style of expression and what's at stake. Talk to people! Talk!

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Judge Schnoopy posted:

He's an extremely talented engineer and his reviews have this insane understanding of exactly how the new code interacts with every bit of the software.

My only problem is the approach of "you're not meeting the quality standard, do better" instead of "hey let me point you in the right direction and give you some exercises to improve your weaknesses"
Does unchill casually let anybody else touch their babies? I'm sure you're far from alone with this mistreatment.

Rocko Bonaparte fucked around with this message at 00:31 on Jun 6, 2021

Adbot
ADBOT LOVES YOU

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
I unilaterally decided that we're going to use Black to format my company's Python code and god, it's liberating to not care about style. Some of its choices are ones I wouldn't make but that's the beauty of it: I didn't make the choices. It just settles stylistic debates and we can move the gently caress on. Helps that we're doing this at the start of a project, of course, and that I have the authority to just decree such things, and we can just move on with our lives. Not a perfect choice for everyone but I'm a real fan of not having options in code formatting (it helps that outside an edge case or two it improves readability).

Ghost of Reagan Past fucked around with this message at 17:35 on Jun 12, 2021

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply