JavaScript Paradoxes and Myths
JavaScript is eating the world and is undoubtedly on an upward trajectory. As I see it, it will continue it’s trajectory well into the next decade as long as browsers use it as the language that powers the web; it’s unlikely that this will change although there are people who oppose it.
JavaScript is inevitable, JavaScripters go to extremes, library authors force us into their way of thinking, but let’s save that for another article. Let’s observe some of the paradoxes and myths surrounding JavaScript:
Paradox 1: More JavaScript to create, less to perform
Much more JavaScript is required to implement the features our users love - we use transpilers, bundlers, different versions of JavaScript and a lot more in our journey to create modern applications and functionality. However, less JavaScript is required to make your site load fast!
We should be able to write as much JavaScript and still be able to achieve outstanding application performance. Is this even possible? Think about it.
Paradox 2: We create the problems we solve
We have a desire to create the best user experiences, with more activity and features that are embedded into the psychology of our users, bringing them back. We wish to to use a single library or toolset that will magically act as a silver-bullet when we build a website or application.
JavaScript’s sole purpose was the browser, and now it’s everywhere.
Myth 1: JavaScript doesn’t scale
I hear this often from other developers and I understand it’s easy to use a blanket statement; if you don’t care enough to intimately understand the language, you begin mimicking others. JavaScript scales, that’s why it’s used in all the libraries that you consume on a daily basis (Angular, React, Vue, all use the DOM). Its how you author your JavaScript that doesn’t scale well, and that’s why we have standards, conventions, linters and code formatters. Yes, the list is long and distinguished!
Being thoughtful and deliberate with your approach, standards / patterns will help you scale your vanilla JavaScript.
Myth 2: Libraries are the source of truth
This, in my opinion is the biggest misconception , especially as I observe younger developers. They gravitate to the libraries / frameworks first, learn what’s library-centric and almost discard the rest of language (till they need to learn it). If you speak to many about the prototype object, they haven’t a clue, but yet they know what state is :) Yes, libraries help us avoid boilerplate and make some great decisions for us, but also expose us to challenging decisions; decisions that take both knowledge and experience to define a scalable architecture.
JavaScript is the source of truth and it powers all the libraries, utilities that we consume on a daily basis. Get to know this language intimately.
As I think about how we’ve arrived at our current state, it’s clear to see there is a huge battle surrounding the JavaScript ecosystem and the browser (esp. the browser, it’s been happening for decades) - companies, teams, library authors and their communities push their agenda on impressionable minds, and kool-aid get’s drunk over and over.
There are some amazing and very talented people behind the scenes, but why should they have all the fun? The fun is in authoring JavaScript and understanding it’s essence so you can make the best decisions for yourself.