Category Archives: JavaScript
#ThatConference: Summer Camp for Geeks
Apparently I’ve developed some serious JavaScript credibility in the Chicago-land area. I just found out that both of my sessions were accepted for ThatConference in August! The titles of my sessions are: Sencha Touch 101: Mobile Apps Built with HTML5 … Continue reading
Book Review: The Node Beginner Book
One of my New Year’s resolutions for 2012 was to learn more Node.js… so I did a bit of Googling for good beginner’s resources, and I stumbled across The Node Beginner Book by Manuel Kiessling.
Considering the book’s title, I think the content is spot-on. Developers who are looking for an introduction to Node.js will find this book to be easy to understand, full of useful examples that are expanded in each chapter, and generally enlightening. Continue reading
JavaScript Mergesort: Top-Down vs Bottom-Up
In my continuing series on JavaScript algorithms, I thought it might be fun to examine two methods for implementing “mergesort”.
Mergesort is essentially a “divide and conquer” technique, where the algorithm breaks an array into smaller pieces. Each of the small pieces is sorted and then recursively merged back together.
Mergesort is an attractive option for sorting large arrays because it is fast… and we’ll look at its efficiency in a moment. However, it also has a disadvantage: the algorithm requires more memory than Selection Sort and Insertion Sort, so for systems in which memory usage must be kept low mergesort may not be a good option. Continue reading
Thoughts on JS Unit Tests: Phantom.js vs Node.js
I have written before about using the Jasmine framework for unit testing your client-side JavaScript code. If you’re not writing tests, you need to start… today.
I recently started exploring the option of using Node.js to run my tests… but after spending several hours diving into the matter I wanted to share some immediate thoughts. Continue reading
Book Review: jQuery Tools UI Library
jQuery Tools is a tiny (4k) standalone JavaScript framework that allows website developers to create common UI widgets without requiring the overhead of its larger jQuery cousin or a cluster of plugins.
I’m glad I was introduced to the jQuery Tools UI library, and I will probably use it when I build some upcoming websites. Continue reading
JavaScript: Selection vs. Insertion Sort
“Selection Sort” and “Insertion Sort” are two popular sorting algorithms. If they have the same Big-O notation, which is better?
The point here is that Big-O notation, although certainly helpful, doesn’t always tell us the full story. It’s great to know what the worst possible performance is for our code… but we need to know how often to expect that situation. Continue reading
JavaScript: Binary Search vs Linear Search
The linear search algorithm is often “good enough” for most applications. Although optimization would improve performance, the benefit might only be minimal if our data set (stored in an array) is relatively small.
But what happens to our algorithm as the data set increases in size?
I put together a short example comparing the expected (worst-case) and actual performance of these two search algorithms. Continue reading
JavaScript Encapsulation
I recently had a discussion with a colleague about encapsulation. We lamented the fact that many developers cannot adequately define, describe or otherwise communicate the concept during the interview process – even at the “senior developer” level.
After our conversation, I went home and Googled “JavaScript encapsulation” just to see what came up. After seeing the search results I am not at all surprised that few JavaScript programmers really understand the concept. I didn’t feel satisfied by any of the examples or definitions I found, so here’s my crack at explaining things. Continue reading
Book Review: Test Driven JavaScript Development
Test Driven JavaScript Development is probably the best book about JavaScript that I’ve read yet.
I realize that’s a bold statement to make, but I challenge anyone to name another book that (1) explains fundamental JavaScript concepts as clearly, or (2) offers specific advice on how to tackle an enterprise solution in JavaScript. Continue reading
Code Reviews: Why Your Code Sucks
Over the past few years I’ve been asked to perform Code Reviews on many web applications, often projects utilizing ExtJS or Sencha Touch.
I always enjoy peeking into the thought process behind an application because you never know when you’re going to learn something useful. As someone who takes an immense amount of pride in my profession, I strongly believe that education should never stop because someone will always do something better than you. At the very least, reading someone else’s code will trigger ideas of your own.
That being said, code reviews are sometimes fun… but more often frustrating. Continue reading
