12 KiB
Introduction to Programming Languages and Tools of the Trade
This lesson introduces the fundamentals of programming languages. The topics discussed here are relevant to most modern programming languages. In the 'Tools of the Trade' section, you'll explore software that can assist you as a developer.
Sketchnote by Tomomi Imura
Pre-Lecture Quiz
Introduction
In this lesson, you'll learn about:
- What programming is
- Different types of programming languages
- Basic components of a program
- Software and tools that are useful for professional developers
You can access this lesson on Microsoft Learn!
What is Programming?
Programming, often called coding, is the act of writing instructions for devices like computers or mobile phones. These instructions are written using a programming language, which the device interprets. These instructions can be referred to by various names, such as program, computer program, application (app), or executable.
A program is essentially anything created using code—websites, games, and mobile apps are all examples of programs. While some programs can be created without directly writing code, the underlying logic is still interpreted by the device, and that logic is typically written in code. A program that is running or executing is actively performing the instructions it contains. The device you're using to read this lesson is running a program to display it on your screen.
✅ Research task: Who is considered the world's first computer programmer?
Programming Languages
Programming languages allow developers to write instructions for devices. Since devices only understand binary (1s and 0s), programming languages serve as a more efficient way for humans to communicate with computers.
Programming languages come in various formats and are designed for different purposes. For instance, JavaScript is primarily used for web applications, while Bash is mainly used for operating systems.
Low-level languages require fewer steps for a device to interpret instructions compared to high-level languages. However, high-level languages are popular because they are easier to read and have better support. JavaScript is an example of a high-level language.
The following code demonstrates the difference between a high-level language (JavaScript) and a low-level language (ARM assembly code).
let number = 10
let n1 = 0, n2 = 1, nextTerm;
for (let i = 1; i <= number; i++) {
console.log(n1);
nextTerm = n1 + n2;
n1 = n2;
n2 = nextTerm;
}
area ascen,code,readonly
entry
code32
adr r0,thumb+1
bx r0
code16
thumb
mov r0,#00
sub r0,r0,#01
mov r1,#01
mov r4,#10
ldr r2,=0x40000000
back add r0,r1
str r0,[r2]
add r2,#04
mov r3,r0
mov r0,r1
mov r1,r3
sub r4,#01
cmp r4,#00
bne back
end
Believe it or not, both codes perform the same task: printing a Fibonacci sequence up to 10.
✅ A Fibonacci sequence is defined as a series of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. The first 10 numbers in the Fibonacci sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34.
Elements of a Program
A single instruction in a program is called a statement. Statements usually have a specific character or spacing that marks where the instruction ends, or terminates. The way a program terminates depends on the programming language.
Statements in a program often rely on data provided by a user or other sources to execute instructions. Since data can influence how a program behaves, programming languages include ways to temporarily store data for later use. These are called variables. Variables are instructions that tell a device to save data in its memory. In programming, variables are similar to those in algebra—they have unique names and their values can change over time.
Not all statements in a program will necessarily be executed. This can happen intentionally, as designed by the developer, or accidentally due to unexpected errors. Controlling how a program runs makes it more robust and easier to maintain. Typically, these changes in control occur when certain conditions are met. A common statement used in modern programming to manage program flow is the if..else
statement.
✅ You'll learn more about this type of statement in future lessons.
Tools of the Trade
🎥 Click the image above to watch a video about development tools.
In this section, you'll explore software that can be helpful as you begin your journey as a professional developer.
A development environment is a personalized set of tools and features that developers use frequently when writing software. These tools are often tailored to meet a developer's specific needs and may evolve over time as priorities shift, personal projects change, or new programming languages are adopted. Development environments are as unique as the developers who use them.
Editors
One of the most essential tools for software development is the editor. Editors are where developers write and sometimes run their code.
Editors are valuable for several reasons:
- Debugging helps identify bugs and errors by allowing developers to step through their code line by line. Some editors include debugging features that can be customized for specific programming languages.
- Syntax highlighting uses colors and text formatting to make code easier to read. Most editors allow developers to customize syntax highlighting.
- Extensions and integrations are additional tools created by developers for developers. These tools are not part of the base editor. For example, developers often document their code to explain how it works. A spell-check extension can help identify typos in the documentation. Most extensions are designed for specific editors, and editors typically include a way to search for available extensions.
- Customization allows developers to create a unique development environment tailored to their needs. Most editors are highly customizable and may even allow developers to create their own extensions.
Popular Editors and Web Development Extensions
Browsers
Another essential tool is the browser. Web developers use browsers to test how their code runs on the web. Browsers also display the visual elements of a web page written in the editor, such as HTML.
Many browsers include developer tools (DevTools), which provide features and information to help developers gather and analyze important details about their applications. For example, if a web page encounters errors, DevTools can be configured to capture information about when and why the errors occurred.
Popular Browsers and DevTools
Command Line Tools
Some developers prefer a less graphical interface for their daily tasks and rely on the command line. Writing code involves a lot of typing, and some developers prefer not to interrupt their workflow by switching between the keyboard and mouse. Using keyboard shortcuts, they can navigate between windows, work on different files, and use tools efficiently. While most tasks can be completed with a mouse, the command line allows developers to perform many actions without switching between input devices. Additionally, command line tools are highly configurable, enabling developers to save custom configurations, modify them later, and transfer them to other machines. Since development environments are highly personal, some developers avoid the command line, others rely on it entirely, and some use a mix of both.
Popular Command Line Options
Command line options vary depending on the operating system.
💻 = preinstalled on the operating system.
Windows
- Powershell 💻
- Command Line (also known as CMD) 💻
- Windows Terminal
- mintty
MacOS
Linux
Popular Command Line Tools
Documentation
When developers want to learn something new, they often turn to documentation for guidance. Documentation helps developers understand how to use tools and languages effectively and provides deeper insights into their functionality.
Popular Documentation on Web Development
- Mozilla Developer Network (MDN), created by Mozilla, the publishers of the Firefox browser
- Frontend Masters
- Web.dev, created by Google, the publishers of Chrome
- Microsoft's developer documentation, for Microsoft Edge
- W3 Schools
✅ Research task: Now that you understand the basics of a web developer's environment, compare it with a web designer's environment.
🚀 Challenge
Compare some programming languages. What are the unique characteristics of JavaScript compared to Java? How about COBOL versus Go?
Post-Lecture Quiz
Review & Self Study
Explore the different programming languages available. Try writing a line of code in one language, then rewrite it in two others. What did you learn?
Assignment
Disclaimer:
This document has been translated using the AI translation service Co-op Translator. While we strive for accuracy, please note that automated translations may contain errors or inaccuracies. The original document in its native language should be regarded as the authoritative source. For critical information, professional human translation is recommended. We are not responsible for any misunderstandings or misinterpretations resulting from the use of this translation.