News for hackers. Stuff that matters.
Re:Modern C++ Won't Save Us by adrianN on Tuesday April 23, 2019 @03:44AM (#19726406)
Together with a test-suite that covers the exponential number of paths through your code...
Re:Modern C++ Won't Save Us by gmueckl on Tuesday April 23, 2019 @05:12AM (#19726767)
Changing programming language neither reduces the need for test coverage nor does it magically increase coverage.
Re:Modern C++ Won't Save Us by adrianN on Tuesday April 23, 2019 @05:16AM (#19726783)
A type system changes the need for test coverage because it eliminates whole classes of bugs statically that would need an infinite amount of tests to eliminate dynamically.
Re:Modern C++ Won't Save Us by gmueckl on Tuesday April 23, 2019 @05:19AM (#19726802)
That leaves an infinite amount logic bugs to be tested for. Types cannot fix interface misuse at integration and system level. So no, this does not reduce the need for testing.
Re:Modern C++ Won't Save Us by comex on Tuesday April 23, 2019 @05:33AM (#19726864)
Whether they reduce the need for testing overall is arguable. But what matters in this discussion is that types can guarantee memory safety, meaning that the cases that you forgot to test – and there will always be such cases, no matter how careful you are (just look at SQLite) – are less likely to be exploitable.
Re:Modern C++ Won't Save Us by gmueckl on Tuesday April 23, 2019 @05:52AM (#19726972)
Types can only provide limited memory safety. There is a real need to deal with data structures that are so dynamic as to be essentially untyped. Granted, this usually happens in driver code for particularly interesting hardware, but it happens. Also, I have not yet seen a type system that is both memory safe and does not prohibit certain optimizations.