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
raminasi
Jan 25, 2005

a last drink with no ice
Ok for context: The company’s entire software engineering team is me, him, another guy, and a manager. This guy is effectively the lead frontend engineer. So I have some obligation to help him get better at this, if for no other reason that it won’t otherwise happen, and I work closely with him every day, so it affects me directly.

“Approach it from the perspective of unit tests” is an interesting idea, but he’s the one writing the tests, so I don’t think it’s a silver bullet.

Adbot
ADBOT LOVES YOU

12 rats tied together
Sep 7, 2006

raminasi posted:

Ok I'm having real trouble figuring out constructive communication in response to some stuff that a guy on my team does. I just had an quintessential exchange. Here was the existing code (please forgive any syntactic errors, they were just introduced by my obfuscation):
JavaScript code:
if (thingThatMightBeTrue) {
    config.API = { importantStuff: { importantKey: importantValue } };
}
He opened a PR with this addition: [...]

The first thing is a bad pattern precisely because the 2nd thing always happens. Usually when the 2nd one shows up, I try to make them both disappear instead: can the code be structured so that neither is necessary, like can we just shove them in a `class ConfigApi`, for example. I find that this usually provokes a more useful line of thinking than "have you considered writing code that isn't bad", even if its very appropriate in this case.

Judge Schnoopy
Nov 2, 2005

dont even TRY it, pal

raminasi posted:

“Approach it from the perspective of unit tests” is an interesting idea, but he’s the one writing the tests, so I don’t think it’s a silver bullet.

Sounds like your org is very early in the software dev maturity.

Writing your own tests sounds flimsy. "I can just hack it to make the test pass, what's the point?" I get it, I was there too early on - it's just more code for the same result!

But as somebody said earlier, you end up reviewing the tests rather than the code. The test cases don't cover "thing 1 true, thing 2 false"? Make them add that test case. If the code is broken, they'll figure it out real fast, fix it, and ensure they don't break it again in the future.

It's easier to say "your tests are wrong" than "your code is wrong". It might not sound like a silver bullet but it absolutely is, and it sounds like this is the next big step forward in your dev journey.

Harriet Carker
Jun 2, 2009

raminasi posted:

“Approach it from the perspective of unit tests” is an interesting idea, but he’s the one writing the tests, so I don’t think it’s a silver bullet.

I think in this sort of situation it actually is a silver bullet.

code:
expect(thingDoer(thingThatIsTrue, thingThatIsFalse)).toEqual({ importantStuff: { importantKey: importantValue} }}

expect(thingDoer(thingThatIsTrue, otherThingThatIsTrue)).toEqual({ importantStuff: { importantKey: importantValue, otherImportantKey: otherImportantValue } }}
Now you don't need to go to your coworker and ask about intent, and you actually can even review the function definition with a more limited amount of JS knowledge, because you can see from the unit tests exactly what this function is supposed to be doing and you don't have to analyze whether it actually is or not.

In this case, you could even leave comments like "Needs test case for thingDoer(thingThatIsFalse, thingThatIsTrue)" or "What happens if they are both false?"

CPColin
Sep 9, 2003

Big ol' smile.
Yeah, with N boolean inputs, it's immediately clear something is missing when there aren't 2^N test cases

Bongo Bill
Jan 17, 2012

If you don't have tests, you don't have a feature.

Hughlander
May 11, 2005

Bongo Bill posted:

If you don't have tests, you don't have a feature.

Asset.That(main(argc, argv), false);

Done!

Doktor Avalanche
Dec 30, 2008

raminasi posted:

Ok I'm having real trouble figuring out constructive communication in response to some stuff that a guy on my team does. I just had an quintessential exchange. Here was the existing code (please forgive any syntactic errors, they were just introduced by my obfuscation):
JavaScript code:
if (thingThatMightBeTrue) {
    config.API = { importantStuff: { importantKey: importantValue } };
}
He opened a PR with this addition:
JavaScript code:
if (thingThatMightBeTrue) {
    config.API = { importantStuff: { importantKey: importantValue } };
}
if (otherThingThatMightBeTrue) {
    config.API = { importantStuff: { otherImportantKey: otherImportantValue } };
}
My comment on the PR, because I don't know JavaScript very well and thought I legitimately might not understand something: "Will that merge the properties of importantStuff or will the second one overwrite the first one" (which would be incorrect), to which he replied that they'd be merged, with no other explanation.

Now either he's right and I still don't understand, or he's wrong, so I get him on Slack, and it turns out that yes, there would be an incorrect overwrite. So he "fixes" it:
JavaScript code:
if (thingThatMightBeTrue) {
    config.API = { importantStuff: { importantKey: importantValue } };
}
if (thingThatMightBeTrue && otherThingThatMightBeTrue) {
    config.API = { importantStuff: { importantKey: importantValue, otherImportantKey: otherImportantValue } };
}
I ask the obvious question: "What will this do if otherThingThatMightBeTrue is true but thingThatMightBeTrue is false?" and he sees the problem and fixes it. But it felt like a lot of hand-holding for someone with 4-5 years of experience. And maybe my expectations are misaligned, and maybe they aren't, but either way I want to find a way to generalize the thought process I went through for him in a way that's more useful than "when you're writing code, you should think about what it would do, and not write code that will do the wrong thing," but that's all I can think of here. Does anyone have any ideas?

