Mastering `this` in JavaScript

JavaScript developers—new and experienced—constantly rate the variable this as a major pain of the language. The this variable, which represents a function’s context, plays an important role in everyday JavaScript programming, so understanding how it works is critical. This blog post gives an overview of this and its many quirks and forms. We will lay out the four ways to set a function’s this value, as well as discuss some common use cases and pitfalls.

Read More

Taming Asynchronous JavaScript with Async.js

JavaScript is often described as asynchronous, meaning that function calls and operations don’t block the main thread while they execute. This is true in some situations, but JavaScript runs in a single thread, and therefore has lots of synchronous components.

It’s more accurate to say that many function calls in JavaScript can be made asynchronously. Web programming essentials like DOM event handlers and AJAX calls are asynchronous, and because these common tasks make up a great bulk of JavaScript programming, JavaScript itself is often labeled "asynchronous."

Read More

6 Easy Ways to Prevent Your Heroku Node App From Sleeping

sleeping cat

Heroku is an excellent application platform that I personally use for all my Ruby and Node projects. Their free tier is enough to accomplish pretty much any task, but it comes with one giant limitation: your app will go to sleep after an hour of inactivity.

When your app is asleep, the next user to access any of its resources will have to wait while the app spins up, resulting in a suboptimal user experience. Here are a few ways to get around this limitation and keep your Heroku app awake.

Read More

What I Learned Building My First iOS App

Farecast for Uber

With the advent of Swift and the Apple Watch around the corner, I felt that the time was right to start learning iOS development in earnest. I’ve been down this road before. The ugliness of Objective-C and the seemingly endless red tape required to get into the App store thwarted my earlier attempts at app development. But this time was different, thanks to Quick Left’s internal iOS learning club and this series of video tutorials by Bitfountain.

After about a month of development, I was able to get my first app into the App Store, and have just recently hit 500 downloads! Here are some key takeaways I learned during my first foray into iOS.

Read More

Making Your App Work Offline: Tips and Cautionary Tales

offline mode

We recently completed a sprint on a big feature set for one of our Angular.js projects: offline mode. The goal was to enable the user to perform as many actions offline as possible, all while maintaining a smooth, reliable experience with no data loss.

This is not a blog post about the general capabilities of offline mode in HTML5, nor a how-to guide for setting up offline mode in your app. (Here is a great resource for that, if that’s what you’re looking for.) This blog post will address the quirks and edge cases that came up in real life development. Hopefully they’ll save you some time with your projects!

Read More