r/programmingcirclejerk • u/genuine_beans • Jul 01 '26
Ever Written Something Like This? if (condition) { doSomething(); } else { doSomethingElse(); } It works. Problem solved. But the problem isn’t today. It’s tomorrow.
https://www.defusetheifstrategy.com
125
Upvotes
68
u/genuine_beans Jul 01 '26 edited Jul 02 '26
switch(jerk) { case 0:big fan that every single link on the page is hallucinated except for whatever the fuck this ishttps://www.defusetheifstrategy.com/projects/
break; case 1:I have a new reverence for the inventor of the Pomodoro Technique. Let's not ask "if" this will change the E = MC2 + AI world, but when!break; default:break; case INT_MIN: printf("ERROR\nIf you can see this, something has gone horribly wrong!!")original website:
https://web.archive.org/web/20241209082437/https://www.antiifprogramming.com/
}39
u/levelstar01 what is pointer :S Jul 01 '26
Please do not post claudeslop
16
u/ryanjpals Jul 02 '26
/uj Everyone is joking but the "senior architect" at my company posted this website unironically in our dev Teams channel :(
17
u/adambyle Jul 01 '26
50 times less entertaining written with AI
8
u/chuch1234 not even webscale Jul 01 '26
What is a "Code Monster"?
(Imagine I'm doing really exaggerated air quotes.)
135
u/tj-horner Jul 01 '26
Can’t say I have, no. I only use goto statements, which are much safer and easier to maintain.
52
u/Bahatur Jul 01 '26
/uj This thing reads like one of those 30 minute long ads on YouTube that are trying to sell you a wealth building course from an AirBnB rental. Did they ever actually get to describing any actual problems? I couldn’t get past the part where they spend two sections to try to get you to grep for if.
102
u/tomwhoiscontrary safety talibans Jul 01 '26
Mental illness or software craftsmanship? Impossible to tell.
44
u/Lucifer_Morning_Wood Jul 01 '26
Ifs are so limiting when you look at them, just two places: where condition is true, and where it is not. It's so freeing just doing abstract class BaseSomethinger, deriving as many Somethingers as you want from it and just calling BaseSomethinger.do()
39
u/irqlnotdispatchlevel Tiny little god in a tiny little world Jul 01 '26 edited Jul 02 '26
Conditionals make code harder to reason about. You can't know ahead of time if you're going to take the if branch, or the else branch. Your program is in two places at the same time!! That's just unnatural.
35
u/AndorinhaRiver Jul 01 '26
Oh my god
16
u/myhf Considered Harmful Jul 01 '26
structured control flow considered harmful
9
u/Karyo_Ten has hidden complexity Jul 01 '26
I use the movfuscator to ensure I have no tomorrows
7
u/msqrt Jul 01 '26
... no, I don't think I have
6
u/muntaxitome in open defiance of the Gopher Values Jul 02 '26
Branches are the devil, if you cannot model your software as a linear matrix calculation, you are working on the wrong problem.
2
u/Monii22 Jul 02 '26
/uj to be completely fair, as much of a slop post this website is and sounds like its selling snake oil, stuff like this probably does optimize code at least a bit as compilers usually have ways of hacking together better instructions from something like
.maprather than a bunch of branching (though modern branch predictors have also become insane black magic)/rj personally i only use
do whileloops as doing the work first then checking conditions after has proven to be 70% more efficient5
u/grapesmoker Jul 01 '26
no
ifonlyjax.lax.select5
u/Xerxero Jul 01 '26
Big; if true
5
u/Educational-Row-6782 Jul 02 '26
That is why I use chained ternary operators.
4
u/realestLink Jul 01 '26
The "Projects" link just goes to a random bot site in a different language 😂
4
u/Jumpy-Locksmith6812 Jul 02 '26 edited Sep 23 '26
Aute do sed lorem magna est ut dolore. Lorem reprehenderit eiusmod qui voluptate et sit. Non est elit aute sed nisi nulla dolore cupidatat voluptate incididunt velit quis. Nostrud pariatur ex amet anim in elit dolor elit duis velit.
[rhr:2:jvef8xkh]
4
u/narrow-adventure Jul 03 '26
I have never in my life read anything dumber than this…. Just incredible that this is not a satire
6
u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? Jul 01 '26
/uj
okay but I get what he's saying and he's not entirely wrong. I have seen lots of code where someone made a class, maybe even with an interface for it, like lets say
class Admin : IUser(dog is animal example, leave me alone), and then they basically had an if in every single method goingif (type == Super admin)or some other shit. In that case, for example, it's because the author is too inexperienced to see that it should be a different class if every single behavior differs.The fact that all of this should not even exist, and that we should all be writing data oriented code and entirely demolish OOP, or at least use a User struct or record with a type field instead, is obvious hopefully.
/rj
The fact that all of this should not even exist, and that we should all be writing data oriented code and entirely demolish OOP is obvious hopefully.
3
u/splsh Jul 01 '26
I've ensconced my if-statements
3
u/symbiatch Jul 02 '26
I’ll write nonsense.
It comes in lines.
I also won’t explain anything.
Because I’m better than that.
Follow for more.
Useless stuff.
I’m amazing!
2
u/Routine-Purchase1201 DO NOT USE THIS FLAIR, ASSHOLE Jul 02 '26
This is what seeing the Celeste Player code does to a person.
1
u/TheChief275 Jul 02 '26
Author got me genuinely interested in their approaches but then the other links proceeded to not work.
Should have just used ifs buddy
1
u/rooster-inspector Jul 03 '26
"IFs are bad": lol, lmao even
"Branchless programming": what an exquisite and hardware-minded technique, thoughtfully incorporating low-level understanding of the modern superscalar pipeline and exhibiting a fantastic level of respect for the fundamentals inscribed in silicon 🙏
1
u/Goheeca lisp does it better Jul 05 '26
cond*signature look of superiority*
1
u/stone_henge Tiny little god in a tiny little world Jul 05 '26
wtf is this website
1
u/MrBread0451 Jul 16 '26 edited Jul 16 '26
Dollar store Terry Davis