why not use dot notation?

config,API.importantStuff = {}

config,API.importantStuff.importantKey = importantValue
config,API.importantStuff.otherImportantKey = otherImportantValue

raminasi
Jan 25, 2005

a last drink with no ice

Doktor Avalanche posted:

why not use dot notation?

config,API.importantStuff = {}

config,API.importantStuff.importantKey = importantValue
config,API.importantStuff.otherImportantKey = otherImportantValue

I simplified the code a bit for the post; I don’t have the original in front of me but I think that wouldn’t work. (Or maybe it would and we both just missed it!)

Thanks for your thoughts, everyone.

Volmarias
Dec 31, 2002

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

Bongo Bill posted:

If you don't have tests, you don't have a feature.

We all test in production one way or another, friend.

Cup Runneth Over
Aug 8, 2009

She said life's
Too short to worry
Life's too long to wait
It's too short
Not to love everybody
Life's too long to hate


Volmarias posted:

We all test in production one way or another, friend.

Especially with networking code. Try unit testing the bugs out of that!

Macichne Leainig
Jul 26, 2012

by VG
That's what a smoke test is for. You see where the smoke leaks out of the tubes and wires

Bongo Bill
Jan 17, 2012

Well, sure. You can't test everything. But that's not a reason to not test anything.

Macichne Leainig
Jul 26, 2012

by VG
I tested that my code compiled, what else do you want from me!?

Volmarias
Dec 31, 2002

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

Bongo Bill posted:

Well, sure. You can't test everything. But that's not a reason to not test anything.

Look, I have a robust alerting mechanism. If I hear screams after I deploy, that means I should take a look on Monday. Tests would just slow me down!

CPColin
Sep 9, 2003

Big ol' smile.
One of the few things I miss about in-person work is blaring "Entrance of the Gladiators" when something failed a scream test

Wibla
Feb 16, 2011

CPColin posted:

One of the few things I miss about in-person work is blaring "Entrance of the Gladiators" when something failed a scream test

I still work in an office a few days per week, I'm stealing this :sun:

