HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jdmnd

no profile record

Submissions

[untitled]

1 points·by jdmnd·2 ปีที่แล้ว·0 comments

comments

jdmnd
·2 เดือนที่ผ่านมา·discuss
Great news! Related[0]. The presentation video in the linked article from 2002 is a gem.

0: https://news.ycombinator.com/item?id=46266875
jdmnd
·6 เดือนที่ผ่านมา·discuss
What you're suggesting seems like a spectacular leap. I do not think it is very likely that the unnamed employee at Cloudflare that was micro-optimising code in the DNS resolver is also the author of this RFC, Joe Abley (the current Director of Engineering at the company, and formerly Director of DNS Operations at ICANN).
jdmnd
·4 ปีที่แล้ว·discuss
This is interesting. It looks like there was even some discussion of making this behaviour part of the standard, since it's implemented by all of the major browsers.

https://github.com/whatwg/html/issues/2390
jdmnd
·4 ปีที่แล้ว·discuss
It works for any type that implements the `std::error::Error` trait; which is something you can easily implement for your own types. If you want your errors to be integers for some reason, you can wrap that type in a zero-sized "newtype" wrapper, and implement `Error` for that.

The Stack Overflow answer you linked seems to be claiming that it's simply easier to return strings, but I wouldn't say this is a restriction imposed by the language.