3 ms·
Depends on the type system. I would say for Java / Python level static types they catch a small but significant fraction of bugs (10-20% according to the only o
by IshKebab 3y ago
Depends on the type system. I would say for Java / Python level static types they catch a small but significant fraction of bugs (10-20% according to the only objective measurement I've seen, which is easily worth it). However some languages like Rust, Haskell and OCaml let you express much more in the type system.
Subjectively it feels like that catches more like 30-60% of bugs.
So this thing is still useful but Berkes is right that you need it a lot less if you use better static types.
> which code paths are relevant for a given endpoint?
This is exactly the question that static types can answer... statically. You don't need a runtime log to find out.
You do need a runtime log to see the actual values though. So it's not like a debugger is completely useless in Rust. But I definitely reach for it much less than in other languages.
- theonething 3y ago> This is exactly the question that static types can answer... statically. You don't need a runtime log to find out. This tool seems to be able to display the relevant code paths. That sounds super convenient and useful. Do statically typed languages have tools to do similar?
- IshKebab 3y agoYeah "find all references" will show you everything that can call a particular function. As I said it won't give you the actual values so this still seems useful.
- kikimora 3y agoI don’t know if a similar tool exists but in principle Java and .NET has profiling APIs that let you look into method calls. They can be used as a basis for a similar tool.
- eddtries 3y agoI worked on a large financial transaction system for up to $7B per day in Haskell that used formal methods like Agda, TLA+, etc, with a lot of logic in the type level (i.e. Liquid Haskell), as a test engineer. The entire system was covered in property based tests, proofs, and then normal tests from unit -> system. We literally had two bugs categorised as P2/P1/P0 on release, both of which were design related, and both were fixed before users saw them. It was crazy effective (but took years).