+ 2
Is it common to use switch statements?
I was thinking and i realized that I don't usually use switch. Is it common to use?
3 Respostas
+ 14
It depends on how many multiple choices you want to implement in code.
Switch case is used to ease up multiple choice options rather than using many if and else statements.
So common or not but usage depends on you only.
+ 3
In a game, if a character has the ability to go North, South, East or West etc. it can be useful.
0
It depends on how much you want the condition to be, like what sanic said! In a game character has the ability to go south, west, north and east, here I think switch can be the best control structure to implement this action