Deltarule
Deltarule
Deltarule
Bad naming practice. CheckSuck implies it only checks and returns the result. Everything the function does should be included in the name to avoid confusion. Call it SuckIfUnsucked or something
That was my first reaction as well. Even if you say you can see that it doesn't return a bool it's still ambiguus as to what (if anything) happens when the state is sucked/unsucked. I would also prefer a name like GuranteeSucked or EnsureIsSucked.
Who uses PascalCase for function names
C#
RWIIR!!!
edit: here, I did it for you:
use std::*; static mut sucked: bool = false; fn main() { unsafe { check_sucked(); } println!("Kris has been sucked is {}", sucked) } unsafe fn check_sucked() { if !sucked { suck(); } } fn suck() { sucked = true; }
edit 2: fixed it
How to make a suckless.org contributor cry
Why would you want to make things that are good suck? 🤨
I tried to make blowjob videos that don't suck, but nobody wanted to watch them.
"OK class, tonight read the chapter on enshittification."
Jojo fan program
hakita my beloved
Kirby, is that you?
bruh why is
unsucked
a global variablealso that function shouldn't be named
Check
if it does things other than checking (e.g. sucking)Could be inside a class for something to be sucked, making
unsucked
a variable for the class.CheckAndSuck
would be a better name for the function. I don't think the meme needed a code audit but here I am.Your naming advice is universally good.
However, if this was a functional programming language, there wouldn't be any mutable global variables to be unaware were being examined, nor could Suck do any sucking unless it were passed the thing to suck and returned the sucked thing.
In this way the subtle class of bugs that you both are warning against would be impossible to introduce.
Depending on the kind of sucking that Suck does, however, you may perceive the global invisibility and availability of the sucking as an advantage in this case. But possibly not if the code is your girlfriend/boyfriend.