Programming Concepts

While this course aims to teach you JavaScript without having to learn how to code, understanding some basic programming concepts will help you follow the rest of this course.

Of libraries, packages, modules, etc.

In programming, libraries (packages, modules, etc.) are packages of code written in a particular language that can be used within another person’s program. Organizing code into libraries lets you easily share your code with others. Packaging up code into a library or module also helps hide the complexity of the code inside the library. In most cases, you only have to use a tiny bit of code the library “exposes” (i.e. has on the outside of the library) to get the benefit of all the internal code hidden inside the library.

Boilerplate code

Boilerplate code is code that is frequently repeated with little to no variation in between repeats. When programming, you can find yourself repeating yourself frequently on common, low-level tasks. Instead of continuously writing boilerplate code, some developers will create a library to provide the boilerplate code’s functionality. Putting boilerplate code in a library or separate module can help make it easier to maintain your code in some cases; if you need to make a change, you only have to change the code in one place instead of every file that has the boilerplate code. Pulling boilerplate code into a library can also let you add that code into other places more briefly by hiding the internal complexity of the code.

What about frameworks?

Frameworks are generally all-inclusive solutions for solving a particular problem or completing a particular task. For example, a framework for building a web application would generally have all the boilerplate code, the libraries, and any tools you need to build the web application. Frameworks help keep you from having to write and maintain the code yourself to do common tasks like show text on the page in a particular way or let the user navigate through your application.

That isn’t to say you have to use a framework to build a web application. You can do just fine without a framework writing code from scratch or using libraries to fill in the functionality you need.

HTML

HTML, which stands for HyperText Markup Language, is the language web browsers use to understand what they should show you. For the most part, every web page you visit in your web browser is made of HTML.

HTML is completely static. That means once the web browser has read and processed the HTML for a web page that web page will not change. To see changes purely in HTML, you have to load a new web page with different HTML.

CSS

CSS, which stands for Cascading Style Sheets, is a language used to describe how a page should look. CSS tells web browers everything from the color and size of the text on the page to the exact organization and arrangement of all the elements on the page.

A web page without CSS will look extremely plain. The page will be black text on a white background with minor variation in font size and little to no arrangement on the page.

Client-side scripting, programming, or code

Client-side scripting or programming is writing code that will generate what the end-user sees inside of their device. Client-side code, in most cases, refers to the JavaScript that will be executed inside of the end-user’s web browser, mobile device, or desktop computer.

Server-side scripting, programming, or code

Server-side scripting or programming is writing code that will be executed on a remote server in a data center somewhere far from the end-user. Server-side code in JavaScript is code written for Node.js.

Runtime (or run-time) environment

A runtime environment is an application or collection of tools used to run code. The runtime environment is the engine that converts code written in JavaScript into low-level code that the computer running the program will understand.