tag : how to

Dependency Injection With Node.js

Recently, I went over Dependency Injection to help you understand a simple way to decouple your code a little bit and help your testing out. Sometimes, though, in Node.js a module will depend on a system API provided by Node, which can make it pretty difficult to make sure that private dependency is being used properly. Normal dependency injection doesn’t work in this situation, but don’t give up hope just yet.

Dependency Injection With JavaScript

When looking through design patterns that help to decouple objects in your applications, one of the simplest techniques to use is dependency injection. This is a common practice in Backbone.js, most notably when assigning models to views, but I haven’t seen it as much as I think I should. Here I’ll be examining what dependency injection is, how it helps, and how I’m putting it to good use in my latest project.

Plugging Into Socket.IO: Advanced

Last week, we looked at the basics of using Socket.IO. As we went through that, we discovered that Socket.IO affords us a very simple API based entirely off of sending and receiving messages and being notified of those messages through events. Well, there’s more to Socket.IO than that. It has several advanced features that can come in very handy in certain situations.

Plugging Into Socket.IO: The Basics

WebSockets are starting to become available in more and more browsers. In fact, at this point in time, pretty much the latest version of every browser supports it according to Can I Use. The best part, though, is that you don’t even need a modern browser with WebSockets available in order to utilize the real-time back-and-forth communication between the browser and server that it offers. Socket.IO will show you how it’s done.

JavaScript Fundamentals: Variables

I have never heard of a language that doesn’t use variables, and JavaScript is definitely not an exception to that. Variables are handled differently in each language and to become a true JavaScript expert you’ll need to understand how JavaScript handles variables too. For the most part it’s very straightforward, but there are plenty of “gotchas” you’ll want to be aware of.

Delay Initialization With jQuery Delegation

As the internet fills with more and more JavaScript code, we need to become more and more aware of the impact our code has on performance. One of the big pain points can come from all of your code being initialized and loaded during jQuery.ready() or (if you’re a good boy who puts all the code at the end of the document) right away. We can delay some initialization until later, right?

JavaScript Fundamentals: Functions

In JavaScript, functions are an integral part of development. They are what contain all of our amazing functionality (hence the name function) and run it whenever we deem worthy. With functions we can make code nonlinear, more organized, and easier to understand. We can also do some crazy stuff with functional programming.

JavaScript Fundamentals: Objects

JavaScript is an interesting language. It is quite different from any other language I’ve used, and it takes a while to really notice and understand the nuances if you don’t have a good way of learning. I’ve decided to start a Fundamentals series to help push the more basic knowledge out to a wider public, since I’ve noticed many non-expert JavaScript programmers frequenting the blog. Today, we’ll start with Objects.

Scalable JavaScript Applications

JavaScript applications continue to grow as the web grows. We’re all learning that using application frameworks, such Backbone.js, Ember, Knockout, AngularJS, and countless others, but do these frameworks offer everything that we need? According to some very smart JavaScript programmers, there’s still a little more needed if you want a truly scalable JavaScript application.

Impressive Presentations With Impress.js and Extensions

Recently, there have been numerous JavaScript libraries released that make creating presentations in the web browser _somewhat_simple, and many geeks are jumping on the chance to depend less on Microsoft and start using their web development skills in new domains. This is an introduction to one of those libraries and a demonstration on how to extend it to make your job as a presenter even easier.