I took this at 5am.

I am definitely maybe suffering from Javascript-related Stockholm syndrome.

Scott Wey
4 min readMar 23, 2018

--

According to Wikipedia, there are four components that comprise Stockholm syndrome:

  • No previous hostage-captor relationship
  • A hostage’s development of positive feelings towards their captor
  • A hostage’s belief in the humanity of their captor
  • A refusal by the hostage to co-operate with police forces and other government authorities

No previous hostage-captor relationship

I was never a huge Javascript guy. I’d use jQuery from time to time. Sometimes, I’d use it to make some AJAX calls and maybe change an element or two on a Rails app I was working on. Life was simple, with jQuery doing most of the grunt work and me doing nothing at all. I didn’t need to know much about Javascript at all and that was the way I liked it.

I was eventually asked to develop a desktop application for authoring media-heavy multi-language content. Not wanting to descend into the waking nightmare that is Java Swing that I had learned to hate in graduate school, I quickly picked up Angular (1) and Electron. It was magical.

Almost as magical as this. I just really needed to share this.

A hostage’s development of positive feelings towards their captor

I loved how simple everything was. I could write to disk as often as I wanted using Node’s NON-BLOCKING IO (very web-scale). Callback hell was a little difficult to deal with, but then I learned about Promises and entered Promise hell. The fires in this hell were a little less intense, so it was all good. Even better, I now reside in the promised (haha get it) land of Async Await.

Anyhow, Angular truly felt like magic the first time I used it. I would change the application’s state and things would just appear! I didn’t have to use selectors or iterate through DOM elements like some sort of neanderthal. I didn’t understand how the lifecycle worked at all, but who really wants to? Not me. I want to keep the magic alive.

Nobody wants (Angular) sausage after they see how it’s made.

— a very wise person

Of course, this quickly bit me in the ass. My completely unoptimized code was slow sometimes (all the time). So, like any responsible and capable developer, I arrived at an obvious conclusion: Angular was the problem and there was nothing I could do to fix it. I needed to switch frameworks, to use something faster, more performant, and most importantly, with better benchmark scores.

I moved onto React. With React came stage-0 proposals, Babel, Webpack, boilerplates, functional programming, great hair, Redux, GraphQL, CSS in JS, and much more. I now spend my time away from work preparing for work, reading about the hottest new packages, jumping on every bandwagon I can. Maybe I should use Parcel, it’s zero configuration and probably knows what’s best for me. I’ve abandoned all non-Javascript languages for the backend. How else am I going to get my SSR-game on? Javascript is all I need.

A hostage’s belief in the humanity of their captor

I think Javascript is a pretty good guy. You can iterate SO FAST. Compiling? What’s that? Think of all the time you’ll save not waiting for stuff to compile. Sure, there’s essentially no native type system and all sorts of dangerous type coercions can happen, but hey, that’s what Flow and Typescript are for, right? Transpiling is fine and very fast! There are no problems here.

Sure, bugs in the original Javascript implementation have become part of the spec. But look, Brendan Eich had to hack together all of Javascript in a few days. Can you blame him? No. Nobody’s perfect. Except for Javascript. Javascript is perfect.

Javascript is very human. Most teams I’ve worked with are fluent in Javascript. Look at all of the NPM packages. I’d wager that it encompasses all of human knowledge. If there was to be a language to transcend all languages and bring all of humanity together, I would bet on Javascript. Is there a Babel transform for Esperanto? That’d probably be a good start.

To Javascript is human.

— Alexander Pope

I feel this point about ‘belief in humanity’ is somewhat tenuous. You can tell I’m really stretching. Javascript isn’t a human being. Although, Javascript is pretty weird and unpredictable, as are humans.

A refusal by the hostage to co-operate with police forces and other government authorities

The local police have been in a standoff outside of where Javascript and I have been holed up for the last 47 hours. I can’t be sure if I’m actually suffering from Stockholm syndrome because I’m not just a very cooperative person in general. But what I do know is that I’m not coming out of the deep, dark hole that I’ve dug myself into.

I like it here. There’s everything I could need or want. I’m very comfortable here. This is who I am now. If anyone is feeling charitable, please throw some food down here if you can. In the meantime, I think I’m going to take a nap. I’m very tired from all of this Javascripting.

--

--

Scott Wey

Does anyone know how much code one should write for the existential dread to go away? Asking for a friend.