Hacker News new | past | comments | ask | show | jobs | submit login

Personally, I think checked exceptions are sometimes a headache in Java and I've worked in places where the default when encountering a checked exception was to catch and throw RuntimeException with a helpful error, which is pretty similar to Go's error/panic model.



Checked vs unchecked exceptions is kind of a separate thing from exceptions vs no exceptions. There are plenty of modern languages without checked exceptions but few with no exceptions period.


Go has exceptions in the form of panics, they are discouraged and less sophisticated than other language exceptions but they certainly exist.


There is a valid argument about whether exceptions are the best way to signal errors or not. But most modern alternatives are some form of capturing errors directly in the type system, so that return types can carry error information (option or error types etc), and so that callers are forced to check for errors.


Oh I'm firmly in the monadic error return camp. Its just a misnomer that go doesn't have exceptions. It has both exceptions and by convention error returns. Its sort of the worst case scenario.

I will say that there is some good post compiler tooling around making sure that error handling isn't skipped but its definitely a weakness of the language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: