What is a Program?

A program is a set of ordered instructions created to accomplish a specific task. Based on that definition, many everyday life activities can be seen as programs.

A basic recipe for bread can be seen as a program:

  • Preheat oven to 375º F. Prepare two 9-inch loaf pans by buttering and lightly flouring.
  • Dissolve yeast in warm water. Add sugar, salt, oil, and 3 cups of water.
  • Beat until smooth and stir in remaining flour.
  • Knead on a floured surface for 8 – 10 minutes.
  • Place in greased bowl and let rise for 1 – 2 hours.
  • Punch dough down, divide in half and place in loaf pans. Cover and let rise until doubled.
  • Bake at 375º F for 30 – 35 minutes.

In this example, the order of the instructions is relevant. The recipe, like a software program, was designed to accomplish a specific task, in this instance, to make bread.

The recipe could have been written in any language; English, Portuguese, Chinese, or Arabic. The only requirement for the language choice is that the person who is to make the bread is able to understand the language. While different languages have different grammar rules and syntax, the recipe’s logic should not change.

Similarly, computer programs are also a set of ordered instructions created to accomplish a specific task. Also called code, computer programs can be written in several different languages. The syntax and rules vary from language to language but the program’s logic should have little to no change.

Why Learn to Code?

People who can code are becoming more and more valuable in the current job market. While programmers were somewhat limited to desktop application coding in the past, the rise of the IoT is creating new possibilities for programmers. In 1991, Mark Weiser wrote a paper titled “The Computer of the 21st century”. In his paper, he envisioned the future of the IoT described as “specialized elements of hardware and software, connected by wires, radio waves, and infrared, that will be so ubiquitous that no one will notice their presence”. In a world that is becoming increasingly digital, the ubiquitous nature of computing means that software is everywhere. Today, programmers may work on firmware, device drivers, mobile applications, web interfaces, data analysis, and more. These employment areas were all available before, but the IoT has drastically increased the number of available projects and companies.

The networking industry is also driving the need for more programmers required to customize networking and infrastructure. Emerging networking approaches such as Software Defined Networking (SDN) and Cisco Application Centric Infrastructure (ACI) provide complete programmability to the network infrastructure.

Another benefit of being able to code is that programmers can create their own software tools. Need a specific network filter not available in the market? Maybe a project requires some specific data analysis. This can all be coded by a good programmer.

Computer Languages

Similar to human languages, there are several different computer languages. Some computer languages are better than others at certain types of tasks.

JavaScript, an interpreted computer language, is designed for creating web applications. With JavaScript, a programmer can create web applications that can interact with users and other applications.

Python, another interpreted language, allows for simpler statements. Python is very easy to use, powerful, and versatile and has become the language of choice for many IoT developers. One of the main reasons for Python’s popularity is the developer community; Python developers have created and made available many specific modules that can be imported into any program to immediately lend added functionality.

Blockly is a visual programming language that lets users create programs by connecting blocks, that represent different logic language structures, rather than by writing the actual code. Blockly runs within a web browser and can translate the visually created program as JavaScript, PHP, or Python. An example of Blockly is shown in the figure.

C/C++, a compiled language, is great for creating complex and fast programs but its strict rules and syntax makes it more difficult to develop. Created in the early 70s, C has become one of the most widely used programming languages of all time. The Linux operating system is written in C.

Java is a “write once, run anywhere” (WORA) compiled language. Despite the similar name, Java and JavaScript are unrelated. Java is designed to run on any platform without the need for recompilation. Java based applications require a JVM (Java Virtual Machine) platform installed on the computer. JVM is the environment where the Java-complied code is executed.

Last modified: Thursday, 8 July 2021, 11:55 AM