3 ms·
I don't think error handling is a solved problem in language design
- deleted 2y ago[deleted]
- Someone 2y ago> For example, over time we've wound up agreeing on various common control structures like for and while loops, if statements, and multi-option switch/case/etc statements. The syntax may vary (sometimes very much, as for example in Lisp), but the approach is more or less the same because we've come up with good approaches. I am not sure about that. As an example, look at for loops. Swift dropped C-style for loops only 10 years ago (10 years isn’t long in language design time) (https://github.com/swiftlang/swift-evolution/blob/main/proposals/0007-remove-c-style-for-loops.md https://github.com/swiftlang/swift-evolution/blob/main/propo...), and there still is the difference between pascal for loops, where the number of iterations can be computed when the loop is first entered and the more flexible C-style ones that are while loops in disguise. As a fourth option, there are the functional ones that replace for i in items… by items.foreach… (I do not think that falls under “The syntax may vary”)
- hudon 2y agoHere’s some food for thought from Anders Hejlsberg https://www.artima.com/articles/the-trouble-with-checked-exceptions https://www.artima.com/articles/the-trouble-with-checked-exc... Error results and checked exceptions are more similar than either is to unchecked exceptions.