"possibly the nastiest piece of abuse of the C switch statement rules I know of"

pavel_lishin 39 points 11 comments November 23, 2026
hachyderm.io · View on Hacker News

Discussion Highlights (4 comments)

TZubiri

> exposed a compiler bug i’m 99% sure this was unnecessary and hubrish whats that phrase about if you write the most clever code you can within the writing context, future you without that context won’t be able to understand it. well you were so clever that the compiler didnt understand it

janderland

Haha, love this. It’s funny they’re saying “don’t use GOTO” because this approach makes it obvious that switch cases are equivalent to GOTO which can transport you into one of the impossible of statements.

pavel_lishin

I did a double-take when I saw the name of the author, as I've been playing his puzzle packs for years. (Not to mention Putty - which I haven't used in probably a decade, but was my go-to in Windows.)

svilen_dobrev

also check: How to Get Fired Using Switch Statements & Statement Expressions\ https://blog.robertelder.org/switch-statements-statement-exp...

Semantic search powered by Rivestack pgvector
3,966 stories · 36,002 chunks indexed