I do software development, I do a lot with computers, and I’m working on multiple games that I tell people about. Might be time to write something about that.
On this page I write a bit about programming, how to do it, where to learn, recommendations etc, and explain some general concepts that I hope will be useful. It will mostly be tailored towards beginers (since those are the majority of people I meet and interact with) - if you happen to know what you’re doing, you might want to read more in-detail stuff on the SpaceCore page
Setup
If you want to program, you’ll have to do it on something - ideally, a computer, with a keyboard and a reasonable file system. You probably already have one - great!- if not, get one on ebay or from a friend’s basement, slap a linux distro on it, and we’re good to go. Second-hand laptops are easy to find for cheap, are more than good enough for most usecases, and the more expensive ones (~>60€) are comparable to brand-new stuff that is sold for five times that.
System
As you can probably guess, this is the section where I praise gnu/linux (mandatory i use arch btw
- with i3 no less). If you want to work with computers, it’s handy to have a computer that lets you play around, do things your way, and see how things break when they do. The downside of that is that it doesn’t really hold your hand and install safety locks - the power to do what you want comes with the consequence of, well, consequences for your actions - and also the weight of having to actually know what you want to do.
That can be intimidating, but more importantly, it’s often completely overkill. Sure, knowing how to install arbitrary systems from scratch is very useful if you want to manually set up a very specific kind of system on every single device in your house, but if you just want to write a couple lines of Python, using a browser IDE is significantly easier.
If you do want to try this out though, I recommend starting with Ubuntu - it gives you all the benefits of a gnu/linux system while also being easy and straight-forward enough to figure out and use (not to mention sleek). And once you’ve gotten high on power and want to really take something apart and do it from scratch, take a look at the stereotypical arch.
Environment
Now, whatever your computer is actually running, you need some place to 1. write code, and 2. run it.
The “standard” solution is an IDE (integrated development environment) - it combines a text editor, with syntax highlighting and autocompletion to make it easier to write code, with a backend to actually run said code. I will not get into the flame wars that are IDE recommendations, but this is probably the most “beginner-friendly” option (I wouldn’t know).
One step down from that is the more sensible approach of text editor + compiler/interpreter - “sensible” because that is what the computer is actually doing behind the scenes anyway, so might as well get to know it personally. Code itself is (usually) nothing more than text, so you can use anything that can edit a text file here - look for whatever you like best (preferably something with syntax highlighting though). To actually get the code to run, you’ll need to thus get a program that does that - so a compiler or an interpreter (more on the difference in the “misc” section at the end). You will most likely have to run this in a console - but it’s good practice to learn to use one anyway. On Gnu/linux and derivatives - ctrl+t
opens a terminal on most (you can navigate folders with cd
and list their contents with ls
). The program you actually need to run your code is language-dependent, so more on that below.
You can of course be “oldschool”/insane like me and do both in a console (nano
+gcc
). That is practical for the reason that it is insanely portable (if it can display and read text, you’re good to go) and flexible (works for any language, as long as you have the right package) and needs almost no setup (fresh arch install + nano
+ devel
is about 500mb), but you need a moderate understanding of using a computer to pull it off, so it’s not as beginner-friendly.
Languages
Now, having a setup where you can code is good and all, but what do you actually code? That’s in the next section - this one is for choosing what language to code in, since before you tell the computer what to do, you have to know how to talk to it.
Python
Python) is a great starting place, because it takes care of so many things for you - you don’t need to think about datatypes or memory management or garbage collection, or any of that interesting but advanced stuff, you just sit down, write a line of code, and the computer does what it’s told. It lets you figure out the type of logical thinking computers require, without requiring you to keep track of every bit and byte involved. It’s also an interpreted language (more on what that means at the bottom of the page), meaning you can also just open a REPL, type code, and immediately see what happens - without having to do all the complicated stuff required to translate it to machine language that the computer actually needs. Even if you do know “better” languages, it is useful to throw together something quickly and see how it works - or so it just gets the job done.
Downside is that because of all the safeguards and assumptions, it can be very superficial and inefficient.
Gnu/linux: install the python3
package, then in a terminal type python3 <filename>
with the name of the file you want interpreted, or without a filename to open the interactive console.
Windows: uuuh idk use an online repl maybe?
C/CPP
C and its derivatives are known for being what pretty much everything runs on in the end. Pretty much all operating systems are written in it, most games are in it - if you’ve used a computer, odds are you’ve worked with a program written in C. The reason it’s so widespread is that it is very close to what the computer actually does - meaning, it is very easy to make it handle the low-level stuff needed to run an OS, and tell the computer exactly what to do so it happens fast (useful if you want a game).
Lisp
Projects
the numbers stuff i was teaching alex with sums, fibonnachi, factorials, primes text interfaces simple calculator / reverse polish interpreter linked list / balanced tree / hash table - put those under algorithms? mandelbrot viewer raycaster synth language interpreters - deadfish, brainfuck, befunge, lisp
https://esolangs.org/wiki/Category:Program_forms https://esolangs.org/wiki/Category:Programming_games
linked lists, autobalancing binary trees, quadtrees, hash tables, (quick)sort - basic structures and algorithms like these are some of the few useful things youd learn in uni
quadratic sync problem: have a,b,c,d,e, find x,y so ax2+bx+c=dy2+ey all nonnegative integers quadratic residuory problem (actual math thing) does a=0,d=1,e=0
Algorithms
XXX wanted to put annotated implementations somewhere
interpolation stuff from spc? bresenham los cubemarch - pretty sure that one is also in spc
Useful concepts
compiled vs interpreted
imperative vs functional
ascii
posix? gnu?
concepts page on the esolang wiki
Misc
- TheCodingTrain (on yourube) has a useful introductory course to programming. It’s in js, but otherwise seems decent.
- The Wizard Book of Programming (actually titled “Structure and Implementation of Computer Programs” but nobody relevant actually calls it that) is from the early days of computing and introduces a lot of relevant programming concepts. Also, it does so in lisp
- Where the above deals with programs, The MINIX Book (actually titled “Operating Systems. Design and Implementation”) deals with the operating system surrounding the programs.
- And if that still isn’t enough, this one deals with how the actual hardware is built from transistors (or, ya know, relays, minecraft torches, whatever you happen to have handy)
- And this one deals with how to program securely
explain why and how oop on webbed/prog, also ecs?