Made this after someone noticed her face looked like PirateSoftware

a month ago by ZILtoid1991 to c/programmer_humor

kubica 57 points a month ago

What is this about? I don't get the meme.

path: 0 25738006, hotness: undefined, score: 57, children: 45
ZILtoid1991 93 points a month ago

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.

path: 0 25738006 25738095, hotness: undefined, score: 93, children: 43
rtxn 163 points a month ago

Actually they're only enums if they're made in the Enümmär region of Germany, otherwise they're just sparkling integers.

path: 0 25738006 25738095 25738193, hotness: undefined, score: 163, children: 9
ZILtoid1991 15 points a month ago

Another comment on this post have declared enums outside of Rust being bad for not having tagged union capabilities.

path: 0 25738006 25738095 25738193 25738229, hotness: undefined, score: 15, children: 8
RaphaelSchmitz 17 points a month ago

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.

path: 0 25738006 25738095 25738193 25738229 25738505, hotness: undefined, score: 17, children: 1
calcopiritus 3 points a month ago

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.

path: 0 25738006 25738095 25738193 25738229 25752327, hotness: undefined, score: 3, children: 5
vrek 38 points a month ago

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

path: 0 25738006 25738095 25738300, hotness: undefined, score: 38, children: 18
girlnamedzero 17 points a month ago

That’s… that’s so awful…

path: 0 25738006 25738095 25738300 25739836, hotness: undefined, score: 17, children: 9
vrek 19 points a month ago

If I told you what the purpose of this system was you would be really horrified...

path: 0 25738006 25738095 25738300 25739836 25739898, hotness: undefined, score: 19, children: 8
TonyOstrich 8 points a month ago

So a FANUC controller?

Did yours spin sideways or vertically?

path: 0 25738006 25738095 25738300 25739700, hotness: undefined, score: 8, children: 3
vrek 7 points a month ago

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.

path: 0 25738006 25738095 25738300 25739700 25739743, hotness: undefined, score: 7, children: 2
WesternInfidels 6 points a month ago

Did this cursed language have a name?

path: 0 25738006 25738095 25738300 25740639, hotness: undefined, score: 6, children: 1
vrek 11 points a month ago

It was g-code which as another commentator correctly pointed out was used to control a fanuc cnc system.

path: 0 25738006 25738095 25738300 25740639 25740741, hotness: undefined, score: 11, children: 0
echodot 3 points a month ago

Ok at this point I'm okay with magic numbers, they make the code more readable

path: 0 25738006 25738095 25738300 25742421, hotness: undefined, score: 3, children: 1
vrek 2 points a month ago

It was a lot of magic numbers, why was that set that thing set to 3 minimum? It worked good enough at 3 to be acceptable

path: 0 25738006 25738095 25738300 25742421 25745051, hotness: undefined, score: 2, children: 0
gianni 25 points a month ago

What is Pirate Software?

path: 0 25738006 25738095 25742064, hotness: undefined, score: 25, children: 9
echodot 21 points a month ago

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.

path: 0 25738006 25738095 25742064 25742378, hotness: undefined, score: 21, children: 8
cheat700000007 17 points a month ago

I heard he worked for Blizzard. But it definitely wasn't nepotism

path: 0 25738006 25738095 25742064 25742378 25743566, hotness: undefined, score: 17, children: 3
SkyezOpen 16 points a month ago

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.

path: 0 25738006 25738095 25742064 25742378 25745312, hotness: undefined, score: 16, children: 0
lobut 6 points a month ago

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"

path: 0 25738006 25738095 25742064 25742378 25745508, hotness: undefined, score: 6, children: 2
VibeSurgeon 10 points a month ago

What's his motivation for something so deranged?

path: 0 25738006 25738095 25743187, hotness: undefined, score: 10, children: 1
SkyezOpen 6 points a month ago

It was for an ARG. Or it doesn't matter because it runs on a smart fridge (no it doesn't). Or he was OOM.

path: 0 25738006 25738095 25743187 25745211, hotness: undefined, score: 6, children: 0
drcobaltjedi 9 points a month ago

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.

path: 0 25738006 25738095 25741564, hotness: undefined, score: 9, children: 1
ZILtoid1991 8 points a month ago

TBH sometimes I'm also guilty of this, if I forget about them. In one library on mine, I'll have to put all error codes under a single enumerator, so I don't need to make new ones every time I add functionality.

