First off, let’s briefly talk about machine code and how computers work.
<aside> 💡 Machine Code is the lowest level of code that computers require to run instructions. Looks like “101010101”, which is binary data that controls the physical computing devices (transistors) on the CPU. You never need to operate at this level as a programmer, since we have invented helpful abstractions
</aside>
🚧 Assembly — one of the lowest level of abstractions and languages that is “one step” above writing in binary. This is reserved for the most advanced highly performant applications and systems, and hardly anyone nowadays ever programs in assembly. It is also used as a form of torture to first-year engineering students.
section .data
counter db 0 ; define byte variable counter with initial value 0
section .text
global _start
_start:
mov al, [counter] ; move the value of counter into AL register
count_loop:
cmp al, 10 ; compare AL with 10
jg exit_loop ; if AL > 10, exit the loop
inc al ; increment AL by 1
mov [counter], al ; update counter variable with new value
jmp count_loop ; jump back to start of loop
exit_loop:
; exit code or end of program
The above is a simple program that counts to 10. Confused? You bet. This is a difficult way to think and program, which is why we have invented more abstract and human-friendly languages to write and think in.
For example, here is the equivalent code written in the Python programming language:
let counter = 0; // define variable counter with initial value 0
while (counter <= 10) {
console.log(counter); // or any other operation with counter
counter++; // increment counter by 1
}
Is that much nicer? Even you have never programming before, I bet you could read through the above code and reason through it. Python is in fact one of the most human readable programming languages, which is why it is one of the most beginner friendly and popular choices as a first programming language to learn. It is also very powerful and pretty efficient given how simple it is to use.
In this curriculum, I have identified and selected 4 programming languages that we will learn. Each one for a particular reason, and all of increasing complexity and difficulty.
There are many many many (too many) programming languages. The four that I have selected cover almost every use-case and scenario that a project in a Fab Lab or makerspace might need. I think learning any more as a beginner will become overwhelming and difficult to manage. That said, if you get really into coding, you should follow your curiosity and check out new languages and see what they have to offer. Some people really love certain aspects about a language, while others hate them. It can be a very polarizing world, which is why there are so many languages.