by mrunkel · 7y ago · 0 comments
To be clear, I'm not saying that the problem is entirely yours, but in most communication problems, the blame lies with both parties. I'd suggest involving a third party (another colleague) in your conversations and allow them to moderate the discussion.
In my experience a third party can quickly see where the communication is breaking down, even when it's not apparent to the two people attempting to communicate.
My former lead got promoted to his position because he was literally the only guy who knew the language they wanted to use. He knew very little about the language and technology but took to the position because he obviously likes status.
The end result is him having "7+ years of experience with <pretty obscure language>", but he didn't even know some of the basics of it. On top of that he has this unfortunate defect/defense mechanism where anything he doesn't understand is automatically bad; even things that anyone versed in the domain would say are better than his homegrown solutions. You end up noticing this a lot, because there is a disproportionate amount of things he doesn't understand.
To put this into perspective: His solutions always involved some kind of raw string interpolation for SQL, even though there were plenty of flexible, good libraries that could safely abstract away issues with SQL query handling. If you asked him about it he'd say it "was hard to use" or some other useless thing.
I stopped working with him even before he left our company and even after we've parted ways I hear stories through the grapevine about people who thought he was a great, experienced developer and how they worked on a project with him and saw the truth.
Sometimes, people really just are garbage developers who somehow skated through on merits they didn't have.
Lately I started to review much more code than I write. And what I can tell you is that is very easy to fall into the trap of thinking that something is obvious when you spend a lot of time within specific domain, codebase, or technology. If someone can't immediately tell what some straight piece of code does it usually says the code could be simpler or more idiomatic rather then they are ignorant.
While I'm not necessarily saying something's wrong with your code I wouldn't assume he's in the wrong or that he's stupid.
Besides I think it's pretty normal to ask authors about their code when you work with it.
> I am a bit hesitant to work with him because I think he is not very competent and when he do not understands anything, he will simply complain to my manager that its my fault and my manager, being his friend, will listen to him.
Has it ever happened? Don't overthink it, just do your job and provide help to colleagues when needed.
I want to emphasize that this is senior level thinking.
Code needs to be able to be understood by not only the best and worst on your current team, but also for the engineers you hire in X years that may not ask the right questions to the correct people or when the people who wrote it are no longer there.
So the best thing to do in those situations is exactly that - show a little patience. Work with him. In time you will either earn his respect (remember it does have to work both ways) or in the worst case you'd have gained enough experience handling him that you'd be ready to progress to your next role as a senior engineer. Perhaps even both. Plus in the process he might even surprise you by demonstrating that he's not so useless after all and in fact his blindspots aren't an inability to grasp simple logic but rather just gaps in knowledge for one specific framework amongst a wealthier repertoire of skills that you are yet to discover.
This is a little like the problems hiring managers face when trying to separate out those who are confident but lack skill and those who are confident because they are skilled. Or even telling apart people who are confident because they think they know what they're doing from those who do know. So maybe think about this as improving your none-technical career building skills?
I've met plenty of people like that. To tell you the truth, it was SO BAD that had I not seen it with my own eyes, I would have difficulties believing that people can be so incredibly incompetent.
I've also met "experienced" people, coming from the best "elite" schools in France (I'm french), that were unable to code their way out a paper bag, but were somehow working in programming or technical team roles. It's always stunning when you meet people who come from high studies, that involve quite a lot of programming, but who know NOTHING, how can they pass the exams is a real question, that puts in resious doubt the value of those schools. Two such people (technical managers) were fired for gross incompetence (after having us lose plenty of time & money). Unfortunately, many others (at various levels) managed to stick around and made things HARD for everybody else.
But the worst is when those people are also JERKS (or worse), as in the OP example. I've suffered A LOT because of that, as have my coworkers. And working as a contractor makes it super hard to get rid of them (though I managed it in one case).
Unfortunately it's not that uncommon, it happened to me before. The problem becomes worse when the people around (bosses, etc) have no technical knowledge whatsoever, and rely only on job titles to decide who should be in charge of what, and who to trust.
I've seen code written by a senior developer who writes
if some-predicate
// left blank.
else
// do something
end if
Because it's apparently too hard to work out how to invert logic. It's a pattern I've seen in our code base enough that I've started calling it 'if-meh-else'This is almost never the case. Please don't assume people don't know what they're doing, especially to such an extent. I would actually recommend attributing expertise and wisdom to their decisions until proven otherwise.
This particular construct is not a lack of understanding but often used to improve readability, transition code that may be in that block in the past or future, denote the normal vs exception branch, and several other scenarios. Did you ever ask why this person wrote it this way?
Semantically you're not saying "if X is true" you're saying "if X doesn't happen". It's a subtle difference and this format draws attention to it for the Next Developer.
It could be a convention to maintain semantic consistency in the predicate so you don't have to randomly flip your brain each time you encounter a new conditional statement.
Ask around. Could at least be a funny story behind it. The great not not of 2014.
https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence
>> 'In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, "I don't see the use of this; let us clear it away." To which the more intelligent type of reformer will do well to answer: "If you don't see the use of it, I certainly won't let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it."'
One must remember that code is not a paint and a canvas for you to feel like an artist but a documentation for for Next Developer to comprehend. One must write it like a book or some sort of navigation manual, drawing attention of the reader to the important parts and guiding them through intricacies of the requirements and logic.
if ((a and b) or (a and c and not d)) and not e)
should be something more like orderSubmitted = a and b
orderValid = a and c and not d
orderNotYetFulfilled = (orderSubmitted or orderValid) and not e
if not orderNotYetFulfilled {
# code here
}
Ideally, a through e are also named something reasonable enough that the variable declarations read cleanly.The raw de Morgan's transform is only necessary if it's a performance optimization, and in 2019 the conditions for that to be an issue are very, very precise.
It's also a stub where you can add logging or similar along the normal path without touching the conditional and risking introducing bugs by accident.
Depending on the language or runtime the empty clause will likely be factored out by the optimizer so there's no cost for extra readability and flexibility.
if(!some-predicate)
Maybe it's because you have to do the negation mentally.
But more ideally, it should be done with polymorphism or similar rather than using if..else.
That'd be something pretty silly to do. But sadly I've seen enough bad code that this would not surprise me.