Hacker News new | ask | show | jobs
by MrStonedOne 2268 days ago
One annoying thing about the war on case fallthrough at the language level is the lack of imagination.

`continue` is a thing, compliments switch's existing `break` statement usage and is overall a much better solution for explicitly specifying fallthrough then returning special objects or c#'s abuse of goto.

1 comments

I think it's a pretty syntax idea but it means continue works opposite your intuition inside switch statements compared to everywhere else.

I mean you could kinda argue that switch could conceptually mean something like

    for matcher, block in cases:
        if matcher.matches(subject) or continued:
            eval block
but then continue still feels magic since it bypasses the test.