Of course, if that code had been written in Rust, the compiler would have caught the bug... no tests necessary, and no need to stick to clever coding patterns and write your own wrappers.
I know she likes her C, but I wonder if she'll eventually come around, drawn by the better reliability.
This isn't C. At least denigrate the correct language.
The problem here is a flawed object design that requires external knowledge of when methods can be called. The fix is to detect invalid calls to value(), log/print to stderr, and call abort(). With a suitable test suite these logic errors will reveal themselves before a release build.
phyzome|7 months ago
I know she likes her C, but I wonder if she'll eventually come around, drawn by the better reliability.
kevin_thibedeau|6 months ago
The problem here is a flawed object design that requires external knowledge of when methods can be called. The fix is to detect invalid calls to value(), log/print to stderr, and call abort(). With a suitable test suite these logic errors will reveal themselves before a release build.
valicord|6 months ago