That boomer who uses switch-case instead of if-else

>that boomer who uses switch-case instead of if-else

Attached: 1525388794348.png (380x349, 77K)

Other urls found in this thread:

youtu.be/7uLzaKlZSQQ?t=349
youtube.com/watch?v=7uLzaKlZSQQ
twitter.com/NSFWRedditGif

It works well when processing opcodes dingus

I'm learning how to program. Why wouldn't I? Seems a nice way to organize code.

It's a leftover from the 70s along with goto labels

>dumbfuck kids still using "boomer" when they don't understand that boomers were born in the 1940s-early 1960s
Love how dumb kids make up a shit term that's already used.

That’s what people are doing. They’re trying to make a 70s mainframe where it’s 2 megs per 100 people. This is why TempleOS is better than Linux.

Switching in HolyC is actually very good and easy though. That’s why it’s the best

>boomers still old and seething

because its old, you wouldn't use a language older than 10 years so why use this ancient shit?

>kids have no perception of age
How did you graduate high school? Oh wait, everyone on Jow Forums is like 12, sorry, my bad.

ITT seething boomer neckbeards

Attached: 1444834474758 (2).webm (1920x1080, 265K)

Here some serious reply switch case can act like a hashtable and is more performant.

>that zoomer who uses for loops instead of while loops

if(i == 0){
//code
}
else if(i == 1){
//code
}
else if(i == 2){
//code
}
else if(i == 3){
//code
}
else if(i == 4){
//code
}
else if(i == 5){
//code
}

Attached: brainlet.png (645x614, 83K)

>you wouldn't use a language over 10 years old
user... you fucked her bud

Hi, CIA nigger
youtu.be/7uLzaKlZSQQ?t=349

We know proper programmers maps potential outcome of operation to a dictionary and process function in dictionary. Wait, that's switch case.

What's the difference in HolyC?

for (var i = 0; i < 10; i++) {
i == 0 && console.log(i)
i == 1 && console.log(i)
i == 2 && console.log(i)
}

The CIA wants you to think it's the same as if else if
youtube.com/watch?v=7uLzaKlZSQQ

Imagine actually writing code like this

It's also faster, dumb-dumb

Depending on language and architecture, the compiled code of a switch statement can have better performance. It's premature optimization, but it can be helpful in context of things like embedded systems,

Why would you not?
If you can't read it you should be fired for not knowing the basics of the language

>"Boomer" is the name commonly given to individuals born during a babyboom - a period of time with an unusually high birthrate
Sad part is there are actual brainlets that are not baiting and just parroting buzzwords among these fucks

>Posting on Jow Forums and not understanding the 30y/o boomer meme
wtf senpai

Next code that I would need to use switch would be like this...

Actually it seems more readable to me, because it uses abstractions more symbolic than stringual.

>tfw 28 yo boomer
I know what the meme is, I'm saying now there's normies just following the trend while not knowing shit, and genuinely think boomer=older than me

>goto is bad because is old

>tfw going for beers tonight with my actual boomer friend ( trump voter born in 53)

Attached: 1451550118932.jpg (540x900, 107K)

How else would I use fall through?

you're not going to last long in any job

Your post roughly translates to: "I don't know what's going on, time to activate defensive mechanisms"

I actually know and that's why I know you're a retard, I tell you why


1. If your function that's ANDed with your condition returns 0 or NULL even if if this is the valid expected result, your condition is discarded as false

1. you can't guaranteed that the compiler will respect this ordering and you may have to execute every function with every condition which will destroy the performance if it's very intensive or on a hot path

So?

You're just creating random situations that break the code on purpose, if you want to be a retard about it then just use ternary operator instead to guard against false, even though in this example it's impossible, but whatever.

You can do this with any piece of code by saying "lol what if I just return false randomly in the middle of your code for no reason xD"

so what retard? your logic is broken

try to show your bullshit to any experienced programmer in real life and he will spit on your face, you're not even worthy of my time to argue with you

>your logic is broken if I break it on purpose
now this is epic

The reason to use switch is not because of how it looks

Codelets... When will they learn...

Everyone in their mother knows what short circuit evaluation is. You've been at this what, like a year and you think you are better than everyone else? You'll never get anything past code review kid.

>he doesn't encode every if-else block into a jump table
That's basically what every compiler is doing when the switch case statements are close with one another.

>compfy pattern matching

def showNotification(notification: Notification): String = {
notification match {
case Email(email, title, _) =>
s"You got an email from $email with title: $title"
case SMS(number, message) =>
s"You got an SMS from $number! Message: $message"
case VoiceRecording(name, link) =>
s"you received a Voice Recording from $name! Click the link to hear it: $link"
}
}
val someSms = SMS("12345", "Are you there?")
val someVoiceRecording = VoiceRecording("Tom", "voicerecording.org/id/123")

println(showNotification(someSms)) // prints You got an SMS from 12345! Message: Are you there?

println(showNotification(someVoiceRecording)) // you received a Voice Recording from Tom! Click the link to hear it: voicerecording.org/id/123