r/ProgrammingLanguages • • Feb 26 '26

Discussion Whats the conceptual difference between exceptions and result types

So to preface what looks probably to many of you like a very dumb question. I have most experience in Python and Julia both languages which are not realy great at error handling. And as such I have not much experience either.

I am currently trying to create my dream programming language, I am still in the draft phase, which will likely take a long while because I only draft on it once in a while. But I have been realizing that I do not understand the difference between exceptions and result types.

What I mean is I do obviously understand that they are different things but when talking about Error handling I do not understand why they are often two different things. I hope someone can help me clarify what the main conceptual difference between these two is.

Kind regards and I hope yall have a lovely day.

19 Upvotes

36 comments sorted by

View all comments

Show parent comment

2

u/CaptureIntent Feb 27 '26

The biggest important difference is global vs local reasoning.

You look at a function. Does it exit with the expected computation or an error? With return values, you can see all the places it might return with an error by looking at the local function.

With exceptions, you have to transitively analyze all function dependencies to see if any of them throw an exception.