Comment on Real quick question about the "break"
TerrorBite@meow.social 11 months agoAlso, good luck using
switch
without anybreak
s, but I'm guessing that's not quite what your teacher had in mind.
The teacher, probably: “You must always put a switch
in its own function! Then use return
at the end of each case.”
zib@kbin.social 11 months ago
Good point, that is a valid way to do it sometimes, but it's extremely situational and trying to do that for everything would be absolute nonsense.
TerrorBite@meow.social 11 months ago
Oh absolutely. I can think of several situations where that wouldn't work well or at all, for example, a switch statement that sets up variables to be used in the rest of the function.
@zib @UnRelatedBurner @programming