Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at RIA Unleashed (Nov. 2010) with: Marc Esher
Ben Nadel at RIA Unleashed (Nov. 2010) with: Marc Esher

Recent Blog Posts by Ben Nadel

Error Object Properties Are Not Iterable / Enumrable In Node.js

Over the weekend, I was playing around with custom Node.js errors and error logging when I noticed something weird: none of the ".stack" properties (ie, the stack traces) were showing up in my log files. After a bit more experimentation, I realized that none of the core Error properties were enum... read more »


Thinking About Tracking Requests And Errors Across Micro-Services

Caveat : This is all just me "thinking out load." Take that as you will. As we start to break apart our monolithic applications, destructuring them into a collection of independently scalable micro-services, things simultaneously become both more simple and more complex. While each individual ser... read more »


Managing Conditional Links And Route Changes In AngularJS

Sometimes, in an AngularJS application, you have a context in which a particular link might not be clickable based on the current view-model state. In the past, I've dealt with this by either injecting the $event into the Controller (which is a code-smell and an anti-pattern); or, by hiding the loc... read more »


Using Bit Values In COALESCE() In MySQL Results In Binary Values

Every now and then, this one throws me through a loop: if you use a COALESCE() statement in MySQL , and one of the values is a BIT, MySQL returns a binary value, not a numeric value. In ColdFusion, this causes a problem because ColdFusion sees the resultant value as a Byte Array (like a Blob); as ... read more »


Using Module.decorator() In AngularJS 1.4

In the past, we've been able to decorate AngularJS services by using the $provide service in the configuration phase of the application bootstrap. As of AngularJS 1.4, however, the concept of a decorator has been promoted to the Module API, finally living alongside .service(), .factory(), .run(),... read more »


Using Anchor Tags And URL-Fragment Links In AngularJS

