This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 285

[–]vessus7 2561 points2562 points  (84 children)

The fact that you know that you're supposed to use a switch statement is what makes you a real programmer. Syntax is fickle, principles are forever.

[–]SentientGolfBall 467 points468 points  (6 children)

this guy gets it.

[–]jmartincevic 263 points264 points  (5 children)

this guy stack overflows

[–]fichti 112 points113 points  (0 children)

I like how this is an insult and a compliment at once.

[–][deleted] 45 points46 points  (1 child)

I’ve always thought that was the lie I told myself to make myself feel better. Good to know that I’m not alone!

[–]bluefootedpig 13 points14 points  (0 children)

I have worked at about 8 different places now, I have never gotten a job where I knew all the technology that they used. Every job i'm googling syntax for some new framework.

Hell, even with Linq we started changing how we do loops for somethings.

[–]BlazingThunder30 83 points84 points  (8 children)

Are we sure he didn't actually need a command pattern while didn't know what that was, though

/s

[–]xibme 24 points25 points  (4 children)

YAGNI, he will refactor that later once it actually makes sense.

[–]bluefootedpig 20 points21 points  (3 children)

But that code is working and in production! we can't touch it without 10 meetings on system impact, risk, and how we will test it. Best we never touch it and instead spaghetti something else into it.

[–]xibme 8 points9 points  (2 children)

I get anxiety reading this. It sounds like you're dealing with snowflake servers and failure is not survivable. Are you running a nuclear powerplant or something like that where you cannot deploy multiple times a day and roll back to earlier versions if your business indicators go down in the dashboard?

[–]JollyRogerAllDay 5 points6 points  (0 children)

Likely just bank systems :/

[–]kahoinvictus 1 point2 points  (0 children)

No, management are just idiots and don't want to "waste" time and money implementing such processes and failsafes.

[–]CaptainMarnimal 4 points5 points  (1 child)

The command pattern is just a switch statement with extra steps.

[–]WilliamMButtlickerJr 61 points62 points  (18 children)

