Prologue: what the hell am I even talking about
There are two things happening simultaneously: the world is becoming increasingly digitalized while at the same time the skills that underpin this digitalization seem to be getting devalued as companies seem to increasingly believe that software engineering tasks can be completed entirely using large language models and "vibes".
So, as companies are increasingly building software and algorithms that play an increasingly large part in our lives, we are also gradually abandoning learning how to do that in the first place.
I find this a rather precarious and unsustainable position. The mega-corporation technocracy itself is a pretty scary thing by itself, but the idea that we become more and more reliant on them while they themselves are getting dumber over time is the stuff of nightmares.
So, what I wanted to do was to contribute a little bit towards a counter-action to both of these things. I want to chip in by trying to teach some of the fundamental ideas in programming and software engineering to two different groups of people. The first are the people who are already in tech but who either let their skills get rusty or skipped some of the basics. The second group are people who are not programmers yet but who might benefit from learning some skills in order to become less dependent on those already in the know.
After all, I believe quite strongly in the idea of free and open source software, which theoretically allows anybody to take a piece of software, modify it to suit their needs without anybody else's permission and then distribute that modified program to anybody else at will. This does change the power structure of software development quite a bit, but many of the freedoms are still only accessible to those who have the requisite skills to exercise them. What I am hoping to do here is to guide you towards acquiring those skills.
How we will do this
I have been thinking for a while what the best ways to teach this kind of stuff would be. There are many approaches, some more oriented around the practical and others more oriented around theory. The choice of introductory programming language is also significant, since some languages are inherently more easy or more difficult and they are used in very different contexts.
So, what I am going to do is that I will aim for a sort of middle approach, one that might be a bit unconventional. During this series of blog posts, we won't aim at a goal of building some specific application and instead we will go through what I believe to be fundamentals. We also won't start with any math lessons, but we will go over some surface level theory when necessary to explain how things work. We will also not entirely constrain ourselves to low-level or high-level concepts, but explore their relationships as necessary.
Basically, I want to go code-first, but also explore a decent portion of the things I learned during my computer science studies, at least as far as they are relevant to software engineering and programming.
As for the programming languages we'll be using, I have settled on the slightly niche option of Lua. Lua is not very prominently talked about, although it has been and continues to be used a fair bit in the so-called "scripting" domain, where it is used as a sort of glue to bind systems and actions together. However, this need not be discouraging to you, since Lua can be used to construct programs of all sorts from games to web servers. Lua also has an incredible power-to-weight ratio, meaning that learning the language itself is not very difficult and the functionality it provides is very versatile. Also, most things I will talk about here should be applicable across programming languages, so in the future you will just need to learn the language-specific details.
Over time we will also potentially use some other programming languages when we shift focus to different areas, but at least for the time being we will focus on Lua.
Conventions
When I show you code, I will do so with a code snippet that looks like this:
print("Hello world!")Hello world!
The top part shows you the code that needs to be written. Sometimes code snippers also have a second part underneath that shows the output of the program, to help understand how the program works. The bottom part will sometimes be omitted if there is no relevant output.
Sometimes I will also demonstrate steps that need to be taken inside a command line shell and in those cases I will use the following style:
λ echo "Hello world"
Hello world
λ lua
Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
>These are denoted with the lambda character "λ", which I use for the shell in Emacs. In your command line shell the prompt character may be something like "$" or ">". These examples contain both the input and the output intermixed. If you want to follow along, you should type the commands after the lambda or after the ">" prompt in Lua and not copy the whole thing, since that won't work.
I will try to keep things as operating system agnostic as possible, so you should hopefully be able to follow along just fine regardless of the kind of computer you are using.
Next steps for you
Firstly, you will need a couple of things:
- A computer on which you can install software
- A Lua interpreter
- A code editor
The instructions for how to install Lua and a code editor depend on your operating system. This page provides seemingly decent instructions for Windows, Mac and Linux for how to get yourself set up. If you are already using a package manager on your system to install software, it's a good idea to install it from there when possible.
Once you have the Lua interpreter installed, the choice of code editor is essentially entirely up to you. Many people default to Visual Studio Code, which is a popular and uncontroversial choice. However, you can get by with something even simpler, such as a basic text editor with syntax highlighting. Gedit and Notepad++ are examples of such editors. I personally use Emacs, but it is a somewhat complicated editor, so perhaps not one to learn while also learning programming. Although, if you feel like you want to challenge yourself, Emacs is a path to powers some would consider unnatural.
However, most importantly, don't use Microsoft Notepad or some word processing application, they aren't really intended for what we are doing here. Whatever you settle for should at least provide you syntax highlighting.
We will properly get acquainted with the first steps in Lua in the next post. See you there!