This is very true. I once had to implement a form with a table that looked a bit similar to three already existing forms that were implemented with some shared classes. I studied it and concluded that it was just too different to make use of the shared code and simply copied parts of the shared code. Took me about a day to get it working. Then another developer, who had worked on these three other forms saw what I had done and decided to integrate the four forms. Took him almost three weeks to get it working. I did not protest or made any remark about it, because I had done similar things in the past and sometimes 'wasted' time by trying to find the most beautifull abstaction, while at other times it did work out great. The intuition of when to avoid duplication or not, like so many other thing, only comes through making lots of mistakes. Luckily this other developer solved some bugs in the process, so the final result was an improvement.
fjfaase•3m ago