Re:An intro to Zig's integer casting for C programmers
by dnautics on Tuesday May 11, 2021 @01:06PM
(#27120569)
Putting valgrind into the stdlib is really clever, and also, I like memory safety being the carrot to get you to write tests. I worry having a 'safe' system like rust sometimes causes very smart (TM) developers, especially less experienced ones, to be complacent and write less tests.
[ Parent
| on HN ]
Re:An intro to Zig's integer casting for C programmers
by nicoburns on Tuesday May 11, 2021 @06:25PM
(#27124371)
Writing fewer tests is somewhat justified when you can encode invariants in the type system. It depends on the level of reliability you require of course. But my Rust code without tests has been comparably reliable to my code in other lanaguages eith tests.
Re:An intro to Zig's integer casting for C programmers
by dnautics on Tuesday May 11, 2021 @07:50PM
(#27125051)
No tests? How do you refactor while ensuring your business logic invariants?
Re:An intro to Zig's integer casting for C programmers
by pjmlp on Wednesday May 12, 2021 @09:40AM
(#27130192)
Except I can already do that in C++.
https://devblogs.microsoft.com/cppblog/new-static-analysis-r...
https://devblogs.microsoft.com/cppblog/finding-bugs-with-add...
https://docs.microsoft.com/en-us/cpp/code-quality/using-sal-...
https://docs.microsoft.com/en-us/visualstudio/debugger/how-t...
No need to switch languages with a lesser eco-system, just learning to turn on the compiler switches that are already there.