Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
I'm sure that works great with the GO error handling model... hope they're not forgetting to check every close() for an error status.
Quotes of the week
Posted Jul 3, 2012 22:31 UTC (Tue) by twm (guest, #67436)
Posted Jul 4, 2012 0:27 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
That's even worse, exceptions are at least visible.
Posted Jul 4, 2012 4:11 UTC (Wed) by twm (guest, #67436)
Posted Jul 4, 2012 6:02 UTC (Wed) by raven667 (subscriber, #5198)
Posted Jul 4, 2012 9:28 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)
You DON'T need try..except blocks in correctly designed code. Well, you need them, but mostly on the upper level. The main reason for their use it to free acquired resources in case of exceptional conditions and that can be done well by "with(res):" statements (try-with-resources in Java).
C++ has an even better mechanism - destructors. It has a tremendous advantage over other error handling mechanisms because it unites error handling paths and normal exit paths.
Posted Jul 4, 2012 13:09 UTC (Wed) by man_ls (subscriber, #15091)
In the Google Play App Store (or however it is called this week) they have taken this idea to the next level: when the user clicks on "inform the developer" Google aggregates the information and shows the traces to the developer. Try doing that with ignored error values...
Posted Jul 6, 2012 4:15 UTC (Fri) by twm (guest, #67436)
Posted Jul 6, 2012 8:05 UTC (Fri) by man_ls (subscriber, #15091)
Posted Jul 11, 2012 6:51 UTC (Wed) by jamesh (guest, #1159)
Wouldn't an exception + stack trace be easier to debug?
Posted Jul 4, 2012 20:14 UTC (Wed) by robert_s (subscriber, #42402)
So don't not-handle exceptions. Or use an execution environment that can easily recover from such problems. You wrote buggy code that doesn't handle exceptions. Or would you prefer the inner exception-raising function just failed silently? Or segfault?
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds