I started a new programming job recently and just wrapped up my first task. As part of it, I had to change a critical line in a file from ABC
to XYZ
.
For my second task, a coworker mentioned that it might be helpful to look at some code my teammate Sam recently worked on. He's been on the project for several years and sits in the same office as me. While searching for it, I noticed Sam had also recently edited that critical file from my first project. Out of curiosity, I looked closer... and found that the edit set that line back to ABC
to resolve a minor display issue.
The ABC
line will cause the entire application to crash in certain scenarios, which is why I was tasked to make that change in the first place. Obviously, this needs to be fixed!
I want to talk to Sam about this, because:
- I don't know the best way to fix it such that both our problems are solved, and he would probably have some ideas since he's more experienced
- I'd feel very awkward and rude not saying anything and surprising Sam in next week's meeting when I mention "I've been working on [same bug he just 'fixed']"
- I want to explain why I did that, so he won't inadvertently introduce more bugs in the future. (Sam knows I had been working on this, so I'm not sure why I wasn't looped in on this in the first place, but that's beside the point now..)
I'm not sure how to approach Sam, though. Normally I would start a conversation like this by suggesting a fix I could do, but since I'm new to this project I don't have one. I don't want to sound accusatory or possessive over my code. Sam seems like a reasonable person, but given how busy he is, would likely be annoyed if he thought I was trying to dump this problem on him ("Hey your code is wrong, you need to redo it"). I'm also just worried about putting my foot in my mouth (has happened a few times lately, unfortunately) and giving a bad impression to my new coworkers.
More details
Our company has source control, bug tracking, and code reviews for every commit. Our commits are both already in the "alpha" code base (visible to developers and testers, but not released to the public), and linked to the respective bugs that they fix.
His commit message was like: "Bug: History doesn't show ABC. Fix: Line wasn't ABC, changed line." A comment at the top of XYZ
file explains that it runs either ABC
or DEF
, because ABC
doesn't always work. (The real names of the classes are more like "Thing" vs. "Thing Selector" if that helps explain it.) So this is why I suspect he (and the coworker who reviewed his change) didn't actually look into XYZ
.
Unfortunately I only had tests to ensure XYZ
functioned appropriately and not that this file was actually running XYZ
(lesson learned there!).
Question
How can I approach Sam to let him know his "fix" breaks my code, and get his help on actually fixing it?