Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
Ben Nadel at BFusion / BFLEX 2009 (Bloomington, Indiana) with: Simon Free and Dee Sadler
Ben Nadel at BFusion / BFLEX 2009 (Bloomington, Indiana) with: Simon Free@simonfree ) and Dee Sadler@DeeSadler )

Recent Blog Posts by Ben Nadel

NgRx Store Reducers Work Using A TypeScript Feature Called A Discriminated Union

Lately, I've been trying to understand how, when, and where to use a store-based state management approach like NgRx Store (or Redux, or MobX, etc). I'm currently 75% of the way through Todd Motto's NgRx Store course ; and, I've recently raved about Angular University's article, NgRx Store - An A... read more »

Environment Variables Represent Global State And Should Be Accessed By The Application Bootstrapping Logic Only

The more experience that I get with Node.js (ie, JavaScript on the Server), the more I've noticed a rather odd pattern: reusable modules and 3rd-party libraries making reference to Environment Variables. As an industry, we JavaScript developers have generally agreed that "global state" is "not a go... read more »

Binding RxJS Observable Sources Outside Of The NgZone In Angular 6.0.2

Last week, I took a look at tracking the scroll percentage (0-100) of the Document (or any arbitrary Element) using RxJS . In that post, all of the Observable events triggered by the "scroll" interaction were meaningful to the subscriber. And, as such, it made sense that every scroll interaction s... read more »

Functional-Light JavaScript By Kyle Simpson

Last night, I finished reading Functional-Light JavaScript by Kyle Simpson . I know that Kyle - commonly known as " Getify " in the JavaScript community - has published a number of books over the last few years (ex, You Don't Know JS ); but, this is the first one that I've read. And, it's reall... read more »

Monitoring Document And Element Scroll Percentages Using RxJS In Angular 6.0.2

Lately, has been coming up a lot in my Google searches when researching the Angular web development framework. Not only does have quality content, they also have a nice, clean site design. One of the little delighters that they have on their site is a progress bar the in... read more »

Static Methods Can Access Private Class Constructors In TypeScript

Yesterday, in a TypeScript lunch-n-learn that Rob Eisenberg was leading here at InVision , we started talking about various ways in which we could make class Constructors impossible to invoke from outside of the Class context. This got me thinking about Static methods; and, their ability to acce... read more »

Proof Of Concept: Using Axios As Your HTTP Client In Angular 6.0.0

The other day, I was listening to Wes Bos and Scott Tolinski talk about learning new technologies on the Syntax FM podcast . In that discussion, Wes mentioned that one aspect that's great about working with an unopinionated framework is that you can bring your own favorite libraries with you a... read more »

Experiment: Injecting A Component Reference Into A Pipe Instance In Angular 6.0.0

A few months ago, I created a Pipe for Angular 4.4.0 that would pipe a value through a method of the current component . Only, it wasn't really a "method" in the bound sense - it was a free-floating, naked Function reference. This Function reference could be implicitly bound through the use of a F... read more »

The Angular Framework Forces You To Learn More JavaScript, Making You A Better JavaScript Programmer

CAUTION: This post is entirely tongue-in-cheek (ie, not meant to be taken seriously). The very idea that a framework can force you to learn more or less JavaScript is completely ludicrous . And, any engineer that suggests otherwise has clearly not yet had sufficient caffeine. The only thing that ... read more »

Translating Viewport Coordinates Into Element-Local Coordinates Using Element.getBoundingClientRect()

Some user interaction events provide positional meta-data about the event in relation to the browser's viewport. For example, if you highlight text, the Selection API reports the bounding box of the selected Ranges in relation to the viewport . In order for your application to react to such events... read more »

Sanity Check: Manipulating Event Handlers And Timers Outside Of NgZone In Angular 5.2.10

CAUTION : This is primarily a "note to self" post. Yesterday, as I was recording the video for my Medium-inspired (textSelect) Angular directive , it occurred to me that I didn't have a great mental model for Angular Zone / NgZone / zone.js. I knew that I could bind an event-handler outside of t... read more »

Creating A Medium-Inspired Text Selection Directive In Angular 5.2.10

The other week, I started experimenting with the browser's Selection API , using it to draw outlines around the selected text based on the DOM (Document Object Model) Rectangles emitted by the embedded Range objects. As a follow-up to that experiment, I thought it would be fun to try and build a M... read more »

Using Node.contains() To Determine If One DOM Node Is Inside Another

This post is primarily a "Note to Self"; but, the other day, I was reading through the Mozilla Developer Network (MDN) site - as you do - and I noticed that the Node interface in the Document Object Model (DOM) API has a .contains() method. This method checks to see if one node is contained within,... read more »

Going Offline: Designing An Ideal Offline Experience With Service Workers By Jeremy Keith

Books in the "A Book Apart" series are just a pleasure to read. They are often the perfect length with just the right amount of content. They cover complex ideas; but, always make sure to cater to readers who are newer in the industry. They feel informal; but very professional. Going Offline: Desi... read more »

90% Of Design Is Picking Good Margins And Making Sure Things Line Up

Coming up on twenty years ago, I had an internship at a company in New York City called Kokopelli New Media. There, I had the opportunity to learn from some of the most amazing people like Glen Lipka , Ben Peters , and Ye Wang . It was there that I first learned about ColdFusion - the programmin... read more »

Leaders Are The People We Bleed With - Not The People We Bleed For

For the last few days, I've been obsessing over the ending of Braveheart - one of my favorite movies of all time. Now, I don't know how I got started in this direction; but, I've been thinking about the one line of dialogue that brings the Scotsmen into their final battle with the English. It's n... read more »

Designing Distributed Systems: Patterns And Paradigms For Scalable, Reliable Services By Brendan Burns

Over the weekend, I read Designin Distributed Systems: Patterns and Paradigms for Scalable, Reliable Services by Brendan Burns . I really enjoyed this book; although, I must admit it wasn't exactly what I expected. The description of the book barely mentions containers. And, while the patterns d... read more »

Outlining Text Selections Using The Window Selection API

Lately, I haven't been feeling terribly creative. Quite blocked, actually. And, as Ze Frank would recommend, I acknowledge that creativity is outside of my rational control . So, in order to get back to a good place, I need to just keep the machinery firing and hope that the creativity returns. So... read more »

The Daily Prime: Docker Experiment And A Source Of Daily Inspiration

Last month, I published a blog post on my journey from complete Docker noob to Docker novice running a Docker host on DigitalOcean with Nginx, Node.js, DataDog logs, DogStatsD, and free LetsEncrypt SSL certificates . That was a huge milestone for me; but, it was just the beginning of my Docker edu... read more »

Reporting StatsD Metrics From The Browser In Angular 5.2.9

Last week, I discovered that you could listen for IMG error events using event delegation (so to speak) if you attach your event-handler to the Capture phase of the event life-cycle. As someone who works on a SaaS (Software as a Service) product that is based heavily on client-side image renderin... read more »

Practical Monitoring: Effective Strategies For The Real World By Mike Julian

In my ongoing journey to better understanding monitoring and logging (my big hairy goal for 2018), I just read Practical Monitoring: Effective Strategies for the Real Work by Mike Julian . I really enjoyed this book. Not only does the author write with a friendly and welcoming tone, he strikes a... read more »

Tracking Image Error Events Using Event Delegation In JavaScript

At InVision, the primary asset is the Image. On the server-side, we know everything about these images: size, density, orientation, how long it takes to resize them, and whether or not they can even be thumbnailed properly. On the client-side, however, we don't do a lot of active tracking for image... read more »

Effective Monitoring And Alerting By Slawek Ligus

At work, we've fully embraced the concept of "measure everything." We've wrapped StatsD ( DogStatsD ) timing metrics around all external calls; we record the latency of all web requests; we monitor HTTP status code volumes in nginx; we use New Relic to observe CPU utilization and Garbage Collection... read more »

Using An AtomicLong With A Modulo Operation May Be Faster Than Using compareAndSet() For Thread-Safe Range-Based Counters

Last week, I looked at using Java's AtomicInteger class in order to loop over a range of numbers in a thread-safe manner without having to add any additional locking to the code. The core of the logic revolved around executing a while(true) loop that repeatedly invoked a .compareAndSet() method u... read more »

Using Multivariate Feature Flags In LaunchDarkly To Drive Operational Settings Like Minimum Log Level

After having used LaunchDarkly as our feature flag service provider for several years, I'm taking a fresh look at their documentation in order to see what new hawtness they offer above and beyond the traditional On / Off toggle. Yesterday, I looked at LaunchDarkly's ability to target users based o... read more »

Using LaunchDarkly To Target Personally Identifiable Information (PII) During Feature Flag Evaluation Without Leaking Sensitive Data

At InVision , we've been using LaunchDarkly as our feature flag service provider for the last few years; and, it has completed changed the way that our teams think about feature deployment. But, we've been using LaunchDarkly for so long that we've missed out on a lot of the new features they'v... read more »

Using Java's AtomicInteger To Loop Over A Range Of Numbers In ColdFusion

The other day, as part of my cuid for ColdFusion implementation , I had to create an internal counter that looped over a static range of numbers. Once the counter reached its upper-bound, it reset back to zero. Since this was operating in a multi-threaded environment, I decided to use Java's Atomi... read more »

Enterprise Integration Patterns: Designing, Building, And Deploying Messaging Solutions By Gregor Hohpe And Bobby Woolf

Over the weekend, I finally finished reading Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by coauthors Gregor Hohpe and Bobby Woolf . I've been reading this 700-page tome since the beginning of February. And, while there were two chapters at the end t... read more »

Adding Slug Generation To cuid For ColdFusion

Yesterday, I released cuid for ColdFusion - a ColdFusion port of the cuid library. In my initial write-up, I omitted the "slug()" method because it felt only tangentially related to the concept of UUID generation. However, after a conversation with James Moberg , I decided to add slug generation... read more »

cuid For ColdFusion - Collision-Resistant IDs Optimized For Horizontal Scaling And Performance

At InVision , we've decided to use Eric Elliott 's cuid library when it comes to generating UUIDs (universally unique IDs) in our upcoming microservice-based, highly distributed version of the platform. The cuid library provides collision-resistant IDs that are optimized for horizontal scaling ... read more »