Make Any Framework Suck Less With These 10 Insightful Lessons
Alexey Migutsky in 2 years with Angular has a lot to say about Angular, which I can't comment on at all, not being an Angular user. But burried in his article are some lessons for building better frameworks that obviously come from deep experience. Frameworks will always suck, but if you follow these lessons will your frameworks suck less? Yes, I think they will.
Here are Alexey's Lessons for framework (and metaframework) developers:
- You should have as small as possible number on abstractions.
- You should name things consistent with your "thought domain".
- Do not mix several responsibilities in your components. Make fine-grained abstractions with well-defined roles.
- Always describe the intention for your decisions and tradeoffs in your documentation.
- Have a currated and updated reference project/examples.
- You abstractions should scale "from bottom up". Start with small items and then fit them to a Composite pattern. Do not start with the question "How do we override it globally?".
- Global state is pure evil. It's like darkness in the horror films - you never know what problems you will have when you tread into it...
- The dataflow and data changes should be granular and localized to a single component.
- Do not make things easy to use, make your components and abstractions simple to understand. People should learn how to do stuff in a new and effective way, do not ADAPT to their comfort zone.
- Do not encode all good things you know in the framework.