← Home ← Back to /lgbt/

Thread 40386849

16 posts 8 images /lgbt/
Anonymous No.40386849 [Report] >>40386862 >>40386874 >>40389127
i don't trust switches
CES !YJcFgIOyXg No.40386862 [Report]
>>40386849 (OP)
Must be 120 IQ based on pic, past 140+ you start to realize how arbitrary it all is for real.
Anonymous No.40386874 [Report] >>40386880 >>40386894 >>40386998 >>40387884 >>40389036
>>40386849 (OP)
you could've fooled me, Jason
Anonymous No.40386880 [Report] >>40387860
>>40386874
Is that a switch that does nothing?
Anonymous No.40386894 [Report] >>40387860
>>40386874
what the fuck? don't tell me he wrote this.
Anonymous No.40386998 [Report] >>40387798 >>40387860
>>40386874
I wish I had the background that would allow me to point and laugh at this like everyone else. Can someone summarize what this is trying(failing?) to do, and why it's stupid? I feel left out
Anonymous No.40387798 [Report]
>>40386998
it's a redundant (vestigial?) check for something it never tests, like it's saying
>okay look at this number, now ignore that and do something unrelated to it
Anonymous No.40387860 [Report] >>40387964 >>40388840
>>40386880
>>40386894
sadly, yes
>>40386998
a switch statement tells the program what to do depending on the value of a specific variable. so imagine your mom gave you treats based on how many answers you got right on the math test, if you got all 4 correct you get an ice cream sundae, if you got 3 correct you get a cupcake, for 2 you get a lollipop but if you got 1 or 0 answers right you get gruel. assuming a lot of logic and data validation already took place you could write out that process with something like this

switch(number_of_correct_answers) {
case 4:
treat = ice cream sundae;
break;
case 3:
treat = cupcake;
break;
case 2:
treat = lollipop;
break;
default:
treat = gruel;
break;
}

the default label denotes instructions that will take place if the value in the switch() doesn't meet any of the given cases. so if you got 0 or 1 answers correct you don't need to make cases for that you can just put it under default. (yes you'll still get gruel for -248 correct answers but i'm trying to simplify this as much as i can and i already mentioned pre-existing data validation). you can infer that making a switch statement with only a default block and nothing else does nothing because what you're asking the computer to do is "hey so if the thing in the switch() doesn't meet any of the listed cases, do this." and then you don't list any cases, meaning the default block will always trigger no matter what. that's exactly what pirate software did here.
Anonymous No.40387884 [Report]
>>40386874
bruh...
Anonymous No.40387964 [Report]
>>40387860
>food analogy
Anonymous No.40388840 [Report]
>>40387860
I deserve gruel for my social credit score
Anonymous No.40388916 [Report]
How do I know if I'm a switch? I feel like I don't quite fit in anywhere, I don't know if I'm even queer but I think I would date a tranny.
Anonymous No.40388919 [Report]
kek you shouldn't
Anonymous No.40389036 [Report]
>>40386874
whose code is this?
Anonymous No.40389127 [Report] >>40389167
>>40386849 (OP)
switches are usually just bottoms that are such doormats that they let other bottoms pressure them into topping
Anonymous No.40389167 [Report]
>>40389127
me