Home
  
  

WTF is JavaScript? Context for a Green Dev.

July 19, 2016

TL;DR: An attempt at providing some context for JavaScript.

There are plenty of tools for learning JavaScript. The intent for this post is to provide some general context for JavaScript's place in the contemporary development community.

The intended audience is those wanting to commit to learning to code, but who have minimal experience. I aim to provide a quick background on things I wish I'd groked (i.e., understood) sooner.

Any feedback would be massively appreciated!


What the what is JavaScript?

When people ask what JavaScript is, I usually say it's the thing that makes websites interactive.

When a website is running in a browser (right now), there are 3 languages that make it happen: HTML, CSS, and JavaScript. HTML is the content: the headlines, the paragraphs, the buttons, the links. CSS styles this content, setting fonts, colors, layout, and handling animations. JavaScript performs actions associated with websites, such as sending data from the browser to the server, saving items to a shopping cart as you browse, or loading more content as you scroll down.

We call working with these browser languages "front-end" development. When you click a button to login to a website, front-end JavaScript code takes that username and password, shapes it into a nice and compact data format, and sends it off to another computer. This other computer is usually referred to as a "server", and that's where "back-end" development happens.

That server (aka computer) that's waiting for your password? That could be running JavaScript too, or any other programming language. Javascript has recently (in the last 5 or so years) become a popular back-end language through a framework called NodeJS.

JavaScript runs in every browser

JavaScript is special because every modern browser uses it to run websites. The ubiquitous adoption across Chrome, Firefox, Safari, and Internet Explorer has created the internet as we know it. The result is an explosion of opportunity and demand for websites that use Javascript to get things done.

This browser adoption combined with the stabilization of NodeJS has given rise to the current JavaScript community: it is certainly one of the most popular languages in the world, and can be used for just about everything.

The JavaScript community is anyone who writes JavaScript. Welcome! Developers use it to build businesses, personal websites, blogs, games, and more tools to make writing code easier.


JavaScript is a great language to start programming with

New developers often ask what language they should learn first.

JavaScript isn't necessarily the right choice for everyone - the right choice is really the one that you are most interested in. As much as you can energize yourself to get into the weeds. Two thoughts: follow your energy, and focus on finishing.

Inevitably I am pressed for a real answer. I always recommend JavaScript.

Reasons:

  • Wide applicability: JavaScript can be used to accomplish most of the things you'll want to build: (websites, mobile apps, games). Many businesses run on JavaScript - you can easily build your whole career on it. And if you want to be developer, you will only benefit from knowing it.
  • Low(er) barrier to entry: JavaScript is a relatively more forgiving language to learn, and you don't need to install anything to get started: you already have a browser! (unless you're reading this with some other crazy voodoo... hey, how'd you get in there?!)
  • Tons of (free!) resources via a HUGE community: This lets you learn at your pace, and promises that help if you need it. Though I'll tell you right now, the best advice you'll get: "read the source!" of whatever tool you're using. The sooner you start there, the sooner you'll actually know what's going on.

Use the Source, Luke

If you're looking for 'the source' for Javascript, a great place to start reading is Eloquent JavaScript. It's not light, but is a great place to start understanding JavaScript and it's place in the programming universe.

Let's get into these reasons a bit.

Is JavaScript easy (easier) to learn?

Programming Languages are trending toward ease-of-use, which makes the argument for JavaScript as easier-to-learn trickier now than it used to be. New languages are on the horizon!

Couple that with all the tools required to run a fully-fledged JavaScript app these days, and this argument can go either way.

An aside to explain that a bit more

The size of the JavaScript Community can sometimes be a double edged-sword; while it is wonderful to have so many tools to make our lives easier, it also means keeping up with it is constantly learning what all the new tools are.

The benefit for you, young padawan, is that because the community moves so fast, you are never far behind. JavaScript is as easy as hopping on the track and jogging with everyone else for a while - soon enough you're caught up with everyone.

Soon after that, you'll realize that the framework you just spent 3 months learning has become 'old', and the whole thing is sham. When you get over that, you'll realize we're all just trying to get data into the browser and see what the users do with it. So it's no big deal, just keep trekking along.

JavaScript is less painful up-front

Running JavaScript on your own computer requires nothing more than the browser you are reading this blog post in.

In fact, you can open the Developer Tools of your browser right now and write some JavaScript right there if you want to. (TODO: link to post walking through this process!)

That feels like a pretty low barrier to entry - whether or not you would-be-dev readers will be brave enough to try it RIGHT NOW is another question.

