3 ms·
Oh no. I'm not saying it would be easier without exceptions. I'm just saying that the current status of our programming tools makes writing safe code very hard,
by reginaldo 14y ago
Oh no. I'm not saying it would be easier without exceptions. I'm just saying that the current status of our programming tools makes writing safe code very hard, and exceptions are one more thing you have to think about. I use them a lot...
The authors of the paper propose their "worlds" API as a way to make writing safe code easier. They're still using exceptions, but they would require no cleanup...
The code becomes:
try {
in thisWorld.sprout() {
for (var idx = 0; idx < xs.length; idx++)
xs[idx].update();
thisWorld.commit();
}
} catch (e) {
// no clean-up required!
}
So it's commit for data structures for data structures. If an exception is thrown and the commit line is not executed, no changes will be visible.