5 Tips to Write Fewer Uncaught Exceptions in JavaScript

Mon Jul 31 2017

How can you tell the difference between a website written by a front end developer and a website written by a full stack developer? Look at the JavaScript logs in the console. If it's full of exceptions, warnings, or log statements, it says a lot about the coder. To a front end developer who takes pride in her job, shipping code that causes errors or debug statements to appear in the console


Watching file changes with NPM Scripts

Wed Dec 28 2016

A year or two ago, front end developers had this sudden realization: task runners like Grunt and Gulp are just wrappers for existing CLIs, and using those CLIs directly is actually easier than trying to configure a task runner. Since then, the trend is to call your build tasks using npm scripts defined in your package.json.

I love removing dependencies from my project, so I was sold


Mobile geo-tagged photo demo

Mon Nov 21 2016

I am currently considering the merits of native and web applications for an upcoming project. It looks like browser support for access to hardware features like microphone, GPS, and camera is better than I expected, so I've made a quick demo of a feature that records the geographic coordinates at which a photo was uploaded, using the Camera and Geolocation web APIs.

Please try it out


My distant relationship with the DOM

Wed Oct 19 2016

There are two reasons JavaScript gets a lot of hate. The first is that Brendan Eich was famously given just 10 days to design the language, and then was denied any opportunity to make backwards-incompatible improvements. He pled with Netscape to let him release fixes, to no avail, for their fear of breaking existing websites. Poor guy - imagine if one of your most hurried high school essays


Editing remote files in Sublime Text

Tue Mar 22 2016

For the past year and a half, I've been editing files on remote EC2 instances using SSHFS to mount the remote and open it in Sublime Text. It's worked impressively well, especially with the reconnect option enabled, which persists my connection even after my laptop has gone to sleep.

Recently, however, my company has started integrating our software into our parent company's tech


Writing a template engine is hard

Thu Feb 18 2016

When I set out to write the Breadbox framework, the thing I was most excited about was writing my own template engine. Now, six months later, I can't express just how naive that excitement was. Not only did I not know what I was doing, but I had a grave misunderstanding of the limitations of regex in JavaScript which would send me down a path that ultimately let to me


Bower is doomed

Sat Feb 06 2016

I know it's a rookie mistake to make sweeping predictions about technology, but I haven't made the mistake yet, so I'm doing it.

Bower was built to be npm for the front end. The only real difference was that bower gave you a flat directory structure, while npm would build a deeply nested dependency tree which wasn't suitable for referencing from


Support both callbacks and promises in your Node modules

Fri Jan 29 2016

One of Rising Stack's top suggestions for being a good Node dev in 2016 is to export modules that support both callbacks and promises.

For example, when I made the manila template engine, I naturally wanted to support


My zero JavaScript hamburger menu

Mon Dec 07 2015

Perhaps it's odd to write about how to do something without JavaScript on a JavaScript blog. Here's my rationale: a good JS developer writes as little JS as possible. So being able to code interactions with zero JavaScript is the jackpot, right?

Anyway, here's how the menu button on this page works with CSS only. The key is to use a checkbox and hook into the


Persistent in-memory sessions for NodeJS

Thu Oct 29 2015

When I set out to write authentication for Breadbox, I had to decide if I wanted sessions to be stored in a database or in memory. The database option is the de facto standard, for a few reasons:

  • It's more scalable
  • It's more portable (session info can easily be shared between app servers)
  • It's persistent (if you restart your server the


Automating the Command Line

Sat Oct 10 2015

Designers are often put in a tough spot. They're expected to own HTML and CSS, which means they have to have a development environment. But that entails stuff like running a server, a CSS preprocessor, autoprefixer, managing npm or bower dependencies, using version control, etc. For simple projects, lucky folks can get away with something like CodeKit and a git GUI, but in most cases


Oops, I made another Node MVC Framework

Thu Oct 1 2015

So, the last thing you want to do right now is look at another JS framework. I get that. Don't worry, I'm not going to try and convince you to use it. In fact I would predict that as the language and browsers evolve we're going to move away from frameworks altogether, but that's a different topic. For now I just want to share a bit about what I intend to do with this