Why You Should Learn JavaScript

With Pam Selle, developer, speaker, author, and organizer of Philadelphia JavaScript Developers.

For me, it seems almost silly to imagine explaining why you’d want to learn JavaScript. I love writing it, love teaching it, and it’s pretty much everywhere these days. Let’s see just a few cool examples of where you’ll find JavaScript.

Did you know…

  • You can build robots with JavaScript?
    Yes, JavaScript can be used to build robots. With projects like johnny-five/nodebots and cylon.js, writing code to run robots is more accessible than ever. There are unlimited ideas you can come up with to use robots … such as to play with your cat (although I’d recommend keeping that fun for yourself).
  • You can make art with JavaScript?
    Two of my favorite art-friendly JavaScript projects, and there are a TON, are 8-bit art and three.js. Make 8-bit art is a project that is an in-browser editor for drawing 8-bit art projects (kind of like old video games). Meanwhile, three.js is for 3-dimensional programming, so people use it for art, games, visualisations, and more. Check out this cool project that uses three.js.
  • You can build websites with JavaScript?
    Okay, I had to put this one in here (I suspect you already knew it), so hear me out. Making websites is really awesome. It’s a great reusable skill that’s always in demand. But I want to take this a step further. Did you know you can write your whole website in JavaScript?Lots of websites have a “client-side” and a “server-side,” with JavaScript on the client-side and some other language on the server-side. However, with Node.js, that’s no longer true. Once you learn JavaScript, you can write any kind of web application.
  • You can tell stories with JavaScript?
    At one of my past jobs, it was actually my job to tell stories with code, and one of my favorite tools was JavaScript. In journalism, people are doing really exciting things. A very cool one is the Empire project (must use Chrome to view), which pushes the boundaries of interactive documentary. If you’re interested in journalism Source, from OpenNews, is a great way to learn about how people build Empire and projects like it.Additionally, there are a few language-learning reasons why JavaScript is a great language to have under your belt. Not only is JavaScript super cool, you also don’t need a special environment to write JavaScript. There’s no compiler (a program that processes code into a packaged output after running some checks and operations on it) to wait for. All you need is a text editor and your brain (a keyboard is good too). In fact, would you like to write some JavaScript right here, from this blog?

 Let’s write some JavaScript together!

(Provided you’re using Firefox or Chrome)

 

Right-click and “Inspect Element”

 

Click Console to enter the JavaScript console tab

 

Write out the alert statement exactly as it is in the image: alert(‘I just wrote JavaScript’)

 

Hit enter, and the statement will execute! (run)

That’s JavaScript! You can write it on any web page (don’t worry, things you write in the console are not saved), or write it for your own website, or use it in any of the cool ways I mentioned before.

If you’re interested in learning JavaScript, TechGirlz has some great resources, and if there’s not a workshop in your area, could help you set one up!