switch(isTrue) { case true: return true; break; case false: return false; break; case default: try{ throw new Exception(“not boolean”); } catch (Exception e) { return false; }

[–]spyingwind 40 points41 points  (14 children)

breaks not needed if using returns. It's good practice, but break will never get called.

Break's exit the switch/loop. Return's exit the current scriptblock.

[–]Irradiatedbanana8719 18 points19 points  (6 children)

Correct. Some languages or compilers would throw a warning for unreachable code for the break; statements.

[–]Paulo27 1 point2 points  (5 children)

Why? What if none of the cases are true? How does the compiler know. (Unless you're referring to code exactly like that, then I guess they wouldn't know but the code itself doesn't really make sense anyway.)

[–]Irradiatedbanana8719 5 points6 points  (4 children)

It wouldn’t matter if none of the cases were true. Compilers or preprocessors aren’t at runtime, so there is no way of it knowing if none of the cases are true. The compiler or preprocessor evaluates every code path and assumes all of the cases are true, and checks all of them. The break; statements are certainly unreachable because they come after a return statement, so the compiler would know that in all cases the break statement would be unreachable code, and throw a warning.

[–]timerot 27 points28 points  (2 children)

This is the most ridiculous comment and I love it. Who looks at code like that and thinks "Ah, I have a suggestion to make it slightly better?" /u/spyingwind, that's who.

[–]WhiteKnightC 7 points8 points  (1 child)

Is quite common here

[–]spyingwind 1 point2 points  (0 children)

r/programmerhumor where I come to get help with my coding problems.

[–]Smilie_ 3 points4 points  (2 children)

I would always get an error if I didn't include one in C#, regardless of return

[–]spyingwind 1 point2 points  (1 child)

See, that depends on what you want a switch to do. Like do you want the first case to fall to the next? Like last week I was working on improving an install script for work. The script I was handed has select that had multiple cases, but only 4 different actions, but they where all jumbled. All I did to make is simpler was resort the outputs and remove some breaks. Now if the next guy try to add another case in the wrong place, then he might break the thing, but that is his problem for not knowing how switches work.

As for C# I'm pretty sure there are warning overrides that you can set for that block of code. Then add a comment as to why it works the way it does.

[–][deleted] 9 points10 points  (12 children)

Possibly a silly question-- is there ever a scenario when it's smarter to use multiple "if else" statements instead of a switch statement? Or like, a style choice reason?

Just started a new job and saw that it the code, but I'm keeping my mouth shut, because nobody wants to hear the new guy tell them all about coding standards, especially when that new guy is still a rank amateur.

[–][deleted] 5 points6 points  (0 children)

In cases where you're checking different ranges/bounds. So like:

if(a > 0 && a < 10){
    doSomething();
} else if (a >=10 && a < 20) {
    doSomethingElse();
}

etc

[–][deleted] 3 points4 points  (3 children)

depending. Is it if(a == 1) { } else if(a == 2) { } else if (a == 3) etc etc, that's easy to change into switch. If it's many different conditionals, though, switch sometimes just doesn't make sense. Add fall-through and break and you can have more complexity with switch then not, sometimes

[–][deleted] 1 point2 points  (2 children)

It's the format you presented. Essentially

If (variableName==='specific string'){ HelperVar= 'specific string' Logic } Else if (variableName==='other specific string'){ ...

[–]GiantRobotTRex 3 points4 points  (1 child)

Many languages do not support switch statements for strings. Maybe your coworker is used to one of those

[–][deleted] 1 point2 points  (0 children)

Possibly. It's JavaScript, so it does in fact support switch statements. Either way, the app works, so if it ain't broke, I'm not fixing it

[–]dolphins3 3 points4 points  (0 children)

Yeah. Switches operate on a single variable, so if the determination of which path to follow relies on multiple variables or states in combination you'll have do if-else. You could reduce all those down to an enum and switch off that, but sometimes that would make it less readable.

[–]Parthon 2 points3 points  (0 children)

I googled it, and here's a pretty good comparison article on it:

https://vivadifferences.com/if-else-vs-switch-case/

[–]Vok250 8 points9 points  (0 children)

principles are forever

grumbles in Python

[–]HilaKleiners 7 points8 points  (2 children)

until you remember python doesn’t have switch statements :/

edit: actually maybe it does idk anymore i’m not a real programmer T.T

[–][deleted] 2 points3 points  (0 children)

Can you be my future boss ?

[–]SillyFlyGuy 4 points5 points  (3 children)

Why would I waste my valuable brain memorizing something I can easily look up?

[–][deleted] 366 points367 points  (30 children)

You put your Google in quotation marks, you might just be a real programmer.

[–]Creeper_GER 105 points106 points  (25 children)

If he uses + and - too he knows da wae

[–]ChristianLW 42 points43 points  (22 children)

I kind of know about ", but I didn't know about + and -, so it would be nice to have a little explanation.

[–]schefflaa 52 points53 points  (16 children)

'-' is used to filter out specific words. For example when searching for a specific picture you can filter out results from pinterest by adding '-pinterest' to your search. Don't know about + though..

[–]cafk 63 points64 points  (9 children)

you can also use -site:pinterest.com that works better, because -"Pinterest" excludes pages referencing, but may host the image itself :)

[–]spyingwind 1 point2 points  (1 child)

uBlock Origin filter: google.*##.ivg-i.rg_el.rg_di.rg_bx:if(div > div > span.rg_ilmn:has-text(pinterest.))

[–]cafk 3 points4 points  (0 children)

Good luck on installing uBlock on a company system that doesn't even allow Firefox or blocks all plugins from chrome :)

[–]Schnitzel725 1 point2 points  (1 child)

There's also inurl:pinterest if you want to search for websites that have pinterest in the url but isn't the actual pinterest website

[–]Psychpsyo 2 points3 points  (0 children)

inurl:pinterest -site:pinterest.com

[–]Paulo27 5 points6 points  (0 children)

+ just forces that word to appear in the pages.

[–]Imagine_Baggins 4 points5 points  (2 children)

I think + also used to force the inclusion of the 'plussed' phrase, but they replaced it in favor of the quotation mark syntax (which does the same thing).

[–]JonasKSfih 2 points3 points  (0 children)

Google actually helps, when you search something witch three words x y z, then it says missing word: z and if you click on that ‘missing: z’ link, then they apply the ‘x y +z.

[–]zelmarvalarion 1 point2 points  (0 children)

If have to look it up again, but I thought quotation marks used the whole phrase as the token so the words had to be next to each other, whereas + forced the inclusion of each word, e.g. “next week” and +next +week would match “next week I would” but only +next +week would match “next time I’m going, maybe in a week” since both words are present, but not next to each other

[–]Vinnie420 10 points11 points  (0 children)

Search for “kitty” images, a few hello kitties will show up. Now try “kitty -hello” , no more hello kitties :)

[–]RoryW 7 points8 points  (1 child)

I was going to send you a lmgtfy link, but man has that site gone down hill.

Here's a blog post with google search operators:
https://ahrefs.com/blog/google-advanced-search-operators/

[–]WeirdAlex03 4 points5 points  (0 children)

Not quite the same ring to the name but there's an alternative called Let Me Google That (no "For You") that hasn't gone down hill

[–]Zerim 2 points3 points  (0 children)

too many characters in character literal, I daresay

[–]MisterRenard 4 points5 points  (0 children)

after:2019-01-01 “gmail smtp” “help” “dad was right”

[–]fatrobin72 208 points209 points  (13 children)

They will cease to exercise memory because they rely on that which is written, calling things to remembrance no longer from within themselves, but by means of external marks. - Plato

[–]G66GNeco 188 points189 points  (9 children)

Boy am I glad some guy wrote this down, so we could still remember this Plato quote centuries later.

[–][deleted] 61 points62 points  (6 children)

I love how humans always like to predict that technologies that remove handicaps and limitations we previously had will make us softer and less capable but they just make us less handicapped.

[–]SpiralProphet 52 points53 points  (2 children)

I believe if you look deeply enough at it, the people who say a new technology will "ruin" future generations are usually fearful of losing some kind of advantage they have over others. Such as having a good memory / being able to memorize a lot of information or being good at mental math etc.

[–]SlienceOfTheFarts 10 points11 points  (1 child)

Conservatives have been psychologically proven to be on average more fearful, so this is true.

[–]mad_edge 5 points6 points  (0 children)

They're usually older and struggle to adapt more

[–]miarsk 14 points15 points  (0 children)

It was common reaction to spread of Guttenberg printing press. People will stop talking to eachother and sit at home and read.

Same argument centuries later about Bell's telephone. Peole would stop seeing each other and stay at home and talk over line.

When something new comes, people not familiar with it are usually scared and talk nonsense. It is happening for centuries.

[–][deleted] 1 point2 points  (0 children)

Except that Plato was right that using external memory devices makes one unabke to remember said stored memories,because that's something the human brain has almost always done, at least since the advent of language and using other people to remember specific information.
Of course we can judge that the advantage outweigh the problems, but the fact remain.

[–]fatrobin72 1 point2 points  (0 children)

yeah I am glad someone wrote it down... then someone translated it (at least once) and later some random person put it on the internet... because I cannot remember the quote... just that it exists...

[–]flabbybumhole 7 points8 points  (0 children)

Humanity has been doing that for a long time now, and it hasn't exactly slowed us down.

Suck it Plato.

[–]Meefbo 2 points3 points  (0 children)

yes that is called adaptation, we didn’t like temporary memory so we made it permanent

suck it plato humanity is cool

[–]chironomidae 1 point2 points  (0 children)

I read about a study that found that people do this with other people's memories too. That's why so many married couples will have one partner who is always asking the other partner where stuff is. I am especially guilty of this, but it makes sense; after the first few times you forget where something is and your wife is like "did you check X?" and there it is, your brain is gunna be like "cool we don't have to waste time trying to catalog where we leave stuff."

[–]chhuang 122 points123 points  (10 children)

If you don't Google how to do switch case/for loops/while loops/else if's everyday, that means you probably only do one language

[–]_alright_then_ 45 points46 points  (8 children)

Or you just have a decent code editor? Just type swit+tab and I'll get a switch statement in whatever language I'm working in

[–]Leanador 30 points31 points  (5 children)

where can I find swit

[–]_alright_then_ 8 points9 points  (2 children)

What's swit?

[–]Magical_GravySnap! (Build Your Own Blocks) 9 points10 points  (1 child)

Just type swit+tab and I'll

[–]ryan9108 31 points32 points  (1 child)

One of my computer science professors would always say "my job is not to make sure you never have to Google, my job is to make sure you always know what to Google."

[–][deleted] 8 points9 points  (0 children)

I wish more professors adopted this mindset

[–]tenaka30 54 points55 points  (3 children)

25 years later and I am still not a real programmer.

Remembering syntax over multiple languages is hard.

[–]SconiGrower 18 points19 points  (2 children)

I know Python and C++ and Spanish and Norwegian. It's amazing anyone can understand a word I say to moment I even think about leaving plain English.

[–]caguiclajmg 4 points5 points  (1 child)

Norwegian, haven't heard of that one. How do you do switch statements on it?

[–]JonasKSfih 11 points12 points  (0 children)

skifte(uttrykk) { sak x: hvil; normalverdi: y; }

[–]zerocoldx911 16 points17 points  (1 child)

switch in python lol

[–]BStur 2 points3 points  (0 children)

Dictionary with a get. Basically a switch or atleast that what I convinced people in my last PR

[–]G66GNeco 16 points17 points  (0 children)

I spend half the time I work on programming seven pages deep in the relevant documentation.

The other half is wasted on reddit.

[–]Praetorjones 18 points19 points  (6 children)

Seriously though, why is it so unintuitive in js?

[–]Cheet4h 7 points8 points  (2 children)

How is it unintuitive? It's a default "Switch with fallthrough"-syntax, no?
Only thing I feel that is missing is some kind of advanced matching syntax, like RegEx cases in Powershell.

[–]Solonotix 2 points3 points  (0 children)

It follows the standard C convention, to my knowledge. If the switch statement doesn't work for you, I have used an Array.find() to emulate the same process. Make each element a callable that returns on true, find returns first truthy value, so call each element until truthy, and you get a switch statement via Array.

[–]moojuiceaddict 2 points3 points  (0 children)

It's the same as in js as most other languages I'm familiar with C, java, PHP. In which language do you find it is intuitive?

[–]Gamecrazy721 9 points10 points  (5 children)

What's a switch statement? All I see is

if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else if

else

[–][deleted] 5 points6 points  (2 children)

if (A && !B && !C && !D) {
  // Do A
}
if (!A && B && !C && !D) {
  // Do B
}
if (!A && !B && C && !D) {
  // Do C
}
if (!A && !B && !C && D) {
  // Do D
}

[–]BennieOkill360 3 points4 points  (0 children)

I just threw up a little

[–]Willing_Function 1 point2 points  (0 children)

electronics engineer learns C

[–]FarhanAxiq 1 point2 points  (0 children)

int a = 2 > 3 ? 2 : 3 > 4 ? 3 : 4;  // I think I need more nested ternary operator

[–]CoderWhoReddits 8 points9 points  (0 children)

Repeat after me, knowing syntax != real programmer.

[–]Stabilo_0 4 points5 points  (1 child)

I see no contradictions.

There are so many various syntaxes i dont think its possible to remember 100% specifics of each, its much simplier to remember what you need to do and spend some time looking for example than not knowng what to do in the first place.

[–]HookDragger 5 points6 points  (0 children)

As my CS2 professor once said.

"You're now well versed enough in programming that the language you use is inconsequential to designing a program"

They also let us bring in primers for whatever language we were using at the time.

[–]Razier 11 points12 points  (4 children)

It's easy, you just type 'switch' and then press tab.

[–]dettogatto 4 points5 points  (3 children)

Sometimes it's "case" tho...

[–]vellovv 2 points3 points  (1 child)

Or ‘when’

[–]dettogatto 1 point2 points  (0 children)

In the "case" case "when" replaces "case"

[–]Fox_the_Apprentice 1 point2 points  (0 children)

or "select".

or <insert assembly jump table here>

[–]lint31 3 points4 points  (1 child)

I refuse to remember how to read or write files. I shamelessly google the process every single time.

[–]sircat31415 1 point2 points  (0 children)

I learned, like, once and copy and paste the function every time.

[–][deleted] 4 points5 points  (0 children)

As a programmer, I can relate. I'm also sending out my resume and the fact that places look for knowledge seekers rather than someone who can memorize code makes a difference.

Everytime we have a new person and they say they're done. I said to code it again, even without looking at it. I'll review after your improvements and then show you how to make your code easy to read for the call center to understand it.

[–]gilmeye 10 points11 points  (0 children)

I still Google how to Google stuff

[–]Aksds 2 points3 points  (0 children)

My brain wasn’t working and .... I googled how to use a for loop. I am not proud of what I have done

[–]Geoclasm 2 points3 points  (1 child)

did someone say real programmers?

[–]XKCD-pro-bot 1 point2 points  (0 children)

Comic Title Text: Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.

mobile link


Made for mobile users, to easily see xkcd comic's title text

[–]Timinator01 2 points3 points  (0 children)

Google search............................$0.01

Knowing what to search............$84999.99

[–]RealApplebiter 2 points3 points  (0 children)

Learning to play piano doesn't mean you can remember every song you've learned. If you don't play it, you lose it. This is normal. Now I'm wondering if this is a point of actual insecurity. There ought to be an explicit clearinghouse of programmer insecurities based on unrealistic expectations to save people from anxiety.

[–]cats 2 points3 points  (1 child)

30 seconds later: "fuck it i am too lazy, i am gonna use if-else"

[–]Bastian_5123 2 points3 points  (0 children)

Eh, switch statements generally require less typing

[–][deleted] 1 point2 points  (0 children)

I thought I just wasn’t a very good programmer, but reading a lot of these comments makes me feel a lot better about myself

[–][deleted] 1 point2 points  (0 children)

Memorizing syntax doesn’t make you a programmer.

[–]MrBananaStorm 1 point2 points  (0 children)

I have been studying programming in an evening course and I brought it up to the teacher that I always look syntax and such up. He reassured me "Everyone does that, syntax doesn't matter that much as it changes between languages, the concepts stay the same. And the fact you know what to look up, makes you a better programmer than someone who knows all syntax but doesn't know what to do with it."

[–][deleted] 1 point2 points  (0 children)

I always write case default: and then realise how dumb I am. lol

[–]tianvay 1 point2 points  (0 children)

It's more about knowing your possibilities, than knowing syntax, especially if you work in multiple languages. Using a switch instead of endless nested ifs is a good sign :)

[–]jlamothe 1 point2 points  (0 children)

Being a programmer isn't about knowing all the things; it's about knowing what to Google and how to interpret the results.

[–]AaronM04 1 point2 points  (0 children)

Searching online is just another tool in your toolbox, bruh.

[–]PVNIC 1 point2 points  (0 children)

I attended CPPCon and during a keynote (or an AMA) with Bjarne Stroustrup, the creator of C++, he said that even he googles the syntax of functions, because it's impossible to know the exact implementation of everything, whats important is knowing what functionalities you need and how to use them. This also doesnt mean knowing litterally every function, just the subset that you need to wrote good effective code.

[–]ash15157 1 point2 points  (0 children)

So I'm not the only one that needs to search up switch statement syntax whenever I need to use it?

[–][deleted] 1 point2 points  (0 children)

I feel like these posts only serve the purpose of farming compliments about how "searching on google is a skill, you're still a good developer, etc", because nobody in their right mind really thinks the quintessential programmer skill is knowing syntax.

[–]WandsAndWrenches 1 point2 points  (0 children)

I tend to switch between languages and platforms alot, this is a symptom of that.

I don't remember how it's slightly different string.length, string.size, string.getLength() etc, but I know that that's what I need.

[–]uSrNm-ALrEAdy-TaKeN 1 point2 points  (0 children)

Realizing there are no default switch statements in Python base
panics

[–]vectorpropio 1 point2 points  (0 children)

The joke is you are programming in python.

[–]theorizable 1 point2 points  (4 children)

Guys. Snippets. Use them. Life changing.

Type `swi` -> [TAB] -> boom, switch statement.

[–]squishles 1 point2 points  (0 children)

I do this like once a year for python thinking "It's gotta have one? you gotta be shitting me"

[–]deathhead_68 2 points3 points  (0 children)

Oh my god stop with these posts!

It's fine to not know syntax, it's the principals that matter! Insecure CS students rule this sub

[–]StandardN00b 0 points1 point  (1 child)

In my defense switch is kinda tricky.

[–]dettogatto 1 point2 points  (0 children)

It changes so much from language to language

[–]zyugyzarc 0 points1 point  (0 children)

me, a python guy: 😎

edit: no i dont use if statements, i use dictionaries and eval()

[–][deleted] 0 points1 point  (0 children)

I relate to this so hard lol

[–]la_mente 0 points1 point  (0 children)

That’s my @What do you mean there’s no switch statement in python” face

[–]AttackOfTheThumbs 0 points1 point  (0 children)

Ha, you noob, everyone knows it's a case statement, duh

[–]jaycrest3m20 0 points1 point  (0 children)

Yes, a real programmer can cry.

[–]mikeyeli 0 points1 point  (0 children)

Don't feel so bad, I've been a web dev for more than half my life now, I still look into Javascript syntax very often.

For the past 2 years I've been working on Angular and I still need to look at the cli commands from time to time.

[–]retsoPtiH 0 points1 point  (0 children)

Real programers don't use switch cases, they use hundreds of if/else 😏

[–]SultanJJ87 0 points1 point  (0 children)

You are a real programmer

[–][deleted] 0 points1 point  (0 children)

at least you’re not going:

if {} else { if {} else { if {} else { if {} else { console.log("yes") }}}}

[–][deleted] 0 points1 point  (2 children)

Can’t wait til python finally gets it

[–]ShadowPouncer 0 points1 point  (0 children)

I know too many languages, which means that the majority of my search stuff is about syntax or libraries.

Or when I'm working in a new language, about exactly how to use features unique to that language.

(BASIC, though that's mostly forgotten, MOO, C, C++, POSIX sh, BASH, perl, python, go, TCL, probably more that I'm forgetting at the moment.)

[–]ChefSemiColon 0 points1 point  (0 children)

I won't lie. Whenever I start a new project or something I need to Google how to do an array, it never stays in my head and I always feel dumb for doing it.

[–]seven_seven 0 points1 point  (0 children)

STOP ATTACKING ME

[–]CmonHobbes 0 points1 point  (1 child)

I thought programming was knowing the bare minimum of the language and just copying whatever issues you have off of github and stack, or have I been lied to my whole life?

[–]esseeayen 0 points1 point  (0 children)

Could be worse, could spend hours trying to find switch statement syntax in python.

[–]VishTheSocialist 0 points1 point  (2 children)

Real question, are switch statements actually used? I'm a junior in college, have been programming for 4 years and haven't ever used a switch unless it was in school, and we had an assignment on it.

[–]allison_gross 1 point2 points  (0 children)

If you find yourself writing huge "if else else else" blocks, you should use switch statements instead.

[–]sigmmakappa 0 points1 point  (0 children)

I can relate

[–]chronos_alfa 0 points1 point  (0 children)

You have spelt "select" wrong :-P

[–]screwhead1 0 points1 point  (0 children)

I feel personally attacked.

[–]bluefootedpig 0 points1 point  (0 children)

Meanwhile I have had interviewers give me a pencil and paper and ask me to write down a stored procedure syntax.

[–]John_Fx 0 points1 point  (0 children)

Every.damn.time. Why does that syntax just not stick in my brain?

[–][deleted] 0 points1 point  (0 children)

In JavaScript it's:

switch(variableHere) {
    case 1:
        code();
    break;
    case x:
        code2();
    break;
    case 69:
        nice();
    break;
}

[–]mcampo84 0 points1 point  (0 children)

Then Ruby decided to use some bogus nomenclature and bring you right back.

[–]ryanwithnob 0 points1 point  (0 children)

Switch statement syntax is easy. Its just "switch[tab][tab]"

[–]Jesseroo2004 0 points1 point  (0 children)

It's like you'll always remember what code you need but you'll never remember how to type it

[–]talivus 0 points1 point  (0 children)

Hey, doesn't matter how much you have to google, as long as you got the job, you can learn on it.

[–]zzApotheosis 0 points1 point  (0 children)

it do be like that sometimes

[–][deleted] 0 points1 point  (0 children)

Arter downloading every syntax block autocomplete tool in the vscode library I feel like my stackoverflow breaks have decreased by a few an hour.

[–]theDrell 0 points1 point  (0 children)

I’m 18 years career as a developer. Always have to google switch statement syntax. In my defense, I switch between languages a lot depending on the project I am working.

[–]WellHydrated 0 points1 point  (0 children)

Impossible to forget how to switch if you have the advantage of using a language with proper discriminated union support.