Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

rust just got 4x more productive [shill thread]

Name: Anonymous 2016-12-16 15:09

Rust designers developed an idiom for concisely propagating errors outwards with a macro called try!:
let file = try!(File::open("file.txt"));
More recently, Rust shipped an even more concise notation for error propagation, the postfix ? operator:
let file = File::open("file.txt")?;

Name: Anonymous 2017-01-01 20:21

>>30
you have to pattern match the Some/None on Option(Item)
A C compiler could also produce errors/deny compilation for missing NULL-checks after function entry for every incoming pointer argument.

It's far from impossible in practice.
Again, ``good'' testing prevents this. If someone doesn't test their code it's not the lang's fault.
And since Rust code requires ``good'' testing, too, not much is gained. At least not in this case.

argue they [NULL pointers] have benefits
I'm not arguing they have benefits compared to things like Option. I'm arguing they are mostly the same. And when a lang compares similarly to the one it wants to replace, it should be disregarded.

the creator of Java admitted them as a billion-dollar mistake
That was Hoare, not Gosling.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List