If you are writing a framework, a library, or just any kind of abstraction, don't pretend it to be perfect, it won't be (by law). The closests you can get to perfection will be by means of finding and documenting its imperfections. That means that whenever someone using your framework must do something which it doesn't support, they'll know and they'll be able to work around it instead of spending time trying to use your framework for (or trying to adapt it to) something which isn't (good) handled by it.
Yes, when you find some of these cases you'll be often tempted to solve it in your framework. You can try, of course, but if it does add some complexity (whatever small it could be), please forget it and document it clearly. Everyone wins!
No comments:
Post a Comment