Pitfalls to Avoid When Moving from Clojure to ClojureScript

I’ve been excited about ClojureScript, its community, and the new tools and libraries that have been appearing, but I’ve only recently started working with it. Using ClojureScript to power a web (or mobile) client to a Clojure backend service seems really compelling. It’d allow for easily sharing code or logic between the different components, as well as a well-designed implementation of modern UI development, via Om Next. It’s also a fun and enjoyable language.

However, while exploring ClojureScript, I’ve run into some areas that left me feeling frustrated. Read more on Pitfalls to Avoid When Moving from Clojure to ClojureScript…

Emacs vs. WebStorm for Node.js Development

If you’ve ever worked with me, or read my blog posts, you know I am an Emacs junkie. Emacs is my first and last editor, and I’ll happily spend hours making it just the way I want it.

Lately though, I’ve been doing a lot of Node development and feeling some pain from using my favorite tool. I also recently ended a large Java project where I had been using IntelliJ as my editor, since it was much more advanced than anything Emacs could offer. Since I had been using IntelliJ and some other JetBrains products, I was aware of WebStorm, their IDE geared towards JavaScript development. Read more on Emacs vs. WebStorm for Node.js Development…

Precision Decimal Math in JavaScript with decimal.js

On my current project, we’re doing a lot of math with dollars and cents on a Node.js server. We’re not just adding, but calculating discounts and taxes and the like. Typically, one would do money math in JavaScript by representing the amounts as decimal numbers and using floating-point math.

Unfortunately, floating-point math is not as precise as we’d like it to be, especially when it’s dealing with lots of operations. Read more on Precision Decimal Math in JavaScript with decimal.js…

Plato: A JavaScript Static Analysis Report Generator

I have recently been playing around with plato, a JavaScript static analysis and source code complexity tool.

Plato utilizes a node module called complexity-report to generate a report with statistics about various aspects of your source code. The plato Github page contains sample reports for a few notable project repositories: jQuery, Grunt, and Marionette. Each plato report includes the following statistics for each source code file:

Read more on Plato: A JavaScript Static Analysis Report Generator…

Write More Maintainable CSS with Purple Prose

On a large project, CSS often becomes messy and difficult to maintain. Selectors get longer and longer, reaching deeper and deeper into the DOM. Properties override each other. Fonts and colors have to be specified for just about every element. And the dreaded !important begins to rear its head.

Before long, team tension is palpable. Fortunately, there’s a better way.
Read more on Write More Maintainable CSS with Purple Prose…

Using ES6 in Node.js

My team recently upgraded our Node version from 0.10 to 4.0 for a big app we are working on. Lots of improvements came in the upgrade, but by far, my favorite is all of the ES6 features now available natively in Node.

Just to be clear, Node 4.0 does not exhaustively support ES6. It implements a lot of the biggest new features, all incorporated from the upstream V8 engine. Getting all of these features–especially without having to set up up a build process with Babel or another compiler–has been a huge win for our team. We’ve been able to write cleaner, better JavaScript, and we’ve been gradually refactoring our app to use the new ES6 features. Read more on Using ES6 in Node.js…

Creating Vertical Alignment with Susy and CSS Flexbox

In the middle of a responsive page using Susy, I encountered a layout which required vertical alignment across different kinds of elements, ideally without hard-coding a dimension anywhere. I wondered, could Susy and Flexbox play nicely together to create this complex layout? Indeed, they could and they did! Read more on Creating Vertical Alignment with Susy and CSS Flexbox…

Unit Testing Frontend Network Requests

Unit testing is a great way to help ensure the continuous delivery of working code over a product’s lifecycle. In client-side applications, unit testing data retrieval is especially important since using data from these asynchronous calls is at the core of what most of these apps do.

Unfortunately, asynchronous calls aren’t easy to test. Read more on Unit Testing Frontend Network Requests…

Why I Choose ClojureScript

I’ve always enjoyed learning different programming languages. I’ve had colleagues who wished one language would emerge obviate all the others, but not me.

For me, programming languages are like food: it’s the variety that makes it fun. Every language makes different tradeoffs, they elevate different ideas, express them in different ways. Each is a unique tool in my toolbox. Read more on Why I Choose ClojureScript…

Read more on Why I Choose ClojureScript…