(I'm a networking engineer, the scream test is one of my favourite tools :smuggo: )

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Volmarias posted:

Look, I have a robust alerting mechanism. If I hear screams after I deploy, that means I should take a look on Monday. Tests would just slow me down!

Tests are important, but I'm a senior engineer. Tests are for the juniors to write.

(actual belief by developer of the code I inherited at my current job)

smackfu
Jun 7, 2004

Aka, “here’s a branch with a proof-of-concept I did, can you flesh it out?”

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Hey thanks for agreeing to help me with the coding work for this project. I just finished the HLD and LLD. Just let me know when it's done thanks!

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Bongo Bill posted:

If you don't have tests, you don't have a feature.
tests are just pretend users

Macichne Leainig
Jul 26, 2012

by VG
Users are just surprise tests.

Woebin
Feb 6, 2006

My place of work has an internal design library. To my mind, the benefits of our design library are:

  • Provides standard components for basic stuff - buttons, inputs and such - so individual designers don't have to reinvent them.
  • Provides implementation boilerplate, making it easy for developers to use the standard components.
  • Provides guidelines for design at large - color selection, fonts and so on, giving designers a framework to stay within when designing pages and such.
  • Ensures that the standard components and guidelines are in line with accessibility requirements.

I'm often tasked with building new pages based on design sketches provided by one of our designers who don't work directly on the design library, and he constantly deviates from the library. He'll design his own buttons, use colors that aren't in the library guidelines, and just repeatedly reinvent the wheel for no apparent reason. And, of course, he fails to account for accessibility.

I don't think the design library has to be treated as word of God or anything, but if someone's gonna deviate from it there should be a clear reason for doing so. Whenever I question him about weird design choices he'll basically wave me off because he's a Professional Designer™ and knows what he's doing, while I'm just a developer with no formal design training.

My product owner generally sides with him, arguing that the design library doesn't update fast enough to keep up with our needs and that it "looks good".

I don't know what kind of response I'm hoping for on this, mostly I'm just venting because I'm real tired of this situation. And it's incredibly demoralizing to have to build stuff that I know is bad.

smackfu
Jun 7, 2004

Developers shouldn’t be the ones enforcing use of the design library, so that sucks.

prom candy
Dec 16, 2005

Only I may dance
Have you explained to the person up the chain who cares about these things that deviating from the design system costs money? That's usually how I get buy-in on adhering to our existing systems.

Clanpot Shake
Aug 10, 2006
shake shake!

A design with no regard for accessibility is not a complete design. If he's really a Professional Designer he should account for these things.

YanniRotten
Apr 3, 2010

We're so pretty,
oh so pretty
Welcome to every experience I've ever had at every company implementing a component library.

This only works if the designers are the people maintaining the library, which they never are since the bar is generally "can lay something out in Photoshop" without any other tech skills required.

YanniRotten fucked around with this message at 19:19 on Dec 19, 2022

smackfu
Jun 7, 2004

It’s also inevitable that designers get bored of working within the library and start pushing the boundaries. “Every page looks the same” is good and bad.

prom candy
Dec 16, 2005

Only I may dance

smackfu posted:

It’s also inevitable that designers get bored of working within the library and start pushing the boundaries. “Every page looks the same” is good and bad.

In my experience there's a big difference between expanding the library and ignoring the library.

Woebin
Feb 6, 2006

prom candy posted:

Have you explained to the person up the chain who cares about these things that deviating from the design system costs money? That's usually how I get buy-in on adhering to our existing systems.
Money is always the last thing I think about, so no, I don't think I've tried that angle. I will!

Clanpot Shake posted:

A design with no regard for accessibility is not a complete design. If he's really a Professional Designer he should account for these things.
I absolutely agree, but also lol at the utopian idea that this would be the norm.

smackfu posted:

It’s also inevitable that designers get bored of working within the library and start pushing the boundaries. “Every page looks the same” is good and bad.
The design library only covers basic stuff though, it's like handing the designers a bunch of Lego pieces and letting them assemble the pieces somewhat freely. This designer makes his own pieces.

prom candy posted:

In my experience there's a big difference between expanding the library and ignoring the library.
And yeah, this is important. I've had issues with the design library sometimes too, but then I've either has a dialog with the library developers or suggested changes myself. If this guy would do the same thing I'd have a lot less of a problem with him.

Volmarias
Dec 31, 2002

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

Woebin posted:

Money is always the last thing I think about, so no, I don't think I've tried that angle. I will!

Depending on how large the company is and how far your Manager's budget is divorced from the practical effects of your actions, this may not work.

Sistergodiva
Jan 3, 2006

I'm like you,
I have no shame.

Volmarias posted:

Depending on how large the company is and how far your Manager's budget is divorced from the practical effects of your actions, this may not work.

My experience with larger companies is that anyone making a decision has no idea about the real consequences and that it's a miracle any money is made at all.

Gildiss
Aug 24, 2010

Grimey Drawer
Large enterprise companies are like those huge wild animals with a thousand gigantic fat ticks hanging off them.

It owns if you are with one of the tick companies.

Cup Runneth Over
Aug 8, 2009

She said life's
Too short to worry
Life's too long to wait
It's too short
Not to love everybody
Life's too long to hate


Which one of you idiots did this https://www.pcgamer.com/software-engineer-busted-after-being-inspired-by-office-space-scam/

ChickenWing
Jul 22, 2010

:v:


jesus christ how does someone actually think they can get away with that

Volmarias
Dec 31, 2002

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

ChickenWing posted:

jesus christ how does someone actually think they can get away with that

quote:

His involvement was apparently uncovered when a document was found on his computer that detailed a plan to alter logs of audits and alarms to cover up evidence of theft. It was called "OfficeSpace project".

Not exactly the brightest guy here.

Fellatio del Toro
Mar 21, 2009

MyCrimes.md

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.

Volmarias posted:

Not exactly the brightest guy here.
At least use crypto / a crypto tumbler instead of depositing the money directly into your own bank account for the love of god.

prom candy
Dec 16, 2005

Only I may dance

further proof that you don't have to be smart or even not dumb to do this job

Adbot
ADBOT LOVES YOU

Ruggan
Feb 20, 2007
WHAT THAT SMELL LIKE?!


We've got an entry-level dev on our team who is turning out to be a bad hire. He's already pissed off 3 of the 4 people on his subteam. Since the senior dev on his subteam who had been reviewing his code was out on vacation for the holidays, my manager asked me if I could pick up where that other senior dev left off. Sure thing, no problem.

Needless to say, there were a ton of issues. But the icing on the cake is the gall of this guy.

In response to my review, he's now:
  • Told me that I'm assessing his code with made-up subjective rules, because I asked him to either remove a code comment that wasn't adding any value or explain to me why it was useful.
  • Told me that because I gave him a code snippet to help improve his code (which he incorporated), I now knew as much as he did about his code changes and should answer my own questions about what the code does instead of asking him.
  • Thought that responding to a question about code he wrote with "I don't know" and marking the comment as resolved was acceptable.
  • Resolved issues in the code review as done without actually making any changes whatsoever.
  • Rules lawyered me with a terrible logic argument about why he thinks he's "technically correct" about something, ending his argument with "Explaining this is tiresome and quite useless. I rest my case."

This fuckin guy

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