From 63e74315ef7d83ee2a7ba56a7afe4b60382f0217 Mon Sep 17 00:00:00 2001 From: Snorre Selmer Date: Tue, 28 May 2024 21:38:33 +0200 Subject: [PATCH] Update mips-programming-101.md You can now have 90 characters per line, not 52! Of the decadence! Oh the excess! --- mips-programming-101.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mips-programming-101.md b/mips-programming-101.md index c21068c..c85deb6 100644 --- a/mips-programming-101.md +++ b/mips-programming-101.md @@ -10,7 +10,7 @@ In Stationeers you have the following available to you: - Sixteen registers (r0 through r15) - A special address register (ra) - A stack (sp) that you can push 512 values into, and pop values out of. The stack is last-in-first-out. -- A maximum of 128 lines of code, each line has a maximum of 52 characters +- A maximum of 128 lines of code, each line has a maximum of 90 characters The address register (ra) is not meant to be written to by the user, it's only used for branching to code that needs to be accessed from multiple areas in your code (functions). @@ -134,7 +134,7 @@ j start > > *- Guido Van Rossum (the guy that created the Python programming language)* -While the MIPS implementation in Stationeers has some limitations (128 lines, with a maximum of 52 characters per line), I've rarely run into problems like running out of room. This is mostly because I try not to write "multi-mega-scripts" that do a ton of things. I'm a fan of the UNIX mantra of "do one thing, and do it well". This also means that I use ***aliases*** and ***defines*** a lot. They take more space than just writing things straight up, but they also make the code much easier to read! +While the MIPS implementation in Stationeers has some limitations (128 lines, with a maximum of 90 characters per line), I've rarely run into problems like running out of room. This is mostly because I try not to write "multi-mega-scripts" that do a ton of things. I'm a fan of the UNIX mantra of "do one thing, and do it well". This also means that I use ***aliases*** and ***defines*** a lot. They take more space than just writing things straight up, but they also make the code much easier to read! Compare these two lines of code: ``` @@ -145,7 +145,7 @@ and slt HeaterOn CurrentTemperature MinimumTemperature ``` -They could do the exact same thing, but the bottom one actually explains what's going on. And it's still shorter than 52 characters. +They could do the exact same thing, but the bottom one actually explains what's going on. And it's still shorter than 90 characters. If you're juggling 10+ registers in your code without naming them, the chances of getting them mixed up increases greatly. And if you do make a mistake somewhere, trying to follow the code can be more complicated than if you used named variables.