Practical JavaScript Meta Programming

Proxy & Reflect This article will show the basics to building a Proxy object that traps some standard object behavior, and implements some custom logic either in addition to, or in place of, the default behavior. It utilizes the Reflect object to perform the default behavior when applicable. I'll trap…

Extending Native JavaScript Objects

Disclaimer: This article is for educational purposes only. In these fun examples, I extend native objects. I don't advocate doing that unless you have consensus amongst your team and nobody else's code will depend upon yours. Let's have some fun with something that common wisdom says you should never do:…

Fun with JavaScript Proxies

Disclaimer: This article is for educational purposes only. In several of these fun examples, I extend native objects. I don't advocate doing that unless you have consensus amongst your team and nobody else's code will depend upon yours. Bend JavaScript to your Will There are more useful applications of the…

WeakMap for JavaScript Private Data

Private Data in JavaScript A common way that developers expose a public interface for interacting with private data in JavaScript is by using a closure. const EnginePart = (() => { // Don't want any other code to have direct access to this const _part_info = { part_number: "4104928345103", weight_in_kg: 1.7…

Why I Love Teaching

The rare, but heartfelt, thanks No software application I have written, or helped write, ever told me how much I changed its life. They just took and took, and never appreciated me. I ended up breaking up with every one of them. I even stopped stalking them on Facebook. However,…

Are Women Really Better Developers?

Remember back in February 2016 when some folks analyzed Github contributions and found that women wrote code that was accepted more often, as long as it wasn't obvious that they were women? Well, yes, that was one, relatively isolated, data point from which you really can't draw any conclusions, regardless…