path: 0 25738006 25738095 25741564 25746294, hotness: undefined, score: 8, children: 0
MrSoup 9 points a month ago

Apparently PirateSoftware is someone who live-streams.

path: 0 25738006 25738653, hotness: undefined, score: 9, children: 0
innermeerkat 18 points a month ago

Roaches can’t enumerate

path: 0 25738138, hotness: undefined, score: 18, children: 0
PotatoesFall 16 points a month ago

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

path: 0 25752208, hotness: undefined, score: 16, children: 1
ZILtoid1991 11 points a month ago

Once I watched a Mr. Beast video on Twitter, my reaction to it was that it's slop, way before the term was associated with genAI.

path: 0 25752208 25753497, hotness: undefined, score: 11, children: 0
Staff 2 points a month ago
path: 0 25737647, hotness: undefined, score: 2, children: 0
Pratai -7 points a month ago

More low-hanging from the Queen of Edgy Teens.

path: 0 25746319, hotness: undefined, score: -7, children: 0
RustyNova -13 points a month ago
path: 0 25737626, hotness: undefined, score: -13, children: 11
copygirl 20 points a month ago

But enumerators (aka. iterators) typically have nothing to do with enums, no?

path: 0 25737626 25737699, hotness: undefined, score: 20, children: 1
RustyNova 3 points a month ago

We aren't talking about enums here? My bad

path: 0 25737626 25737699 25738873, hotness: undefined, score: 3, children: 0
Simulation6 18 points a month ago

They are just named integers. The compiler takes care of all that.

path: 0 25737626 25738079, hotness: undefined, score: 18, children: 0
nailbar 5 points a month ago

Glances nervously at my own code using more and more enums now-a-days.

path: 0 25737626 25737654, hotness: undefined, score: 5, children: 1
RaphaelSchmitz 10 points a month ago

Not a problem, ignore the edgelording, you'll be fine.

A lot of people don't understand that readability is about how fast someone can correctly understand that whole class/file/etc afterwards. Sometimes using enums improves that, sometimes not.

For enums specifically, it is good to be aware what you do with them. Often it directly maps to a decision. E.g. enum ExportType with values JSON/XML/CSV - instead of passing an enum value to a big function with 3 different paths, you could have 3 classes that have a common interface, and pass one of those to the function to use. That is nicer sometimes, other times not.

Another thing is that enums are often used to have a small INT DB column, which is not supposed to represent a number (like for math and stuff) but different options. In that case, yeah enum is perfect to describe in code what those numbers actually mean.

But yeah, it all comes down to: After you write it, look at your code and see if it makes sense quickly - if not, adjust.

path: 0 25737626 25737654 25738905, hotness: undefined, score: 10, children: 0
dreadbeef 2 points a month ago

f# enums better

path: 0 25737626 25738210, hotness: undefined, score: 2, children: 0
Endmaker 2 points a month ago

Please elaborate.

path: 0 25737626 25737660, hotness: undefined, score: 2, children: 4
ZILtoid1991 1 point a month ago

Enums in Rust are spicier unions, and Rust boosters like to paint it as the perfect way to do it, because it's the best language ever, with no faults. If you disagree, they'll try to frame you as a Lunduke fan and a bigot.

path: 0 25737626 25737660 25737753, hotness: undefined, score: 1, children: 3
RustyNova 6 points a month ago

Never said that. In fact, enums have lots of issues that can add a lot of boilerplate code.

But actually having data associated with the type system instead of just a flag is a lot more powerful and less prone to errors than classic enums

You can also put functions on this union type that allows easy abstraction of what state the union is in

path: 0 25737626 25737660 25737753 25738989, hotness: undefined, score: 6, children: 0
Johanno 1 point a month ago

Iffind rust interesting but I don't use it enough to know anything deep about it.

All I know is that I am not made for c++.

Hell I can't keep track of pointers and scopes. And who the hell made templates?

path: 0 25737626 25737660 25737753 25737902, hotness: undefined, score: 1, children: 1
ZILtoid1991 0 points a month ago

Templates outside of D are a mess, and the reason why metaprogramming has a bad name. Templates inside D are easy to use, and its attempt at it is something more language should copy.

path: 0 25737626 25737660 25737753 25737902 25737960, hotness: undefined, score: 0, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33571
2550
7101

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...