Mike Hearn [ARCHIVE] on Nostr: 📅 Original date posted:2014-06-04 📝 Original message:> > As a matter of ...
📅 Original date posted:2014-06-04
📝 Original message:>
> As a matter of procedure we do not use assertions with side effects— the
> codebase did at one point, but have cleaned them up. In an abundance of
> caution we also made it refuse to compile without assertions enabled: A
> decision who's wisdom was clearly demonstrated when not long after, some
> additional side-effect having assert was contributed. In the real world
> errors happen here and there, and making robust software involves defense
> in depth.
>
I think this class of errors could be removed entirely by just saying it's
OK for assertions to have side effects and requiring them to be enabled, as
is currently done.
The glog library:
http://google-glog.googlecode.com/svn/trunk/doc/glog.htmlprovides CHECK macros that print stack traces when they fail. Using them
would also be good.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140604/e90f6937/attachment.html>
Published at
2023-06-07 15:22:17Event JSON
{
"id": "e27ec283df094f831faf99bbb522843477d04c1f5942529e7ed109d0eb496d4b",
"pubkey": "f2c95df3766562e3b96b79a0254881c59e8639f23987846961cf55412a77f6f2",
"created_at": 1686151337,
"kind": 1,
"tags": [
[
"e",
"e8b77add504144678225b9ea55ec19a8c038095fd045917174210773a0ed69db",
"",
"root"
],
[
"e",
"484944cf62c1f255a0683c12ce87e8ba086f657793924001651e86e31ee26d5e",
"",
"reply"
],
[
"p",
"4aa6cf9aa5c8e98f401dac603c6a10207509b6a07317676e9d6615f3d7103d73"
]
],
"content": "📅 Original date posted:2014-06-04\n📝 Original message:\u003e\n\u003e As a matter of procedure we do not use assertions with side effects— the\n\u003e codebase did at one point, but have cleaned them up. In an abundance of\n\u003e caution we also made it refuse to compile without assertions enabled: A\n\u003e decision who's wisdom was clearly demonstrated when not long after, some\n\u003e additional side-effect having assert was contributed. In the real world\n\u003e errors happen here and there, and making robust software involves defense\n\u003e in depth.\n\u003e\n\nI think this class of errors could be removed entirely by just saying it's\nOK for assertions to have side effects and requiring them to be enabled, as\nis currently done.\n\nThe glog library:\n\nhttp://google-glog.googlecode.com/svn/trunk/doc/glog.html\n\nprovides CHECK macros that print stack traces when they fail. Using them\nwould also be good.\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140604/e90f6937/attachment.html\u003e",
"sig": "a0b8c66bcc48ebaba80d09b34839944a5579b1e2370e8235464cb0539364657510264a85b77d8bdd9c0720a9d590968f92d7fa850fd28ee163e022243c78e438"
}