Three things I love about JavaScript

Scott Dooley
Skills Matter
Published in
3 min readJan 10, 2019
Fly responsibly near airports with a JavaScript-enabled Drone

Comfortable with HTML & CSS, it felt like the logical next step would be to learn JavaScript.

In choosing a programming language to learn, I was looking for something that would enable me to pursue my own ideas on the web. To build something a lot more exciting than just a blog.

I’d tried learning languages like PHP, Python and Ruby before but until this point, nothing had quite stuck. To my surprise, so far, JavaScript has.

The reasons why are the three things, that for the purpose of a good blog title, I love about JavaScript:

1. Being Declarative

What do we mean by declarative?

By definition:

Declarative programming is a programming paradigm … that expresses the logic of a computation without describing its control flow.

Imperative programming is a programming paradigm that uses statements that change a program’s state.

Source: https://en.wikipedia.org/wiki/Imperative_programming

In simple terms:

  • Declarative code tells the what.
  • Imperative tells the how.

My preferred analogy is how Circo puts it. Declarative is like going into a bar and asking for a drink. Imperative is like going into a bar and asking the bartender to pick up a glass, to add ice, to turn on the tap…

Efficiency aside, the main thing I love about writing declaratively is how good it looks.

// Least Declarativevar bestProducts = [];
for(var i = 0; i < products.length; i++) {
var product = products[i];
if (product.rating >= 5 && product.price < 100) {
bestProducts.push(product);
}
}
// More Declarativevar bestProducts = products.filter(function(product) {
return product.rating >= 5 && product.price < 100;
});
// Most Declarative - Implementation hidden in functionvar bestProducts = getBestProducts();

Ahhh… visual clarity.

JS you are absolutely flawless.

Well not quite, but good enough.

I love it.

2. The Learning Community is Awesome

There are so many high-quality learning resources available and many are completely free.

To learn the foundations, I completed Dylan Israel’s course on Scrimba. It gave me everything I needed to get started, providing a comprehensive understanding of:

  • Data types
  • Variables
  • Strings
  • Numbers
  • Booleans
  • Arrays
  • Objects
  • Arithmetic operations
  • Relational operations
  • Increment & decrement
  • If, else if, else
  • Switch statements
  • For loops
  • Functions

After studying the foundations of JavaScript, I moved on to projects.

The amount of free step-by-step guides you can find elsewhere on Medium is impressive.

Being able to quickly build my own version of things like:

split up by tinkering with useful GitHub projects like:

is enough to keep me loving JavaScript.

Outside of courses and projects, another great thing is that the JavaScript community is very active.

We all know that learning is full of lots of ups and downs — especially with programming languages. Concepts can be hard to grasp, and error logs are error logs.

Very quickly you get stuck.

The good thing is that with JS, it’s easy to get unstuck.

When a particular feature or keyword stumps you, a youtube search is often all that’s required to get your head around it. Or you can turn to one of the 1,741,665 JavaScript tagged questions on StackOverflow.

I love it.

That’s right, I almost understand what this means.

3. You Can Use it for Everything — it’s the Lingua Franca

I used to think of JavaScript as a language only for the web. In particular, I thought its only use was in the browser — the language you needed to know to build annoying parallax effects, and to track users web behaviour — the ad pixel language.

But as soon as I got my head around how React, Vue and Node fit into modern web development I realised what was possible.

Seasoned pros are probably bored of hearing it but it’s true:

Any application that can be written in JavaScript, will eventually be written in JavaScript — Atwoods Law

Knowing that you can use JavaScript to write iOS/Android apps or to programme iOT Devices and Robotics is the cherry on top.

The scale of opportunities, put at arms length by some well-documented and user-friendly technologies, means there’s always something new to apply your skills to. Keeping the JavaScript bond strong.

In summary, I have to say it:

I love JS.

But don’t quote me on that.

👍 For news and articles from Skills Matter, subscribe to our newsletter here.

--

--

Scott Dooley
Skills Matter

Growth marketer 📈. Data-obcessive. Always learning new things. Ethical, privacy-respecting marketing is possible — measuredcollective.com