by TheDong · 8y ago · 0 comments
https://github.com/MagicalTux/goro/blob/3cb3dfe0eef910c03e41...
More php interpreters is of course nice.
For example, in rust you could use:
let res1 = w.Write(...)?;
let res2 = w.Write(res1)?;
In haskell, you can use do notation or monad binding to do a similar thing.Of course C doesn't have a good type system that allows this sort of thing; it was created before such type systems were well known.
I would expect any modern language to at least recognize that there are good ways to sequence and compose types.
if err != nil {}
You get used to that pretty quickly in Go, but it still looks messy to a lot of people.
But alas, those are the choices that the Go language made.
Exceptions are one reason other languages don't need this "if err throw err" code, without making a comment on if either is superior.