Re:Const all the things?
by brandmeyer on Monday January 24, 2022 @11:35AM
(#30059957)
In the presence of types which are truthy (ie, contextually convertible to bool), its too easy to accidentally swap the unpacking:
[ Parent
| on HN ]
Re:Const all the things?
by BoorishBears on Monday January 24, 2022 @01:00PM
(#30061317)
To me that's not easy...
It's a very well established pattern to have (error, result) I'd immediately see something off with (result, error)
And clang-tidy can catch this: https://clang.llvm.org/extra/clang-tidy/checks/readability-i...
Fair enough, in my codebase we always order data in terms of dependencies so that independent data comes before dependent data. In this case the result depends on the error_code, and the error_code is independent, so the error_code must be listed first.