First Coding Languages
Computer programming is the practice of writing specific instructions that tell a computer what to do. In the past, it was very difficult to program computers. Today, programming languages like Python make it easier. Successful computer programmers can define problems clearly, think logically, and break processes down into smaller component parts.
Learning Objectives
You should be able to:
- Describe the evolution of computer programming
- Describe the benefits of high-level computer programming languages like python
History of Computer Programming
Computers are dumb. Really dumb. They do what they are told and nothing more. We write computer programs to tell computers what to do. Unfortunately, as a species, we are not born with natural instincts that tell us how to tell computers what to do. And so we create programs with bugs and often computers do things that we wish they did not do--like crash or randomly rearrange our entire Word document when we just wanted to move a picture one pixel to the left. Computer programming is the process of creating the systems and applications that people use to get things done. This section provides a brief overview of the tools that people use to program computers.
First Generation Programming: Binary
Computers process data in binary. Binary data is either 0 or 1. Together, binary data can represent words, functions, pictures, movies, and anything else your computer can process. But unless you are Neo looking at the Matrix, people do not understand binary intuitively.
The first computer programmers had to toggle binary switches to create and run programs. The ENIAC was the first digital, programmable computer. Cables had to be rearranged to define the programs' operations. Programming the ENIAC could take weeks. Once the program ran, the ENIAC had to be re-cabled to run a new program. But, the computer performed complex calculations that would have been difficult to do manually.

Second Generation Programming: Assembly
Assembly languages use human-readable words that define how the program should run. Assembly programmers must understand how the computer hardware works. An assembly program is compiled into machine code that runs on the hardware. Compared to programming the ENIAC, assembly programming had several advantages.
- Programs could be modified easily
- Programs were easier to understand
But, assembly languages are not perfect. A program written for one CPU might not work on a computer with a different CPU. Assembly language is also very verbose. It takes a lot of lines of code to do a little bit of work. The following image shows sample assembly code written for a Motorola 6800 Microprocessor. (Author note: I have not written assembly code, nor do I care to. The code in the sample image is largely incomprehensible to me.)

Third Generation Programming: Procedural Languages
Assembly code was tied very tightly to the hardware it ran on. It was also very verbose. Computer scientists created new languages like C, Fortran, and Cobol to make computer programming easier. These programming languages took fewer lines of code to write than assembly. The C programming language was especially popular for systems programming and is used heavily in core parts of both Linux and Windows. The following is sample C code that prints the text, "Hello, World!" to the console.
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
It should be evident that the code is much more readable than assembly code. But if you are new to programming, it might not be clear why "#include
Code written in third-generation languages must be compiled for every system it will be run on. For example, you might write a game in C. You would have to compile one version for Windows, compile another version for Linux, and compile another version for a smartphone.
Fourth Generation Programming: Hardware Independent
Some programming languages do not need to be compiled and can run on different hardware. The Python programming language is an example. Fourth-generation programming languages tend to be expressive and require much few lines of code than third-generation languages. The following is a sample code snippet in Python that prints "Hello, World!" to the console.
print("Hello, World!")
The above program could have taken dozens of lines of code in assembly, took 5 lines of code in C, but only 1 line in Python.
Fifth Generation Programming: Visual Tools
Fourth-generation programming requires that programmers learn the grammar of the programming language. Many people find programming languages that rely on text to use. Some propose that visual programming is the fifth generation of computer programming. Many visual programming platforms provide drag-and-drop elements that can be arranged to form the programming logic. Many elementary school students first learn computer programming using Scratch--a visual programming system created at the Massachusetts Institute of Technology (MIT).

It is not clear whether visual coding will ever replace third and fourth-generation languages, but visual programming will always have its place.
Why Learn Coding?
Even if you do not engage in a cybersecurity career, there are many reasons to learn how to code. Below are just a few examples.
- Career opportunities. Coding jobs are in demand. Whether building websites, writing software for cars, analyzing data, or automating tasks, employers want coders.
- Problem-solving skill development. Coding requires that people break down problems into small, logical pieces. These same skills apply to building businesses, improving supply chains, organizing projects, and much more.
- Enhance creativity. Coding is a creative process. When you write programs, you make decisions about the best way to solve problems. You are limited only in your mastery of the coding language. You become something of a digital artist, but instead of colored pixels, you work with logic.
- Future-proofing. You stay relevant in any industry as you build technical skills. If a company is considering layoffs, the person with coding skills who stays up-to-date with changing technology will be seen as more valuable.
- Personal development. You can code forever. You can keep improving your skills. People who keep learning stay sharp throughout their lives.
Coding is a necessary component of every cybersecurity expert's toolkit. Below are a few reasons why cybersecurity professionals should learn to code.
- Understand and identify vulnerabilities. Every line of code written is a potential security vulnerability. Cybersecurity professionals should be able to write and analyze code for security issues. Some cybersecurity professionals struggle to write code, but they can at least read and understand the code that others have written.
- Develop custom tools and scripts. Cybersecurity professionals often write code to automate processes and analyze data. For example, they might monitor network traffic or analyze log files using small, custom programs.
- Penetration testing. Experts pursuing offensive security often write code to exploit specific vulnerabilities they find in their clients' environments. Off-the-shelf tools might point to potential vulnerabilities, but custom code may be needed to exploit those vulnerabilities.
- Incident response and forensics. On the defensive side, professionals may need to reverse engineer malware to understand its effects on their environments. When an organization's systems have been breached, custom scripts may need to be written to extract data and understand the nature and extent of the successful attack.
- Process improvement. Managers might not write a lot of code themselves, but understanding the coding process can help them develop strategies for writing and deploying code securely. They make sure that the people writing code are doing so in a way that reduces the likelihood of that code containing vulnerabilities.
Reflection
- What was your first computer programming experience?
- How will people create computer programs in the future?
Key Terms
- Binary: The most basic form of data representation in computing, using only two symbols: 0 and 1. Binary code is the fundamental language of computers, where each bit represents a binary digit. All higher-level programming languages and data are ultimately translated into binary for processing by the computer's hardware.
- Assembly Language: A low-level programming language that provides a way to write instructions in a form that is more understandable to humans than binary code. Assembly language uses mnemonic codes to represent machine-level instructions, which are then translated into binary by an assembler. It allows programmers to write code that is closely tied to the hardware architecture.
- Procedural Programming: A programming paradigm based on the concept of procedure calls, where the program is structured into procedures (also known as functions or subroutines). Each procedure contains a sequence of statements that perform a specific task. Procedural programming emphasizes a clear sequence of steps to achieve a desired outcome and is exemplified by languages such as C, Pascal, and Fortran.
- Visual Programming: A programming paradigm that allows users to create programs by manipulating graphical elements rather than writing text code. Visual programming environments provide a more intuitive way to design and develop software, often using drag-and-drop interfaces to connect different components. Examples include Scratch, LabVIEW, and Blockly.