Remix.run Logo
sshine a day ago

When I took the compiler course at university, the professor would have a new coursework theme every year, and the year I took the course, the coursework compiler was exception-oriented. So exceptions were the only control flow mechanism besides function calls. If/else, while, return were all variations of throw.

To me this proved that there's nothing inherently wrong about exceptions.

It's how you structure your code and the implied assumptions you share with your colleagues.

Some people are way too optimistic about their program will actually do.

Happy path programming.

BoiledCabbage a day ago | parent [-]

Sounds interesting - any link to the control flow implementation online?

Or how does one optionally throw and exception without an "if" statement? What's the "base" exception call?

Ie if "if" is implemented via exceptions, how do exceptions get triggered?

And is "while" done via an "if exception" and recursion? Or another way?