As the article says, this does not appear to be actually true when you go and check.
As the article says, this does not appear to be actually true when you go and check.
Either that means it's hard to measure, or it means the effect is not actually there.
Either way, this means that we cannot say that static typing reduces bugs.
> all massively complex systems that I personally have worked with that run for decades transacting billions$ etc without flaws are all statically typed
Did you try building the same systems without static typing as well and see what the difference was?
Or are you just saying that you built systems with static typing and they were successful? That tells you nothing about static typing except that it doesn't prevent successful programs, which is a very weak thing to be able to claim!
Lots of people, like you, think static typing is very important for developing software, but when someone challenges this and says 'can you actually show that?' they have never been able to. At some point you need to reconsider if it's actually the case.
I lean more to dependently typed languages than dynamic as I simply saw only misery, but, again, this is not saying anything, it is just my experience. I am a bit afraid though, because there is no clear measurement, it is just anyone’s experience.
Edit; which actually would be fine; if it works for you and your team, company and business goals…
If you think you really can see evidence for it then I'd encourage you to write up a paper and submit it for peer review. I guess when you sat down to write it you'd suddenly realise that you don't actually have any hard evidence.
> cannot really imagine writing large systems in not statically typed systems
Ok but lack of imagination is not science. Some people cannot imagine a spherical Earth, but that doesn't make it untrue.
For example I work on a system in a dynamically typed language (Ruby) that successfully handles tens of billions a year, so we know that it is possible. (We are adding optional static typing to it, but it was written without it.)
Sure, but that’s what I said in the first place. It all seems there is no evidence, not even empirical for either way. I was looking for any, if there was. MS or whatnot must have something no?
I would say in summary that no, we don't have any evidence. Evidence that people have tried to present has been found to be flawed in peer review.
Why, if not for reducing bugs?
Maintainability, tooling, and some people would argue for reducing bugs - but I'd challenge them in the same way I challenge you - can they prove it? And I would guess that they cannot.
If the person I was replying to was saying that they could not imagine a large system without types, and well they don't have to since I gave them a real example.
Of course not, to do that you’d need a way to detect all bugs in a program.
If we had an effective way to that, we’d be using to remove all of the bugs from our programs instead of looking for ways to avoid bugs.
(only slightly joking)
Many older statically typed languages (Java/C/etc.) don’t enforce null safety. Tony Hoare called it his ‘billion dollar mistake’.
https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retra...
Thankfully more modern type systems (Swift/Kotlin/F#/Rust/TypeScript/etc.) now do, hugely reducing the likelihood of runtime errors.
As a mostly dynamic language developer I never saw the benefit of Java-like static typing but more modern type systems seem much more useful.
You say this like it's a fact... but again nobody has been able to show this in a proper scientific study.
Write up your experience with null safety as a paper and submit it, because this would be a world-first if you can demonstrate it.
We do have proofs that certain classes of bugs are impossible given a certain type system.
I'm with GP, I'd really like evidence of this before people continue shouting things which aren't proven.
So if I do need a null value, I can make the field optional and the type checker will help me figure it all out.
The only way in which strong static and dynamic typing could produce the same number of bugs would be if strong static typing resulted in introducing other bugs, ones which wouldn't be introduced in a dynamically typed language. Proving that would probably require a scientific study ;)
Does planning a project mean faster delivery?
Does thinking about architecture up front reduce refactors and technical debt.
Does estimating lead to faster software development?
There is a lot we have to decide without evidence in how we develop software.
Maybe we just pick the things that feel right and make us happy.
Does that plan include the client changing their mind 10 times before delivering? Or finding out that some approach doesn't work and that pivoting is needed halfway through?
Likely depends on how smart the planning is.
> Does estimating lead to faster software development?
Unlikely, because engineers are then busy ass-pulling useless time figures over and over instead of actually working on the project.
All of these points have high random factors attached to them regardless, so you'd need a pretty big sample to say what generally works best.
We have to carry on regardless and make decisions.
The nuance is what you do, why you do it and is there cultism or cargo cultism to the decisions.
The function will generally only work on a subset of types for given variable.
If I don't check the type of the variable in the function, the function will not behave as you might expect, e.g. silently fail or crash.
If I do check for every possible type for a given variable:
I may not have a good way of handling certain types being passed in, I may be forced to either log something out, create a run time crash or even have the function silently fail. All 3 are bad run time behaviours.
If I am checking for every type in the functions, then using static typing would cause the failure at compile time so the bugs could never exist, but also being significantly less verbose than the dynamic language equivalent.
I'm saying it because it's a fact. I'm not giving you an opinion - it's a falsifiable fact that you can verify for yourself - we have as an industry not been able to give any good evidence for static typing reducing bugs that has stood up to peer review.
You're presenting arguments for why you think there should be evidence... but when people look there isn't actually any evidence. Maybe your arguments are not sound for some reason that we don't understand, or maybe we are unable to measure the effect.
https://www.microsoft.com/en-us/research/wp-content/uploads/...
I'm not sure what evidence your fact is based on, feel free to present some evidence for it.
The linked meta-study in the article we're commenting on.
https://danluu.com/empirical-pl/
"under the specific set of circumstances described in the studies, any effect, if it exists at all, is small"
And this question has generated the most rebuttals and retractions I've ever seen for flawed studies in computer science - it's notorious.
Remember this?
https://dl.acm.org/doi/10.1145/3340571
> Well, this paper found that a conservative underestimate of 15% of bugs would be saved through static typing
Yeah does look that one shows a larger effect and has not been rebutted or retracted. One positive measurement against many negative measurements.
We haven't measured an effect but that doesn't mean that we can't reason about this in other ways. The lived experience of people that do this thing for a living can be an important resource. You could argue that we are getting in to soft social science here, but is there value in what the collective of trades people think about their tools?
We didn't know the science behind steal for a long time, but we still figured out how to make it and that it holds an edge really well.
Empirical measurement is not the only way to discover value.
Lived experience works to some extent, eliminating failures and making progress, like with your steal example, but that doesn’t mean it can pick optimal options from a list of options that all work to some reasonable extent; aka dynamic typing does also build software.
This is true for many functions defined in statically typed languages too. Just because your function says it works with an integer, doesn't mean it's necessarily going to work with _any_ integer (think `1/n`). Very often the type used isn't narrow enough.
Modern dynamic languages understand this, see for example Clojure's spec[1].