I’m a software engineer and the most experienced within our team. My code has been labelled as “complex” and “hard”, by both my junior colleagues and (vicariously) my manager.
My code is “complex” because it’s well engineered. It’s like that for many good reasons, which make it easier to read, refactor, test and maintain. In my opinion — at the risk of getting defensive about it — it’s actually easier to work with than the piles of spaghetti that my colleagues churn out. Don’t get me wrong, I’m sure it could be better, but I’m effectively being criticised for doing an objectively good job.
I’m not “gatekeeper-y” about it either. Whenever my colleagues ask for help to understand why I’ve done something a certain way, I happily explain and attempt to do so in a constructive, patient way. (e.g., I’m not dismissive and take the time to understand their point of view so I can get them from A to B.) Sometimes I don’t have time for this — I have work to do, too — but I’m never rude and always try to make time when I can. Failing that, my code is generally well commented and documented, so if all else fails, my colleagues have the means to help themselves.
Until I pointed out that the techniques I use are best practice and there for a reason, it was even suggested that I “dumb down” my code! To be honest, I’m actually quite upset about all this. What else can I do?
EDIT I’m beginning to regret writing:
My code is “complex” because it’s well engineered.
...as it seems to be being universally interpreted as arrogance. I can see why, but I wasn’t trying to be arrogant nor closed-minded. The scare quotes are important in that sentence and I can justify my assertion with evidence, but that isn’t relevant to my question. Rather, I had hoped my narrative about going to lengths to help juniors understand exemplified this.