November 13th in Basics by . 2 comments .

Show Love to the Strict Mode

If you’ve skimmed through the source code of o2.js modules you’ll see “‘use strict’” declarations at their top. The ‘use strict’ pragma forces JavaScript engine to run in strict mode, for the browsers that support it. Strict mode, as its name implies, obliges a stricter usage of the language. And …

Continue Reading
November 5th in Functional Programming by . no comment .

Everything You Need To Know About JavaScript Functions (and more)

Functions are the building blocks of any JavaScript module. In this tutorial, we’ll have a glance on basic principles behind functional programming in JavaScript, along with some lesser known features of JavaScript functions. This is mainly a follow-up, and a more in-depth analysis, of a former JavaScript Function Kung-Fu post. …

Continue Reading
October 29th in Discussion by . 19 comments .

An Editor You Will Regret You Haven’t Used Before (and Tips on Getting the Most out of it)

In a former article I slightly mentioned that if you were a JavaScript developer, Aptana Studio — with all its built-in JSLint support, intellisense, auto completion, task management features, and more… — was an excellent IDE for you. But as time passed by, I realized that along with its good …

Continue Reading
October 16th in Isolated Objects by . 1 comment .

A Little Known Encapsulation Technique in JavaScript: Isolated Objects

There’s not a single post in the blog that I’ve not mentioned or used the module pattern. The module pattern is really useful in encapsulating functions, objects, and static configuration constants; making them invisible and inaccessible outside the module‘s boundaries. Here’s a simple example, which we have elaborated in depth …

Continue Reading
October 11th in Unit Testing by . no comment .

Unit Testing with JavaScript — Part 4: Automation

Now that we know unit testing best practices; and we have a o2.Unit test runner to do assertions, run and report our test suites; and we know how to construct test suites to be used in this test suite runner; it’s time to develop a methodology that’ll enable us execute …

Continue Reading
October 4th in Code Organization Guidelines by . no comment .

Now You Can Organize Your JavaScript Code, and Collaborate Without Hassle

The most up-to-date, and arguably more “readable” version of this document, may be found at the o2.js github repository. 1. INTRODUCTION This document includes JavaScript naming conventions, best practices and recommendations to be used within o2.js source code, and examples. If there’s a particular JavaScript usage that’s not mentioned in …

Continue Reading
September 20th in Unit Testing by . no comment .

Unit Testing with JavaScript — Part 3: Getting Your Feet Wet

As developers with tight deadlines, we constantly feel overwhelmed; and as more pressure comes upon us, we tend to cut corners and start creating code that no one but God will even God himself cannot understand . In the former article we created a unit test runner to run a …

Continue Reading
September 18th in Unit Testing by . no comment .

Unit Testing with JavaScript — Part 2: Preparation

In the previous article, we’ve seen what a unit test is, and we’ve learned the best practices to write a proper unit test suite. Now it’s time to get our hands dirty . In this tutorial, we will create a unit test runner. Navigation This is Part 2 of a …

Continue Reading
September 16th in Unit Testing by . 8 comments .

Unit Testing with JavaScript — Part 1: Best Practices

Despite the fact that unit testing can add considerable value to the quality of your code, it can do more harm than good, on the long run, if you do not implement it correctly. It all depends on the quality of the tests you design. And it, in turn, depends …

Continue Reading
September 11th in Discussion by . no comment .

Who Else Wants to Fork me on github?

Up till now I have been using source.o2js.com as a repository for the source code of o2.js. Though I believe o2.js has matured enough to be collaborated with a larger community. So, from now on, I will be pushing the code of o2.js to github. Why git? Because git is …

Continue Reading
 Page 3 of 7 « 1  2  3  4  5 » ...  Last » 
o2.js _
Fork Ribbon