Date: Thu, 15 Jan 2026 12:07:20 +0000
On Thu, Jan 15, 2026 at 11:20 AM Filip wrote:
>
> I think that this is perfectly readable, however now I think that soft_assert would be a better name.
Filip, I don't know if you regularly program in other programming
languages, but when a C/C++ programmer sees the word 'assert', they
think:
"This has no effect on the runtime behaviour of the program"
This is why a C/C++ compiler will give a compiler warning if the
argument to 'assert' has any side effects (as it will be taken out in
Release Mode).
Furthermore, static_assert will just prevent compilation -- so it has
no effect on runtime behaviour either.
Using the name "soft_assert" here goes against what the word 'assert'
means to C++ programmers. Furthermore it suggests that there's another
kind of assert, perhaps a 'hard' assert, but I've never heard of such
a thing. If a normal 'assert' is a 'hard assert' then it's very
different to a 'soft_assert', as the former kills the program and the
latter just returns from a function.
> It would do the opposite comparison to false instead of true, but the logic could be the same:
> Return value of expression before it was cast to bool and compared to either true or false indicated by ‘!’.
The logic of my code was "If the return value is non-zero then return
the return value". I don't see why you've put an exclamation mark in
there as I don't see anything that should be inverted.
>
> I think that this is perfectly readable, however now I think that soft_assert would be a better name.
Filip, I don't know if you regularly program in other programming
languages, but when a C/C++ programmer sees the word 'assert', they
think:
"This has no effect on the runtime behaviour of the program"
This is why a C/C++ compiler will give a compiler warning if the
argument to 'assert' has any side effects (as it will be taken out in
Release Mode).
Furthermore, static_assert will just prevent compilation -- so it has
no effect on runtime behaviour either.
Using the name "soft_assert" here goes against what the word 'assert'
means to C++ programmers. Furthermore it suggests that there's another
kind of assert, perhaps a 'hard' assert, but I've never heard of such
a thing. If a normal 'assert' is a 'hard assert' then it's very
different to a 'soft_assert', as the former kills the program and the
latter just returns from a function.
> It would do the opposite comparison to false instead of true, but the logic could be the same:
> Return value of expression before it was cast to bool and compared to either true or false indicated by ‘!’.
The logic of my code was "If the return value is non-zero then return
the return value". I don't see why you've put an exclamation mark in
there as I don't see anything that should be inverted.
Received on 2026-01-15 12:07:35
