background preloader

Best Practises

Facebook Twitter

Writing Modular JavaScript With AMD, CommonJS & ES Harmony. When we say an application is modular, we generally mean it's composed of a set of highly decoupled, distinct pieces of functionality stored in modules.

Writing Modular JavaScript With AMD, CommonJS & ES Harmony

As you probably know, loose coupling facilitates easier maintainability of apps by removing dependencies where possible. When this is implemented efficiently, its quite easy to see how changes to one part of a system may affect another. Unlike some more traditional programming languages however, the current iteration of JavaScript (ECMA-262) doesn't provide developers with the means to import such modules of code in a clean, organized manner. It's one of the concerns with specifications that haven't required great thought until more recent years where the need for more organized JavaScript applications became apparent. Instead, developers at present are left to fall back on variations of the module or object literal patterns. Today it's embraced by projects including Dojo (1.7), MooTools (2.0), Firebug (1.8) and even jQuery (1.7).

App.js. Writing Modular JavaScript With AMD, CommonJS & ES Harmony. TasteJS (tastejs) Building A Relationship Between CSS & JavaScript. Advertisement jQuery, Prototype, Node.js, Backbone.js, Mustache and thousands of JavaScript microlibraries all combine into a single undeniable fact: JavaScript is popular.

Building A Relationship Between CSS & JavaScript

It’s so popular, in fact, that we often find ourselves using it in places where another solution might be better in the long run. Even though we keep JavaScript, CSS and HTML in different files, the concepts behind progressive enhancement are getting all knotted up with every jQuery plugin we use and with every weird technique that crops up.

Because JavaScript is so powerful, there are a lot of overlaps in capability between JavaScript and HTML (building document structure) and JavaScript and CSS (injecting style information). I’m not here to pick on any JavaScript library, bootstrap or boilerplate; I’m just here to offer a little perspective as to where we are and how we can realign our goals. Image Credit: opensourceway1. (Smashing’s side note: Have you already pre-ordered the brand new Smashing Mobile Book2? jQuery. The W3C Markup Validation Service. Unicorn. The JavaScript Code Quality Tool. A Brief Guide to Understand Responsive Vs Adaptive Web Design. Web design is evolving.

A Brief Guide to Understand Responsive Vs Adaptive Web Design

Designers are ideating innovative design concepts to cut on the renderability issues, optimize load times and make sites search friendly. Web design’s new ‘buzz words’ are concepts like responsive, scalable and adaptive layouts. However, there has been a great debate between the responsive and adaptive layouts, so how should designers, and clients, differentiate these methods and apply them for a website template? Let’s understand both the concepts in depth: With the increased use of smart phones and tablets, the ‘one-size-fits-all approach’ isn’t necessarily the best practice any longer.

So what is the difference with adaptive design? Fluid Grids vs. Both responsive and adaptive web design projects have many similarities. However, responsive web design relies on flexible and fluid grids whereas adaptive design relies on predefined screen sizes. Client Side vs. Technically, both are used for mobile optimization. Responsive Web Design is Not the Future. In 2000, The FWA (a popular website awards program) gave their prestigious Site of the Year award to Look and Feel New Media, shown below.

Responsive Web Design is Not the Future

Visit the site for some context of what I’ll be discussing, but turn down your speakers or headphones because it has background music. The Look and Feel New Media site is a simple Flash website by today’s standards, but it was state of the art back when Flash was an innovative web technology. Now, thirteen years later, with the capabilities of HTML5 and CSS3 standards, Flash is now on the way to extinction in the sense of, at the very least, modern web design and development. Even Flash technology’s owner, Adobe, decided to discontinue the development of this ubiquitous rich media platform’s mobile version. So what does this have to do with responsive web design (RWD)? Well, responsive web design has gained an enormous amount of momentum since its introduction in 2010 through an article named "Responsive Web Design" published on A List Apart. Complexity.