Hacker News new | ask | show | jobs
by the_gastropod 899 days ago
I think the important question is: at what cost? E.g., if it takes me 4x more time to write statically-typed code, and it saves me 10% fewer bugs (completely made up numbers here), is that worthwhile? Maybe, if I'm programming self-driving cars or autopilot software for aircraft. Probably not if I'm programming a web calendar for dog sitters.
3 comments

If you work with other people or will ever onboard someone to the project (including your future self) static types save time. Lots of it.
I don't consider it an added cost, you're just moving the cost upfront to reduce long-term pain.

Ruby apps are easy to build, but are difficult to maintain.

Rust apps take a bit more effort to build, but are easier to maintain.

But this is where the studies come in. Lots of people think this is true. And it seems perfectly reasonable. But there's really no research to back this up.
Can this be confirmed or refuted?

There is so much variation confounding any study, in tasks, specifications, programmer inclination.

I use both staticly typed (rust) and dynamically typed (perl) a lot. I like rust for the big projects and perl to hold everything together-job control

That is my inclination, not a fact.

I have used many languages over the years. Static/dynamic typing is just one dimension, and not necessarily related to quality

And with most of the type-related stuff it's slightly worse than "no research to back this up". There is research, and it doesn't back this up.

Except for the documentation effect. For that there is apparently solid research.

It's even worse than that. If it saves me 10% bugs per unit of code, but I have to write 20% more code, am I actually even ahead in the bugs department?