News for hackers. Stuff that matters.
Re:Less is exponentially more by rogerbinns on Monday June 25, 2012 @11:04PM (#4160037)
I agree that exceptions done badly are poor. That is especially the case with C++ where they were introduced later, and they are one of the things some people omit when picking the subset of C++ they use. I also don't think exceptions should be done without GC. Java's checked exceptions are very annoying.

My experience in Python is the opposite than yours, but then I've only been using it for 12 years :-) Undocumented serious exceptions are no different than Go's panic - they will probably terminate the program. But the usual case is extremely useful and not littering intermediate functions with error handling is wonderful.

And sure they can be abused, but virtually any functionality gives you "power" and that power can be used wrong. That isn't a good reason to take something away from the developers who would use them right.

Re:Less is exponentially more by luriel on Tuesday June 26, 2012 @05:39AM (#4160955)
> Undocumented serious exceptions are no different than Go's panic

They are very different, in Go you only panic() for programmer errors: panic() is never part of any API, when you access any API you never have to worry about whatever it will panic() or not.

Meanwhile in Python any function or method might throw an exception for almost any reason imaginable, but of course most people pretend they don't, because exception handling code would swamp your code.

I have done plenty of Python programming, failure to properly handle exceptions is very common.

> And sure they can be abused, but virtually any functionality gives you "power" and that power can be used wrong.

Exceptions are particularly problematic because they are a hidden part of APIs, and you have to be aware of and deal with this hidden part libraries all the time, not just in code you write.