Beginning JavaScript (JS Conf 2014 and Eloquent JS)

So, it’s week 7 at the Iron Yard and we’re starting to delve into more front end tech; here front end refers to all of the pretty shit on the client server side — think Yes, that’s a super broad definition ,and not quite on point, but for the purpose of this blog post will work.

Youtube is an amazing place to learn new skills or watch awesome talks that

a) couldn’t make it to

b) were made before you were born

c) only want to watch a snippet (come on you KNOW that you can’t really bail 2 minutes in at a conference)

With that said, I made the mistake of watching a JS Conf video BEFORE I had read Eloquent JS or any other books on javascript. Mistake. While the conference video was enlightening, I can’t exactly say that I had that grand epiphany that others watching the video may have had. I was unable to grasp a significant portion of the video because I couldn’t parse through some of the jargon. Did Roberts give a good speech? Yes. Would I recommend this video to people who are just learning how to apply console.log? Nope. Go read a few chapters in a JS book and then watch the video.

JS was created in 1994 by Brendan Eich; you might recognize him as the cofounder of Mozilla. Back in the Netscape days, Eich’s employer told him that he had 10 days to make a new computer language. WHHHHHAAAAAAATTTTTT? Who even does that. To give you some perspective Node took a little over two years. Eich’s new langague was called JavaScript. As you can imagine it was a little jacked because he only had 10 DAYS. Unfortunately, this buggy little language became the basis for our modern web. Why does this kind of suck? Well, that’s because no one can press a magical backspace key to simply delete/repair glitches in the original program to make it more compatible with current needs. Nope. Instead programmers have to create new features to creep around this quirky 10 day language. Brilliant. A large chunk of our global economy is built around a teeny-tiny buggy language.

JS has 6 value types: strings, numbers, booleans, objects, functions, and undefined values. JS has functions, which are like methods in Ruby. You declare a function and then state what it is supposed to do. Functions can have several perameters or no perameters. That flexibility is kind of cool. Not so cool is the messy confluence (messy to me because I am not familiar with it) or curly braces {} and functions within functions.

Not good segue: let’s talk about event loops. Event loops simply refer to the steps that JS goes through to process numerous functions/commands. What makes it different from Ruby or other languages is that JS is a single threaded language. Single threaded means that it can only do one thing at a time. For example, JS can’t make an AJAX request, while you are performing other code. Don’t freak out though. There are these things called APIs that are able to run like separate threads. JS has a data structure called a stack where it stores information. If the que (where it runs programs) is empty JS simply pushes some info from the data structure on to the que. BAM.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.