5 ms·
It should be fair obvious that when you use a very verbose very boiler plate heavy coding style like static typing that because the programmer is writing a lot
by ReflectedImage 3y ago
It should be fair obvious that when you use a very verbose very boiler plate heavy coding style like static typing that because the programmer is writing a lot more lines of code per software feature and because the programmers make errors on a per line written basis that the number of the bugs will drastically increase.
You can easily find information on duck typed programs being significantly shorter and that statically typed and ducked typed programs have the same bug count per line. You can also look at the language defective tables showing ducked type Clojure as having the least bugs in commerical software and statically typed C++ having the most bugs in commerical software.
Google is your friend here.
- dolni 3y agoI have written type-annotated Python for as long as type annotations have been a thing. "Number of bugs will drastically increase" is simply wrong. Type checking prevents bugs before they ship.
- ReflectedImage 3y agoThere are numerous academic studies that show that type checking does not reduce errors in shipped code by an statistically significant amount. Type checking mostly shows that code can be compiled successfully. The thing it was designed to do.
- _dain_ 3y ago> There are numerous academic studies that show that type checking does not reduce errors in shipped code by an statistically significant amount. i've read some of these studies, they don't prove much. it's typically languages with inexpressive type systems like java. >Type checking mostly shows that code can be compiled successfully. The thing it was designed to do. what languages are you thinking of when you say things like this? these debates are useless because one person is thinking of the type system of language X and the other person is thinking of language Y. a lot of heat but little light.
- ReflectedImage 3y agoOver the years, plenty of people have wanted to show that static typing gives code correctness benefits over dynamic typing. Everyone who tries just falls flat on their faces.
- _dain_ 3y agoagain, specifics please. which languages are you thinking of? I don't see how e.g. [1] or [2] are "falling flat on their faces". [1] https://fsharpforfunandprofit.com/posts/designing-with-types-making-illegal-states-unrepresentable/ https://fsharpforfunandprofit.com/posts/designing-with-types... [2] https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/ https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va... or even something as basic as non-nullable types, enforced at compile time. a clear, obvious win.
- ReflectedImage 3y agoThose are some nice blog articles but the general consensus is that on a per-line basis duck typed and statically typed code have the same amount of bugs. The duck typed code is also significantly shorter, less lines of code per software feature means less bugs per released software feature. It's very difficult to compete against just having less code. You only needed to write 1000 lines of code instead of 3000 lines of code? Then you just eliminated 66% of the bugs. Static typing on the other hand catches less than 1% of bugs. So you can go for the duck typing approach and remove 66% of the bugs in your code or the static typing approach and remove 1% of the bugs in your code. Which approach do you think works better?
- klardotsh 3y agoSo not only did you pull the original comment's assertions out of your _bag of holding_ but rather than citing sources when asked, you doubled down on "well if you know you know" and claim that the (often relatively small) increases to line lengths of type-annotated programs somehow magically increases the number of bugs, again with no evidence. If you're not going to bring bold numbers to support bold claims, why should any of us bother listening?
- ReflectedImage 3y agoThere is nothing bold about the claims, knowing the differences between the various typing systems and their advantages and disadvantages is standard stuff. I mean you could always try to find some sources to try and prove me wrong if you want?
- rdm_blackhole 3y agoI don't have a dog in your fight regarding the original point you made related to the number of bugs increasing but the logic in your comment is flawed though. "I mean you could always try to find some sources to try and prove me wrong if you want? " That's not really how it works though. If you make a claim, either you back-it up or it's irrelevant. Case and point: I believe that a flying tea pot created the universe. By your logic I am right and it should be up to you to prove me wrong. So to conclude this argument, if you are correct, you should prove it as the person who responded to you asked you to do. Failing that,your comment goes back to being nothing more than your opinion instead of a fact.
- ReflectedImage 3y agoWe assume in good faith that statements made in comments on social media are true. If this was an academic paper, then perhaps you would be correct. But on social meda, asking for sources for what is basically common programming knowledge is borderline trolling. If s/he thinks that what I'm saying is wrong so strongly then they can go back that up with something. They will obviously fail terribly because I'm correct but that is their choice.