There are more reasons why I think JavaScript is easier to learn, but that I won't get into the details of in this post. Specifically, JavaScript is a dynamically typed language and an interpreted/scripted language. As the posts on those topics come together, I'll update the links here for those willing to brave it. For now, Wikipedia, StackOverflow, Quora, etc. You know, the Internet.


It's a jungle out there

When you get out there in the real JavaScript world, you're gonna see just how full of it I am, presenting all this hunky-dory JS is easy crap, telling you it's all fun and games.

It's not all fun and games! Learning to program is a giant pain in the ass, and even though I love it, every day of work is dealing with things are truly a giant pain in the ass!

You're going to find out that JavaScript is a state of ridiculous fragmentation (but how could a large community not be fragmented, really?).

That modern JavaScript is more or less a 'complied' language (so to speak) depending on which 'future' (ECMA) version you want (the latest, I promise).

That tools called 'Babel' are trying to help but that we really don't need them now that NodeJS has gotten it's act back together.

Once you move on to some other languages with features like type systems, you'll learn just how much JavaScript may have been lacking all this time.

All of that might be gibberish to you, and don't worry! Things are always getting better, and this stuff only starts to make sense once you start exposing yourself to it.

Programming is one of the most rewarding things you can do. Finding solutions to difficult problems, having that eureka moment when something finally works - if you enjoy those moments, you will enjoy writing code.

Things not to be afraid of

My biggest goal with this post is to provide a starting point for someone looking for a broad place to dive into JavaScript head first, and to quell fears of the brutal size of the JS community. I also tried to avoid tossing out gibberish keywords all over the place, which is definitely a difficulty of learning this stuff. The JavaScript world has MANY tools and phrases and keywords, and is totally overwhelming.

Don't be afraid! The details will only sink in if you keep swimming in them. My friend and mentor told me early on that the articles I read on the web that I understand the least, the ones that that introduced the most new ideas - those are the really valuable moments in your growth. Disgesting new information starts with familiarizing yourself with the new lingo.

To that end, I'm pulling together a list of potentially off-putting WTF terms that you may come across in your travels. If you see any that you'd like a little background on, or that you would have liked to have seen in this context, please drop me a line and we'll add a TL;DR to aid the next traveler.

  • JSON: JavaScript Object Notation is a structure for handling data. These days, when you move data between the browser and a server, you do it as JSON.
  • HTTP: Hypertext Transfer Protocol is one way that computers communicate with each other, and the most common method for modern web applications.
  • NodeJS/Node: This is a framework for writing backend applications in JavaScript.
  • npmjs/npm: A tool built into NodeJS, NPM stands for Node Package Manager and is used to download javascript libraries from the world!
  • Angular/React/Ember/Backbone: These are front-end JavaScript frameworks used to create large-scale web applications. If you are working on the front-end, you will definitely be working with at least one of these.
  • SPA/Single Page Application: An SPA is just another word for a web application - it is referred to as 'single page' because you can access many different 'views' without the url changing. Ex: Facebook's homepage (and Facebook in general). I don't like this term because I don't find it useful... I always think, what's the difference really, and there's not much to know there. I don't know if I've ever heard anyone actually use it. Nevertheless, you see it often enough, so here it is.
  • Tooling!: Babel, Gulp, Grunt, Brunch, and on and on. JavaScript has tons of libraries that exist for the sole purpose of making it easier to write more JavaScript. Features like live-reload (automatically refreshes your browser for you when you save your code file) will dramatically speed up the time it takes you get your work done.
  • Library/Framework: These terms refer to projects that you can use to build more things. Coding projects fit together like legos, and our libraries and frameworks make it possible to do alot more with alot less. A Library is typically smaller than a Framework, and less demanding. You would use a library to get a utility task done (like encrypting a password), while a framework would ask you to write your code in a structured way to work properly (like structuring a web application in ReactJS).

Soldier on!

If you've made it this far, you're a trooper. I hope this has done you some good!

I'd like to end this with a list of resources and next steps, but as I haven't put that together yet, for now you're gonna get these tidbits.

For those who learn by doing, there are tools like codecademy and freecodecamp (and many more) that will help you get some quick practice in.

If you want to learn JavaScript, the language, I recommend Eloquent JS (mentioned above as well).

If you want to get started on your own website, I'm working some blog posts toward guides like that, but don't expect to do too many - there are just so many already.

Please reach out or leave a comment if you have any ideas for how this could be more helpful!


Russell Matney

Russell Matney

Software Engineer, Writer, Indie Game Dev