You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Web-Dev-For-Beginners/translations/en/1-getting-started-lessons/1-intro-to-programming-lang...
Lee Stott 2daab5271b
Update Quiz Link
3 weeks ago
..
README.md Update Quiz Link 3 weeks ago
assignment.md 🌐 Update translations via Co-op Translator 3 weeks ago

README.md

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.

Intro Programming

Sketchnote by Tomomi Imura

Pre-Lecture Quiz

Pre-lecture quiz

Introduction

In this lesson, well cover:

  • What programming is
  • Types of programming languages
  • Basic components of a program
  • Useful software and tools for professional developers

You can take this lesson on Microsoft Learn!

What is Programming?

Programming (or coding) is the process of writing instructions for a device, such as a computer or mobile device. 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 can be anything created with code—websites, games, and phone apps are all examples. While some programs can be created without writing code, the underlying logic is interpreted by the device, and that logic is typically written in code. A program that is running or executing is carrying out instructions. The device youre using to read this lesson is running a program to display it on your screen.

Do some research: Who is considered the worlds first computer programmer?

Programming Languages

Programming languages allow developers to write instructions for devices. Devices only understand binary (1s and 0s), which isnt an efficient way for most developers to communicate. Programming languages act as a bridge between humans and computers.

Programming languages come in various formats and serve 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 due to their readability and support. JavaScript is considered 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 are doing the same thing: 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 character or line spacing that marks where the instruction ends, or terminates. The way a program terminates depends on the programming language.

Statements in a program may depend on data provided by a user or other sources to execute instructions. Data can influence how a program behaves, so programming languages include ways to temporarily store data for later use. These are called variables. Variables instruct a device to save data in its memory. In programs, 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 maintainable. Typically, these changes in control occur when certain conditions are met. A common statement used in modern programming for this purpose is the if..else statement.

Youll learn more about this type of statement in future lessons.

Tools of the Trade

Tools of the Trade

🎥 Click the image above to watch a video about tools

In this section, youll explore software that can be helpful as you begin your journey as a professional developer.

A development environment is a unique set of tools and features that developers use frequently when writing software. These tools are often customized to meet a developers 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 stepping through the 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 syntax highlighting to be customized.
  • Extensions and integrations are specialized tools created by developers for developers. These tools arent part of the base editor. For example, developers often document their code to explain how it works. They might install a spell-check extension to catch typos in the documentation. Most extensions are designed for specific editors, and editors typically include ways to search for available extensions.
  • Customization allows developers to tailor their development environment to their needs. Most editors are highly customizable and may even allow developers to create their own 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 has errors, DevTools can be configured to capture information about when the errors occurred.

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. They use keyboard shortcuts to navigate between windows, work on files, and use tools. While most tasks can be completed with a mouse, the command line allows developers to perform many actions without switching between input devices. Another advantage of the command line is its configurability—you can save custom configurations, modify them later, and import them to other development machines. Since development environments are highly personalized, some developers avoid the command line, others rely on it entirely, and some use a mix of both.

Command line options vary depending on the operating system.

💻 = preinstalled on the operating system.

Windows

MacOS

Linux

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.

Do some research: Now that you understand the basics of a web developers environment, compare it to a web designers environment.


🚀 Challenge

Compare some programming languages. What are some unique characteristics of JavaScript versus Java? How about COBOL versus Go?

Post-Lecture Quiz

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

Reading the Docs


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.