I do not know about you but when I write software I get excited about all the possible things I can do to solve the problem I am currently looking at. Personally I find it easy to get carried away with all the clever things I can do with various methodologies and software patterns and architectures etc, etc. you get the idea.
And many years ago a read about something you may have heard of called the second system syndrome. Not heard of it? I have been involved a number of times in helping to architect various types of subsystems and when I look back and review what I have done I try to think how I could have written any part of the code in a better way.
However this can lead to a pitfall. The second system syndrome can kick in and when you come to write another subsystem you try to fix all the problems you saw on the first system. Before you know it you have been working on the new subsystem or system for a long time but do not seem to have got very far.
So what is the solution between writing code which is not of a high quality and yet is not so overengineered that it never get’s off the shelf?
Personally I do not think there is one. With each code block you write I think you have to make a judgement call. A call between keeping the code simple enough so make sure that it is possible to release, but using enough complexity to make the code maitainable, testable and using SOLID principles. All the things that are associated with code of a high quality.
There may be times when it is not appropriate to use all the solid principles. Do you really need TDD for a 50 line utility program. Where are your testing points? Does your code really need 100% static analysis or would 50% be enough?
Ultimately the more complex the code that is written the less understandable that code is to someone reading it for the first time. And code which is not so underdstandable is not so maintainable.
In my mind there is a balance to be had, like a pair of scales, between complexity and maintainablity and I try to keep this in my mind when I am writing code.