Re:Python exceptions considered an anti-pattern
by sobolevn on Monday February 11, 2019 @08:05AM
(#19134115)
Thanks, my idea was to state the problem and propose a solution. Hope, that you will find `returns` helpful.
[ Parent
| on HN ]
Re:Python exceptions considered an anti-pattern
by detaro on Monday February 11, 2019 @08:18AM
(#19134211)
One risk with the title is that it doesn't convey that it's actually proposing a solution instead of being one of many "$languagefeature is bad" articles. I personally also found the problem statement presentation not all that convincing and almost closed the tab before reaching the interesting section, which is why I made the comment above.
Re:Python exceptions considered an anti-pattern
by _ZeD_ on Tuesday February 12, 2019 @02:13PM
(#19146505)
I'm sorry, but from my perspective - a java developer that has moved to scala - this "let's drop checked exceptions for Either[Exception, T]" stuff... stinks.
And for one specific reasons: Exceptions are not important per se, but also for the stacktrace they take with them, and that is given to you when you need to handle it.
I lost too much time in this last month trying to decipher where the hell stuff happened looking at the stacktraces in the logs.
Coming back to the python approach: I like python :) and it's philosophy it's to have unchecked exception, with all what it concerns. The idea is that if you don't know an exception, you really don't know what to do. So let the code blows up - ideally in tests :) - and understand what realistically can happen and how to deal with it.
Re:Python exceptions considered an anti-pattern
by muggermuch on Tuesday February 12, 2019 @01:08PM
(#19145901)
Thanks for the solution! It's elegant and is a great fit for my current work which involves retrofitting my codebase with type annotations.