Live data from Hacker News

Cold Showers

github.com

61–70 of 363 posts

Re: Cold Showers

#61

> 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.

Static typing has an undisputed benefit, performance. If i need to add dynamic thing a and thing b, I’ll always have the overhead of figuring out what add means first in this context, an overhead i dont have when asked to add some ints.

All the other claims from readability to understandability to refactoring to less bugs, all come with an “it depends” caveat. Sometimes the claims are true, sometimes they’re not. It’s also not possible to say “but in most cases claim X holds”.

The thing I’ve never understood yet in this debate is in my experience, the people who have argued about correctness have universally been below par at getting to the bottom of requirements. Which leads to “great, you correctly built the wrong thing. And you took forever to do it.” Which isn’t doing our profession any good in the eyes of other professions who depend on us.

Re: Cold Showers

#62

> 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.

It’s basically self-evident that static analysis reduces bugs. It’s trivial to construct an example of where type information would catch a bug. Unless there is some reason that including type information increases bugs, the existence of a single example where type information catches a bug would prove that overall type information reduces total bug count.

Re: Cold Showers

#64
post #25

Earlier quoted context omitted.

Curious what the setup of VPS' was and why you would expect better than real hardware, video transcoding is quite a beast from what I remember and I just can't imagine there's a VPS solution that expects to keep up

The Intel Xeon processors that cloud providers typically use don't have the Intel Quick Sync core that provides hardware A/V encoding/decoding on typical desktop/laptop CPU SKUs. So the software has to fall back to CPU-based codecs, which are much slower. AWS EC2 has a VT1 instance family that enables high-speed A/V encoding via a Xilinx media accelerator card.

IIRC Quick Sync encoded with poorer quality than software; is that not still the case?

Re: Cold Showers

#65

Earlier quoted context omitted.

> We are adding optional static typing to it, Why, if not for reducing bugs?

> 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.

I agree it seems hard to prove; disappointed not more tried. Especially large companies that have skin in the game (MS with ts and c#/f#, Google with go and dart, oracle with Java, Mozilla with rust). Guess it’ll be a religious argument for some time to come and I will steer clear.

Re: Cold Showers

#67

>Hype: "Static Typing reduces bugs." Oof, that one is a huge can of worms.

You can pry typescript from my cold dead hands. All these “inconclusive” studies but has anyone ever tried a trial where 20 nearly identical teams tried implementing the same spec using a typed or untyped language? It’s inconclusive because a post hoc review of projects is going to be spurious at best.

Re: Cold Showers

#68

> 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.

Refactoring with confidence that you didn’t forget somewhere.

Re: Cold Showers

#69

Earlier 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.

I am curious for why people say this as in my experience when writing a function in a dynamic language that takes a variable as a parameter:

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.

Re: Cold Showers

#70

> 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.

that it aids my understanding and helps in navigating the program

Static typing reduces bugs because it aids your understanding.

Post reply on HN