4 ms·
I don't think so. Let me explain from my experience. I have been asked to create a payment gateway for a company. We found an elegant solution that consisted
by lmilcin 5y ago
I don't think so.
Let me explain from my experience.
I have been asked to create a payment gateway for a company. We found an elegant solution that consisted of general components that we could just configure and wire together so that we will never need to write another payment gateway.
This was a mistake and we found it on next project that involved adding new payment method.
We found that yes, it could be rewired and configured without any development at all. But the process to do so took so much effort, that we would just be able to write a new payment gateway in less time.
The simpler (but less elegant) solution would be to just write the minimum code necessary (of course still neatly and nicely), and then implement the other payment gateway separately. We should have then extracted common model and infrastructure until there is nothing left and we again are left with a single, coherent application.
We have prematurely optimized, put a lot of upfront effort for unknown benefit. The benefit happened to be negligible and the resulting code was complex and costly to work with.
But sure it looked elegant.
Now that I am wiser for this lesson I am trying to use patterns to produce simple dumb code that models the problem well enough without details that are not necessary for the particular instance of the problem.
- dgb23 5y agoIf I understand correctly you exposed an interface that was too general (AKA low level) for the user's semantics. It seems to me that this interface was fitting for you as the developers to write new features on top of though? In other words, if with think in terms of simplicity then maybe the right approach was to have the general interface as your abstraction layer and on the higher layer you have something that is semantically close to what your users understand. The general layer would be simple as I understand it and provide the building blocks for the more specifically designed user interface.