Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

meanwhile exceptions just sob in a corner, forgotten.

the main benefit is actually sane exceptions. unicode is nice and all (i'm a native speaker of a non-english language) but it's a storm in a teacup IME.



sort by: page size:

Language support for exceptions are the better way.

Exceptions aren't typed though so you either have to decode it in some way or treat every exception the same.

Sure but only in langs wich require exception handling! Otherwise it's just hidden behaviour and explicit optional returns are better imo

It's easier to use exceptions and not care about the origin of an error when the details are irrelevant.

Exactly my point. In my experience, exceptions have helped me significantly reduce my code, increase readability and quicken bug tracking.

Isn't that what exceptions are used for in any language?

Exceptions are a bad idea. Even in the more saner languages such as python, they tend to obfuscate needlessly.

Consider using a language that has exceptions instead of 1980's error codes

The thing is that exception is as close as we get to pattern matching in many languages. When a language has even the most basic Either/Maybe/Option, you start to see fewer exceptions being thrown around.

I see your point and I will consider it. Thanks for the discussion.

What's a language that does exceptions just right for you?


Huh - now I can see why exceptions are looked at somewhat askance in low level coding circles.

GOTO: Agreed, it can be a very effective way of error handling in exception free languages.

That's the whole point--to force you to actually handle errors properly. You could say the same thing about any language with exceptions that you don't catch.

The latter is a much stronger argument than the former (no idea why people get so worked up about character counts), but even then, "shit" is really strong considering how often one experiences exception traces when using an application written in Python or Java or some other exception-based language. Point being, we should probably evaluate error handling schemes based on results rather than ideology (even though I tend to agree with some of that ideology).

Or exceptions in many languages for error conditions that you don't want to accidentally ignore.

Interesting. So I wonder if exceptions are the programming language analogue of swearing?

It's easier to use exceptions and pretend nothing ever goes wrong.

> Nope. Exceptions aren't capable enough

They've been perfectly fine for the majority of popular languages and are a vast improvement over manually mimicking them the way most people do with Go.


I don't see the difference. Exceptions are error handling and with this change the language will be better equipped to handle them.
next

Legal | privacy