> Static Typing reduces bugs. At least to me, the big advantage of static typing is not that it (allegedly) reduces bugs, but that it aids my understanding and helps in navigating the program. It's a tool for thinking and communicating.
Cold Showers
31–40 of 363 posts
Re: Cold Showers
#32Re: Cold Showers
#33Earlier quoted context omitted.
This one definitely hits close to home. By empirical measure, static typing reduces bugs, but maybe it's just me. I definitely like the comfort of trusting my types. My only experience with dynamic typing is really node, which improves a bit with typescript. But I'm still extremely wary of it because it doesn't give you runtime guarantees. It irks me a lot that you can just do JSON.parse, declare any type on it and c…
> By empirical measure, static typing reduces bugs As the article says, this does not appear to be actually true when you go and check.
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.
Re: Cold Showers
#34Earlier quoted context omitted.
> By empirical measure, static typing reduces bugs As the article says, this does not appear to be actually true when you go and check.
Well, how is this measured? My experience working over 3 decades with large teams also says this is so (static typing does prevent bugs) but that is not science. How do they measure this 'when you go and check'? I am really curious as I don't even understand how people make large systems without static typing and all massively complex systems that I personally have worked with that run for decades transacting billion…
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.
Re: Cold Showers
#35> "Static Typing reduces bugs." I would argue that static typing reduces bug complexity/creep. Mainly from working in environments without proper testing during the js days, TS was rough at first, but did help.
I don’t know about static types reducing complexity. I’d argue the opposite. Static types allow you to do things that you wouldn’t want to attempt with dynamic types due to the difficulty of reasoning. At least for me, I try to keep my dynamic systems simple because I don’t have a compiler watching my back.
Interesting though, I would say that dynamic typing allows you to shoot yourself in the foot a bit more, especially over teams who might need to interact with source later. I agree with you to keep the dynamic ones (that are inevitable) simple though.
Re: Cold Showers
#36Earlier quoted context omitted.
I thought I wanted static typing until I started writing clojure.
Clojure is the only dynamic language I’ve ever loved. It is in its own ballpark, really, though maybe Erlang or Elixir would win me over if I spent enough time with them.
But clojure’s REPL, babashka, and clojure.spec are sorely missed.
Re: Cold Showers
#37Earlier quoted context omitted.
> By empirical measure, static typing reduces bugs As the article says, this does not appear to be actually true when you go and check.
The article mentions the literature review is from 2014. 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 develop…
You say this like it's a fact... but again nobody has been able to show this in a proper scientific study.
Re: Cold Showers
#38Earlier quoted context omitted.
I thought I wanted static typing until I started writing clojure.
I occasionally missed types even in Clojure. “What keys are supposed to be in this map again? Hmm, turns out some callers are providing foo and some are providing bar…” That said, I certainly agree it comes up less than it does in, say, JavaScript
Re: Cold Showers
#39Earlier quoted context omitted.
I used to debate this but after learning Rust it’s undeniable.
I thought I wanted static typing until I started writing clojure.
Re: Cold Showers
#40Hype: Cold showers are good for you (good stress) Shower: keybored, your shower is not cold enough to induce stress and you are too lazy to modify the showering experience in any way Caveats: Other people may be anti-lazy enough to modify the showering experience Notes: Check yourself
Most Times I can't bring myself to get into a cold shower. If I start warm I can cool down from there. Is there a way to start cold and go even colder?