Yesterday, Derek Knox mentioned on Twitter that he was having trouble getting anchor links to work in an AngularJS application. And, by anchor links, I mean the ability for a user to click on an <A> tag and be taken to another location on the same page (typically identified with a name="" o... read more »


Fun With Emoticons And Service Providers In AngularJS

At InVision , we recently released emoticon support in comments. I wasn't directly involved with the feature, but I like it as a concept and I think it presents an interesting playground in AnuglarJS. So, I wanted to take a little time to think about how I might personally organize such a feature.... read more »


Quick Note: Favor $exceptionHandler() Over $log.error() In AngularJS

This is just a really minor note. I was looking through some AngularJS code the other day and came across someone using a try-catch block that passed the error off to the $log.error() method. While this works - it logs the error to the console - it doesn't add as much value as the $exceptionHandler... read more »


FusionReactor Offers Excellent Insight Into Java And ColdFusion Server Performance

I remember the moment that I got my first pair glasses down at Union Square in New York City. I was in my early 20s. It was shocking. Suddenly, the world was sharp. Street signs were visible. Presentations were visible. Nothing was fuzzy. The world was clear. This is kind of what it felt like when ... read more »


Performing Online ALTER TABLE SQL Migrations Without Any Downtime

The other day, I tweeted about how much I love the INSERT IGNORE INTO syntax in MySQL . In response to that tweet, Ken Auenson asked me what kind of a use-case I had for ignoring duplicate records. Typically, I use IGNORE when migrating and / or transforming data. And, since I don't think I've e... read more »


Rendering Large Datasets With AngularJS And ReactJS

There's been a lot of talk lately about the performance benefits of ReactJS. Both externally and internally on my own engineering team. This post doesn't really offer up anything new; but, as a diehard AngularJS fan, I wanted to see, feel, and experience the difference in performance for myself. Pl... read more »


Breaking Direct Object References At Cache Boundaries In AngularJS

After I blogged about encapsulating the localStorage API in an AngularJS application , a couple of people asked me about why I was using angular.copy() when returning objects from the storage service. This is a great question and is not something that I've ever touched upon specifically. The goal ... read more »


Sometimes I'm Tempted To Use Try / Finally In The Worst Way

Yesterday, I posted a tweet about how I am sometimes tempted to use a Try / Finally block as a way to get around creating an intermediary variable. I've never actually done this, as I think it's a bad idea. But, so help me, I have been many times tempted. And, while I still don't recommend it, I ... read more »


Encapsulating LocalStorage Access In AngularJS

The other day, the following JavaScript error starting showing up in one of our logs, "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota." After a bit of debugging, it turned out that this was the error that Safari throws, when running in ... read more »


An Experiment In What React's JSX Might Feel Like In AngularJS

The other week, I took my first look at ReactJS . While I believe that ReactJS and AngularJS do the same thing (in terms of the View), I'm trying to see what kind of cross-pollination of ideas I can generate. I already took a look at using a .setState() method in AngularJS . Now, today, I want to... read more »


Sending AngularJS Errors To New Relic, Raygun, Sentry, etc.

A few weeks ago, I looked at how to capture global JavaScript errors and pipe them into an AngularJS application . That approach works; but, it requires you to deal with the global error handler which is an unfortunate API. If you are already using a client-side error service like New Relic, Raygu... read more »


What If AngularJS Had A setState() Method Like ReactJS

After digging into ReactJS for the first time , over the weekend, I was very interested in the way ReactJS thinks about state. State, in React, isn't strictly immutable; but, the framework only reacts to it (no pun intended) when the state is mutated in certain ways - namely, when the .setState() ... read more »


Hello World: Comparing ReactJS And AngularJS

I love AngularJS. You know I love AngularJS. I write poems about AngularJS. But, at InVision App , some of the engineers have started using ReactJS; so, it's time that I start digging into ReactJS a bit such that I can remain relevant on the team and be able to jump in and fix bugs. Since I didn't... read more »


Consuming The Uniform jQuery Plugin In AngularJS

In the world of AngularJS, we concentrate so much on the View Model (Scope) that it is not always obvious as to how to consume functionality that reacts to the DOM (Document Object Model). Take, for example, the Uniform plugin in the jQuery ecosystem. The Uniform plugin presents more visually pleas... read more »


Piping Global Errors Into The $exceptionHandler Service In AngularJS

Out of the box, AngularJS has excellent error handling in so much as that everything that AngularJS "knowns about" is executed inside of a try/catch block. These managed errors are handed off to the $exceptionHandler service, where your application may or may not process them further. But, errors t... read more »


AngularJS In Firefox: TypeError: Missing Argument 1 When Calling Function b.get()

Yesterday, I was up until 11PM (which is late for me) trying to track down an AngularJS error that suddenly popped up and was only affecting Firefox users. The error seemed nonsensical and manifested as a problem in the $digest loop of the AngularJS framework. Firefox kept complaining that it was m... read more »


ngShow / ngHide Classes Get Applied In The $$postDigest Phase In AngularJS 1.3

The other day, when I was working on the AngularJS version of Absolute Grid , I noticed a small change in behavior in the way that the ngShow and ngHide directives were working. After digging into the source code a bit, it looks like there was a change in the default implementation of the $animate... read more »


Understanding How To Use $scope.$watch() With Controller-As In AngularJS

Right now, in the AngularJS community, the "controller as" syntax is becoming very popular because it disambiguates view-model references within the view. However, with the use of the controller-as syntax, people are also using the "vm" notation within their controllers. This is totally fine; but, ... read more »


Absolute Grid (ReactJS) Knock-Off In AngularJS

Right now, it's "cool" to hate on AngularJS. This is unfortunate because AngularJS is an extremely powerful framework. Sure, it has some problems in the same way that no framework is perfect. But, once you dig into AngularJS and understand how it works, there are very few problems that can't be sol... read more »


The Beauty Of Modular Code: Adding Different Transports To StatsDGateway

Earlier this week, I released StatsDGateway , which is a set of ColdFusion components that facilitate the sending of messages from ColdFusion to a statsD server. When I first wrote the library, it was a single component. However, after watching Corey Haines presentation on Simple Design , I went ... read more »


StatsDGateway.cfc - A ColdFusion Module For Communicating With StatsD Servers

A while back, I wrote an experimental ColdFusion module called GraphiteD.cfc . This was intended to allow ColdFusion applications to send statsD metrics to the statsD SaaS (Software as a Service), HostedGraphite.com . Most of the time, however, people are running a statsD server on their local ne... read more »


Thought Experiment: No Private Methods In Object Oriented Design

In the Sandi Metz / Hashrocket lunch-n-learn video, on "The Design of Tests" , she says something that I found particularly interesting. While discussing whether or not to test private methods, she mentions: There's a school of thought that says, you should never have a private method .... anythi... read more »


Added Manual String Serialization To JsonSerializer.cfc ColdFusion Project

A couple of years ago, I created a ColdFusion component - JsonSerializer.cfc - to help me serialize values in ColdFusion . There is a native method for this already - serializeJson(); but, going from a case-insensitive language to a case-sensitive specification is fraught with peril. That said, Js... read more »


Encoding And Decoding Base64url Values In ColdFusion

I've been using base64-encoding in ColdFusion for a long time; but, until yesterday, I had never heard of the term, base64url. Over the weekend, I was doing some research and development (R&D) with JSON Web Tokens (JWT) and I saw that the specification kept referring to "base64url" encoded valu... read more »


The Philosophy Of Extending Lodash In JavaScript

At work, I sometimes get into a philosophical debate about our use of the Lodash library. I love lodash and use it in our AngularJS applications all the time . But, I will often extend the lodash library with additional utility functions. This is where things gets heated. Some of the engineers que... read more »