HTML - Common Programming Structures [LESSON]

Common Programming Structures

Front-End Programming

JavaScript is the main programming language used for front-end programming of websites. JavaScript allows you to make your site go from a static site to a dynamic website. Dynamic websites are interactive, they allow the user to change the page based on their input. JavaScript is primarily an Object-Oriented Programming (OOP) language. Object-oriented programming is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields, and code, in the form of procedures. A common feature of objects is that procedures are attached to them and can access and modify the object's data fields. JavaScript (JS) is frequently used when building websites, but it can also be used to program games and mobile apps. JS adds functionality to web pages through the document object model (DOM). DOM is an API that treats HTML elements as objects that JS can manipulate in a variety of ways. Application Programming Interfaces (APIs) are constructs made available in programming languages to allow developers to create complex functionality more easily. They abstract more complex code away from you, providing some easier syntax to use in its place. As of 2022, 98% of websites use JS to make their site dynamic. There are other programming languages that are also used for dynamic website objects, such as React, Angular, jQuery, Swift, Ruby, Vue, and others. However, JavaScript is the main programming language used with HTML and CSS to create dynamic websites. There are many sites available to help you learn JavaScript, including W3Schools, Mozilla Developer Network, freeCodeCamp.org, JavaScript 30, CodeMentor, and Codecademy. 

Common Programming Structures

Programming languages have several common structures that are used in their coding. See the learning object below to understand some of these common programming structures.

Programming Conditional Statement

Diagram showing a conditional statement. Condition decision – Yes do C, no don’t do C.  If <condition> do C.

While-Loop-Diagram

Diagram of a While loop in programming.

Programming Array

A diagram showing how a 2d array works dim animals(3) as string animals(0) = "Dog" animals(2) = "Cat"

The Common Programming Structures activity below will expand your knowledge, click each tab.

[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION