At our company there is some problematic developer. This guy works for more than 10 years for that company, so he has a profound domain knowledge and many people consider him competent. Because he knows that, he always thinks that he is right. But that's only half of the story.
This guy has stopped gaining programming skills a long time ago and he never made an effort to become better. I believe that good programming skills will not come from experience only, but from actively focusing on widening your knowledge.
This guy is resistant to good advice when it comes to writing maintainable code. Specifically he has the opinion that copying and pasting code is preferable over generalizing code, because then you can't accidentally introduce errors which affects unrelated code.
All pioneers of object-oriented design (like Martin Fowler, Kent Beck etc.), who have made great contributions to this community, tell us that we should focus on eliminating duplication and that following the DRY (Don't Repeat Yourself) principle is a good advice.
So my question is, how can I argue to get him to understand that he is wrong. How can I approach him to change his mind?
Thank you guys for all the great tips. Let me give an answer to your questions. First of all I went to that company nearly three years ago so I am not a senior in the sense that I am the one who dictates an answer.
I am just a guy with a high level of motivation who permanently improves himself. Secondly the person I am referring to is Deputy head of the department for development. This was not possible because he always delivered a high code quality but because he gained a profound knowledge of the business. Despite that, the company was very small for a long time and it lacked other capable team members.
I didn‘t mention that I am right just because Martin Fowler says so but because there is some evidence suggesting it. We are facing a growing number of problems concerning the overall quality. We need much time for modifying and maintaining the application and our team permanently introduces new bugs as well as regression bugs because of lack of encapsulation.
To complete the picture, we do not practice any code reviews, nor are we able to write unit tests for this application because it is a monolith. Our company has nearly no coding standards at all and there does not exist any real expert. As long as the complexity of the program was small, this code-and-fix paradigm seemed to be good enough (but „good enough“ is relative).
At the beginning of writing the application, our team consisted of three persons (the guy mentioned in this thread, a designer and me). Other coworkers do exist but they work on other projects. A half year ago a fourth man joined us. Fortunately he shares my view and he recently informed the department manager of the problems we are concerned with.
Therefore, I do not think that I am wrong. And everyone who says, that I am disrespectful and condescending, has a faulty perception of the situation. As you can see the stone only began to roll. Therefore, I am looking for advice because I think that I may profit from this situation. It is my aim to introduce coding standards and propagate a different programming paradigm so that our team becomes capable of delivering high-quality code.