Home

Error message

  • Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; views_display has a deprecated constructor in require_once() (line 3047 of /homepages/3/d267786686/htdocs/pangus/includes/bootstrap.inc).
  • Deprecated function: Methods with the same name as their class will not be constructors in a future version of PHP; views_many_to_one_helper has a deprecated constructor in require_once() (line 113 of /homepages/3/d267786686/htdocs/pangus/sites/all/modules/contrib/ctools/ctools.module).

Moving Forward with Javascript: Back to Basics - Part II

Part II - The Basics?

Check out Part I - Before the Basics

Now that you have some tools to get you started let’s climb into the shallow end of the swimming pool and start working our way over to the deep end. This post is the second part of the Moving Forward with JavaScript: Back to Basics series where we explore the tutorials at NodeSchool NodeSchool as a way to explore the fundamentals of modern web development.

javascripting

If there is a programming language that symbolizes the web it is JavaScript. It used to be only for front-end features but is, since the end of 2009, being used increasingly for managing the back-end as well. Baby-steps. This tutorial teaches the very basics of the JavaScript language including the various variable types and control structures as well as arrays, objects, functions, and scope. Practice and learn these tutorials as they are the base for everything JavaScript that follows. You can also use this tutorial as an opportunity to practice your newly acquired git and markdown skills.

Further Reading:

Scope Chains and Closures

This short set of tutorials covers global and local scope, chaining, closures, and garbage collection in JavaScript. Knowledge of how global and local variable scope works is crucial to writing clean, bug-free code while chaining and closures are patterns for writing code than can help clean-up and encapsulate your code. And while garbage collection is managed automatically, knowing how it works and interacts with your code is vital to really understanding closures. As you move forward with web development you will see many frameworks take advantage of things like chaining and closures.

Further Reading:

elementary-electron

Build cross platform, native, desktop apps using JavaScript, HTML, and CSS. This very simple tutorial walks you through installing Electron, creating a ‘Hello World’ app, and even a way to download cats (in PDF form)! This is a great example of how JavaScript is not just for jazzing up the front-end of your websites; Atom, Slack, and Visual Studio Code were all built with Electron.

Further Reading:

learnyounode

An introduction to some actual Node.js. Not just reading about it or using something that uses it. Actually use Node.js during these tutorials. These are probably the hardest to complete so far compared to the rest of Parts I and II, building on all of the skills you have learned up until now. You will especially need an understanding of the material covered in the javascripting and the scope, chains, and closures tutorials as this tutorial is not so much a tutorial but a “you need to know at least how to do these things” list with some hints on how to do each item. You will need to make sure you understand how to utilize a project’s/module’s/library’s documentation and maybe even pull out some Google-fu to find relevant examples.

So what is Node.js and why is it part of the fundamentals? Node.js is not a framework or library for using in your applications, it is an open-source JavaScript runtime environment to serve up your applications to the world. While knowing how to use Node.js is not strictly required for all JavaScript-based web development I think you’ll find it hard to work with JavaScript and not run into it from time to time. If you aren’t working directly with Node.js these days, chances are you are working with something built on or with a tool built on Node. There are many frameworks built on top of Node.js including Express.js, Meteor, Socket I/O, and Connect which are designed to accelerate the development of web applications. These frameworks often abstract away much of the heavy lifting needed to get some applications to a functioning state quickly so when something goes wrong, if you are familiar with Node you may spend more time than needed finding a solution.

Further Reading:

stream adventure

Learn how to utilize streams to modify, manage, and aggregate data by using pipe and packages like through, duplexer, and concat-stream. Because of Node.js’ asynchronous nature it is possible to use streams to simplify handling I/O operations. This set of tutorials starts with some basic I/O transformation operations and works it way up deciphering gzipped files before re-encrypting the contents as output. I found this tutorial set to be quite instructive as I do not normally work with streams in this manner and plan on trying to find ways to utilize pipes for any I/O I need to do in the future.

Further Reading:

HTML & CSS

Something that is not part of the core or elective NodeSchool tutorials is some basic HTML and CSS. While JavaScript is the programming language of the web, HTML and CSS form the presentation layer. There are almost a countless number of tutorials, both free and paid, that you can use to learn both HTML and CSS well enough to move through the rest of these tutorials pretty quickly. I suggest picking up a smattering of both before moving on to the Electives.

Further Reading:

All of these examples are available on Github.