BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Design Patterns for JavaScript Applications

| by Jan Stenberg on Sep 10, 2013. Estimated reading time: 1 minute |

We are writing increasingly larger and more complex JavaScript applications using the latest frameworks and libraries but we tend to overlook the core principles involved in the creation of these libraries Carl Danley, a senior web engineer, motivates the start of a series of blog posts about JavaScript design patterns. Patterns provide a clear approach to writing structured, scalable and maintainable code, concepts which all are extremely important when developing large JavaScript applications

Some of the reasons why Carl finds the use of patterns so important are:

  • Patterns are an easy way to refer to a very specific implementation of code while avoiding the additional discussion it would take to get everyone on the same page if the vocabulary used for patterns didn’t exist.
  • Patterns can help in overcoming minor issues at an early stage thus preventing them from becoming major issues later on.
  • Patterns exemplify a level of sophistication that can provide both performance boosts and reduce memory usage.
  • Patterns are established through rigorous testing and, for the most part, helps solving a particular type of problem.

Carl quotes Addy Osmani, author of the book Learning JavaScript Design Patterns:

One of the most important aspects of writing maintainable code is being able to notice the recurring themes in that code and optimize them. This is an area where knowledge of design patterns can prove invaluable.

So far Carl has covered the following patterns:

For each of the patterns Carl describes the purpose and main use cases together with advantages and disadvantages. He has also written a small example for each of them.
His plan for the near future includes the Factory, Mixin and Decorator Patterns.

Carl has contributed to a number of open-source frameworks and libraries e.g. jQuery, WordPress, Backbone and Angular.js.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT