Programming

Minification Failed. Returning Unminified Contents.

Posted on

Has you ASP.NET applicaiton reported that minification failed? If you are using bundles in application, you might come across this exception comment at the top of your larger-than-expected bundle file. /* Minification failed. Returning unminified contents. (List of problems here) */ It can happen for JavaScript or CSS, but it means minifier has found something […]

Programming

Using a Proxy to Intercept Methods

Posted on

This is just a short note on how to use an ECMAScript Proxy to intercept methods. There are plenty of examples that intercept properties, but examples with methods seem absent currently. For demonstration purposes, we’re going to intercept a very famous method. The console log method takes any number of arguments of any type. This […]

Programming

TypeScript Optional Chaining Interim Method

Posted on

ECMAScript has an optional chaining proposal on the way (see TC39 on GitHub). It uses ?. to chain together an expression in a way that forgives a breaking chain. For example, myObj.items[0].data can fail if myObj is null, or undefined, or doesn’t have an items member, or there are no entries in the items collection, […]

Programming

Catching Null and Undefined Without Side Effects

Posted on

This article simply promotes the use of the statement if (x == null) when you want to check if a value is either null or undefined. I keep on having to explain this point, because catching null or undefined without side effects is important. If we break the statement down, there is a very important […]

Programming

Stop Writing Web Firmware

Posted on

This has been a problem for a long time. It was a problem with jQuery, it was a problem with AngularJS, it is a problem right now with Angular, Aurelia, Vue, and React. None of these frameworks are at fault, but there is a huge industry-wide issue with people writing all of their code inside […]

Programming

Continuous Delivery and JavaScript Bundling

Posted on

As the JavaScript and TypeScript communities move towards module loading in greater numbers, the topic of bundling came up in conversation. Bundling has that deceptive sparkling aura of “best practice” around it that means people can think you should just use bundling as a default practice. I am hoping to disrupt this thinking, particularly for […]

Programming

Eval is not Evil

Posted on

We’ve all read JavaScript: The Good Parts, and there is plenty of wisdom in Douglas Crockford’s landmark work. His reminder that eval is evil has echoed through the JavaScript community and saved many people from a total mess. However, as programmers we must remain thinking individuals who question received wisdom. You must resist inappropriate use […]