Learning JavaScript

One of my main goals for 2016 is to learn JavaScript. Not only because it’s being touted as the future of WordPress, but also because I felt like JavaScript (JS) was one of those very critical web languages that was missed when I took web design and development courses during my Graphic and Interactive Design program. I’ve also come across some really instances where my lack of JS knowledge has been a bit of a roadblock, not to mention the downright awesome shit that can be done with JSt. Have you seen ustwo’s REST API-driven site? It’s fucking amazing and totally driven by JavaScript.

The Plan

If you’re going to learn something, and learn it well, you need a plan, right? After a bit of digging, and I found a really great resource called JavaScript.isSexy (oh yeah it is!). They have a [free!] program they call, How to Learn JavaScript Properly, and it’s totally legit. Not only is there a plan for total n00bs like myself, but they have a guide for experienced developers too (which my husband is currently working through–the family that learns JS together, stays together, amiright?!). So no need to start with the very basics of programming if you already know a thing or two!

The resources they suggest for the beginner track are rather simple, and the only expense is the book:

  1. A book: Beginning JavaScript
  2. Four articles on JavaScriptIsSexy.com
  3. Four Codecademy tracks
  4. Four Code School tracks

Week 1 Review

I started working through Week 1: Making a Website with HTML and CSS; Learn JavaScript Data Types, Functions, Control Flow, and Loops last week. As someone who’s been working with WordPress daily for the past year or so, writing loads of functions, loops, etc., I found this to be a relatively easy, yet interesting week.

The thing is, almost all of my PHP experience has been trial by fire. As in, I have an idea of what I want to do, and roughly how I want to do it, and then proceed to do a reasonable amount of Google searching to find the answer, or better yet, have my code reviewed by a fellow WordPress developer who could help me work through problems and optimize my code. But this week’s reading in on JavaScript has helped me better understand some of the things I’ve been doing. Like for loops, for example. To get multiple images in my portfolio posts, I use a for loop to cycle through the images and generate the markup like this:

https://gist.github.com/carrieforde/8ced7b37b5c62f4bac1a

I had a rough idea what that for loop was doing before, but now I definitely understand what it’s doing, and that’s pretty awesome. Not only that, but I’ve got conditional logic down (if / else if / else) as well as other types of loops (while / do…while).

Every time I learn something new, I try to challenge myself to come up with an original exercise to practice my new JS skills. Here’s my favorite from this week (note: if you try to run this, it will create some pop-ups for user input):

Improving this Course

I know it’s early days, and I’m really stoked about this course and the track I’m on, but I definitely think there are a few things to that could use improvement.

  1. The website refers to Edition 4 of Beginning JavaScript, and I decided to purchase Edition 5. Not a big deal, but there are definitely differences in chapters in the latest edition, and it might be helpful if the Beginning track was updated to reflect the latest edition of the book.
  2. Codecademy is really boring. They basically spoon-feed you information, and it becomes tedious really quickly. I’ve been finding that the best part of Codecademy are end of track challenges.
  3. Consider swapping Codecademy for Treehouse. Yes, I know one advantage to this plan is that the only expense is the book, but the Treehouse Full-Stack JavaScript track is legit, and a really nice supplement to this course. So for now, I’ll be using the book, Codecademy, and Treehouse as resources.

On to Week 2…

I’m really stoked about Week 2: Learn JavaScript Objects, the Browser Object Model (BOM), and Events; Learn jQuery. I’ve dabbled a very small amount in jQuery over the past few months, and what I’ve tried and learned so far has been awesome (check out the category and archive toggles on Clayton Gerard’s site for some nifty jQuery slideToggle action), and I’m looking really forward to learning some new tricks to improve the interactivity of sites I create going forward.

Is anyone else out there trying to learn JavaScript? What sources are you finding useful?