📚 Seth MB

Search

Search IconIcon to open search

Programming Theory

Last updated May 26, 2023 Edit Source

share_title="Look at this page from SethMB.xyz" share_description="https://sethmb.xyz/sixth/CompSci/Programming/Programming/" author="@saluki@fosstodon.org"

Algorithms are instructions.

Computer process instructions.

Programming is the process of turning algorithms into instructions that can be followed by a computer.

Instructions are binary codes that represent the operations that the computer can perform.

So 0001 could be ADD and 0010 could be SHIFT.

Each type of computer has its own set of instructions - creatively called an instruction set, examples of these include x86 and ARM.

# Programming Languages

# 1st Generation

# 2nd Generation

# 3rd Generation (or high level)

In 1st and 2nd generation languages (the low level languages) the programmer needs to know and think about how the computer works.

With 3rd generation/ high level languages - the programmer focuses on solving the problem more than on how the computer works.

# Low level languages

Always called:

# High level languages

Usually referred to by the language name:

# Why so many?

# Rosetta Code

A stone was discovered holding the “Rosetta code” which includes a message in 3 different languages, 1 of which was hieroglyphs. We couldn’t understand hieroglyphs until we found this stone, however once we used the Rosetta code to translate the message on the stone, we managed to crack hieroglyphs.

Similarly, the website RosettaCode.org allows you to compare programming languages similarly. It has solutions to different tasks in many different languages.

# Translators

Source CodeMachine CodeAssembly CodeHigh Level Code
TranslateN/AAssemblerCompiler / Interpreter
CombineLinkerLinkerLinker (usually automated) Interpreter bypasses linker
ExecutableMachine CodeMachine CodeMachine Code

Assembly has a 1:1 equivalence with machine code. It is the exact same, just represented with keywords rather than binary.

# Compiler or Interpreter

# Errors

# Exceptions

The above diagram shows the flow if the exception is caught. If it is uncaught, then it will just crash.

# Development Lifecycle

This is not a rigid list, not everyone uses every stage, and not everybody does them in the order used here. Some people may collapse stages into larger categories.

You can go back through phases if an issue arises.

Planning is important!

Majority of programming work is found on GitHub

Programming