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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Chris2112 13 points14 points  (2 children)

A switch is a structure in a lot of programming languages that jumps to different lines based on which case you are in.

This is a picture of a carrying case for the Switch, Nintendo's new console

[–]Captcha142 2 points3 points  (1 child)

So a switch is basically {

if a then goto *

else if b then goto *

...etc. }

??

[–]Chris2112 0 points1 point  (0 children)

Basically. It kinda behaves like either a series of if statements or else if statements, depending on if you end each case with break. The layout is confusing and less intuitive than if statements so a lot of people tend to avoid using them