I'm a senior developer at a new job. One rock star programmer on my team is considered senior. He has worked on the project for years. His code has unhelpful or misleading names. It has methods and classes with hidden behaviour and side-effects that cause severe issues (including data loss or data corruption) if not used in exactly the right complicated way, and it would take hours of digging to figure out what the right way is. It has a great deal of complexity that is not divided up in any way. No documentation or even comments.
The boss, project manager, product owner and testers see that he finishes tasks much more quickly than other teams members. They see that other team members frequently make changes that result in severe issues, and then only the rock star understands what went wrong and hops in to fix it and save the day. To the non-programmers, this looks like he is a great programmer. I assert that it is because he is the only one familiar with the unnecessary complexity and hidden pitfalls of his own code. The junior programmers notice that they are dependent on him for help, which they appear to believe means that he is much better than them. I don't think the junior programmers are aware that they could work more independently, more quickly and more accurately if they were working with a code base that was written with clarity in mind.
Other team members always approve the rock star's pull requests without comment, and nobody approves anyone else's pull request until the rock star has approved it. Any pull request with changes that improve clarity, even something like renaming cl_mode_1()
to invoiceIsPrintable()
is blocked by the rock star with a comment that the change is "pointless". If I reply and make a case for clarity, he does not respond. If I ask him personally if we could discuss it and hear me out, he says he doesn't feel like it. I have also suggested to the team that I could start writing documentation, but the rock star said that he hates documentation and the team immediately dropped the idea. Several times I have seen the rock star interrupt another colleague to tell them they are wrong, and every time that person immediately drops what they were saying and everyone appears to assume the rock star is correct.
I would like to make a case to all team members that we would all save a great deal of time, have fewer bugs and be less dependent on the rock star if we all focused on writing clearer code. At the absolute least, I would like to be allowed to write code for clarity myself when I do my tasks. I am afraid to press this, especially as a new person on the job, because it challenges the rock star who in my perspective is viewed as though he is infallible. How can I successfully advocate for a change that someone with so much clout is very resistant to?
if (Invoice.IsPrintable)
as new code, it is blocked until rewritten to if(obj.index == 0 && (f_mode > 3 || state[1] != null))
. Both documentation and self-documenting code appears to be "forbidden" which is what I would like to advocate to change.