Writing frameworks is a waste of time.
That is the conclusion after spending most of my time on my last project writing a framework, in order to make the project “easier” to write.
The trouble is every minute you divert to the framework, half of your project dies. And since there is an inherent division between project and framework, by the time you have everything working you have lost your original train of thought.
Then you realize: the project is way behind schedule; there goes a cool feature that could have landed you a multitude of sales. Or even worse, everyone has lost interest.
Instead, I suggest the following mode of thought:
- Find an existing framework that does most of what you require.
- If the framework falls short, rethink your approach.
- If you find your code has become a mess, re-factor it into a small library.
Don’t be tempted to spend time writing a monolith of a framework. And beware the trap of thinking you can turn it into a product in itself; after all, there is a reason why a large proportion of frameworks are free.