News for hackers. Stuff that matters.
Re:From Rust to TypeScript by flowerlad on Saturday September 12, 2020 @01:52PM (#24454139)
Sorry that doesn't make any sense to me. If a method can't or shouldn't hand a condition it then it needs to declare itself as throwing that exception (or a wrapper around it).
Re:From Rust to TypeScript by withinboredom on Saturday September 12, 2020 @02:45PM (#24454477)
They said transitive. To me, they meant if you have 3 layers of deps, A -> B -> C and C now throws something, B doesn’t catch it or mark as throws. So now you have a failure. Obvs, you’d fix this immediately, but it’s still work that you have to do when you could have been doing something productive.
Re:From Rust to TypeScript by ddek on Saturday September 12, 2020 @05:34PM (#24455980)
Here's Hejlsberg on why C# doesn't have checked exceptions: https://www.artima.com/intv/handcuffs.html.
Re:From Rust to TypeScript by flowerlad on Saturday September 12, 2020 @06:16PM (#24456348)
Hejlsberg is an awesome compiler maker. His Turbo Pascal compiler was incredible -- in approx 30KB he wrote a compiler, full screen editor and library. He's not that good as a language designer. C# is basically a clone of Java with broken exception handling.

Here's the problem with C# exceptions: https://web.archive.org/web/20041201011903/http://www.geocit...