Home » JavaScript » How to design a useful Javascript framework

About Mike Mainguy

Mike Mainguy

How to design a useful Javascript framework

Based on my highly scientific analysis, there are currently 13.98 javascript frameworks per javascript developer. I’ve personally been on two projects where a framework was built, completely scrapped, and rewritten BEFORE THE PROJECT WAS DELIVERED!

Based on this observation and the literal wasteland of half baked frameworks available, I’m sharing some insight on how to design a useful framework. Follow these rules and you’ll have a higher probability of having something useful, ignore them, and well…I guess that’s your choice, I won’t hate you for it (OK, maybe I will a little).

Step One: Pick an existing framework

No, this is not a tongue-in-cheek joke, this is reality. Unless you initially demonstrated your framework at Bar Camp back in 2006, you should start with something that already exists and first deliver your project with that.

Step Two: Find things that the chosen framework doesn’t do well

Now look at your product that is “code complete” and do an analysis of where your most common bugs happen, where new developers trip up and make mistakes, or where the code is repetitive. If nothing stands out…STOP, you’re done. If there are rough edges, analyze approaches to the rough edges, and see how other EXISTING frameworks solve the problem. If nobody’s solved it or if you think you’ve found a better way, refactor your code and enhance your chosen existing framework.

Step Three: After doing this for 4 to 5 years, and you’ve found better patterns or something novel, write a framework

Note, this step seems to be the one everyone skips (even authors of currently popular frameworks). Experience is important, attempting to write a framework after doing a “TODO” list app because you discovered something you don’t like is a recipe for disaster. Moreover cross posting your new framework announcement across the internet to “make a name for yourself” is irritating and counterproductive.

Step Four: Write some useful applications using your framework

If you’re starting a new javascript framework and haven’t USED it, your chances of building something that is generally better than what already exists are vanishingly small and you’re likely expending energy on something that, will not advance the state of the art by anything remarkable and is much more likely to be a step backward.

I don’t mean to discourage creativity, and still encourage folks to experiment and try things out…but temper your enthusiasm with reality until you can clearly illustrate how your new framework is better. In addition, be sure to look at your baby objectively…warts and all.

Reference: How to design a useful javascript framework from our WCG partner Mike Mainguy at the mike.mainguy blog.
(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Web Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. Building web apps with Node.js
2. HTML5 Programming Cookbook
3. CSS Programming Cookbook
4. AngularJS Programming Cookbook
5. jQuery Programming Cookbook
6. Bootstrap Programming Cookbook
and many more ....
I agree to the Terms and Privacy Policy
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments