|
|
|
|
|
by phyzome
319 days ago
|
|
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. |
|
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.