It always blows my mind that people actually watch these terrible content creators. Like how could anybody watch this guy or MrBeast and not immediately realize it's a shitty person. Not to mention the actually dogshit quality of the content to begin with lmao
post
What is this about? I don't get the meme.
PirateSoftware doesn't use enums for whatever reason, instead he uses raw integer values with hand comments (and allegedly an Excel doc) on what is what, which is one of the reasons behind his awful code, which in turn lead to him not being able to ship his game.
Actually they're only enums if they're made in the Enümmär region of Germany, otherwise they're just sparkling integers.
Another comment on this post have declared enums outside of Rust being bad for not having tagged union capabilities.
That's just someone that doesn't know why people say things, so just made it up.
Enums outside of rust are indeed bad (I would correct it to enums in every language I know that is not rust, since maybe some other do the same thing as rust). But it's not because the tagged union thing.
The problem of enums in other languages is that they do not make for a distinct type. They are just integers in a name. Or at least that is the case for C and Java enums. Python and JavaScript do not even have enums, which is even worse.
When enums are just integers, you don't know if a variable of the type of the enum is actually one of the variants of the enum. If you assume that, you can easily get into undefined behavior/crash territory quite fast.
When making a library in C, for example, if one of your functions has an enum as a parameter, one of the first things you have to do is check if that parameter is actually in the range of the enum. Since you don't control the caller to your function. These checks don't belong in code at runtime, they belong to compile time, as you're just validating the type of a variable.
In rust, switch/match statements need to cover every single enum variant (of course, you can also have default paths to not cover every case) your code just won't compile if you don't. Which means that when you add a new variant to an old enum, you don't have to go hunting every match statement to see if it affects your new change. That is a tedious and error-prone task if done manually, while it is pretty simple for the compiler.
Of course, now that these differences are established, the tagged union thing comes in and makes rust ones better. The reason other language enums are bad is because they're named integers, the reason rust's are good is because they are tagged unions, completing the algebraic type system.
Yeah but that's just edgelord behaviour.
You get those a lot with all kinds of programming languages, and Rust is certainly not know for having less of them.
What is Pirate Software?
He's some apparently famous YouTuber who reckons that he's a programming genius even though I'm the better programmer than him.
Occasionally he does something stupid and pops up on everyone's radar for a while and then the rest of the internet goes back to forgetting about him.
I guess he's kicked off again.
He's actually been doing stupid shit for ages, it just didn't get widespread attention until the SKG thing blew up. Actually the wow roach might've been before that, but either way SKG is what basically ended him.
I heard he worked for Blizzard. But it definitely wasn't nepotism
The most notable thing about Thor I know is that his dad is the literal World of Warcraft guy from that one episode of South Park. Like, not that he looks similar; he was the actual inspiration for the character after Trey and Matt met him while touring Blizzard's offices.
famous YouTuber who reckons that he’s a programming genius
Is that true? I've seen a lot of his shorts and he's always been like: "just make games" -- "stop worrying about code quality, some amazing games have shit code"
What's his motivation for something so deranged?
Reminds me of a codebase I used to work on which we had 899 variable limit and we couldn't name them, only number them. These were limitations of the language.
Each variable had to be assigned a 3 digit number but 1-100 were taken by internal stuff so only 101- 999 was allowed. So let's say you wanted to check if power was between 50 and 60 you would end up with like
#301 = 50;
#302 = 60;
#303 = powerSignal;
If #303 < #301 || #303 > #302: Display error
Continue process
That’s… that’s so awful…
If I told you what the purpose of this system was you would be really horrified...
Please, indulge me
Basically we made devices which were surgically implanted into your body to send specific electrical signals to your spine and brain for certain medical issues. The electronics were in a metal case so your icky blood and bodily fluids didn't cause shorts. This system was to weld the metal case closed.
Sounds like someone wanted to avoid needing to recompile for the target, but was either hardware constrained on what they wanted to do or as they thought that implementing their own language was going to be easy, learned it's very much so not, and then took some stupid shortcuts
I totally haven't done that myself, nope....
It's fanuc cnc... Incredibly useful and precise but OLD! They literally still support programs from bubble tape if you need. It was basically hardware constrained initially but fixing it would break backwards compatibility which is a super selling point for them to government and long term industries.
Their controllers are mad expensive (budget version is like 30k last I checked), their support is top notch(tech typically on site within 24 hours with every possible board which may be bad so they can get you running and charge you later), they are incredibly precise and can do things other systems legally can not(a trainer I knew said "if you can move in 5 dimensions at once you can do some interesting things with nuclear energy so those require special clearance to sell"). Basically if you need them you NEED them, if you don't then you don't.
Custom machined fissible material!?
Nah just titanium
So a FANUC controller?
Did yours spin sideways or vertically?
Lol, yup. Actually it was 4 axis. And connected to a laser instead of a milling bit. The system was also in a controlled gas environment which added extra complications.
Ooh, sounds spicy.
The hard set limit of #500-#999 is really frustrating when you also have to be careful not to overwrite certain kinds of "standard" program variables that your shop or company has decided on. I'm generally pretty OK with the limitations of these controllers and G-Code in general, but I would fucking kill to be able to use an array or to be able to declare a variable 😭.
Did this cursed language have a name?
Ok at this point I'm okay with magic numbers, they make the code more readable
I mean thats not uncommon in game dev from what I have seen. Remember VVVVVV? The creator open sourced the code years ago, and they didn't use enums either, just switch statements with integers. I imagine a lot of indie games suffer from this as they're made by a passionate person/group that are learning on the fly.
top 50 comments