Live data from Hacker News

Cold Showers

github.com

71–80 of 363 posts

Re: Cold Showers

#71

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

Until the types don't match the execution model... see: python type hints

That isn’t static typing

That’s a dynamic typed language with comments

Re: Cold Showers

#72
post #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.

Not necessarily. This increased ease of understanding could also simply result in faster development speed - so same number of bugs, but more features in less time.

Not sure though.

Re: Cold Showers

#73

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.

Something else I find rather likely is that different people are working most effectively with different methodologies (a believe that is grounded in the repeated experience of being shocked at how other people program and still be effective). So it is entirely plausible there is a self-selection bias that people that work best with strong types don't work on projects with weak types and vice verse. I guess its really hard to control for that effect when you want to look at big projects, since people need to be willing to work on that for a long time.

Re: Cold Showers

#74

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

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…

> I am curious for why people say this

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.

Re: Cold Showers

#75

> Benchmarking cutting-edge graph-processing algorithms running on 128-core clusters against a single-threaded 2014 Macbook Pro. The laptop consistently wins, sometimes by an order of magnitude. LOL, this hits close to home. My company had a modeling specific VM set up to run our predictive modeling pipelines. Typical pipeline is about 50,000 to 5 million rows of training data. At best, using an expensive VM, we mana…

There appear to be slightly weird commercial reasons behind this, because gaming GPUs have great CUDA performance but NVIDIA won’t let you put them in a datacentre. So buying your data scientists gaming laptops (RGB and all) generally works out faster for any reasonable price point. That said, a dedicated server with a decent Xeon and MKL set up correctly generally outperforms CPU-bound stuff.

Re: Cold Showers

#76
post #6

> Hype: "We need big data systems to handle big data." I do not get this one. It's incorrect by definition: "Big data refers to data sets that are too large or complex to be dealt with by traditional data-processing application software. " If you do not need a big data system, then it's not big data.

That definition assumes the code is reasonably performant or that they didn’t just begin on the cloud for whatever (often not well thought out) reason.

Re: Cold Showers

#77
post #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.

One could argue that dynamically typed code is often shorter, and therefore both easier to reason about, and possessed of fewer bugs on a bugs-per-line basis. Not really keen to push that line of reasoning myself, just helping picture one possible argument.

Re: Cold Showers

#78
> Hype: "Static Typing reduces bugs."

It’s only hype because it’s imprecisely stated. Static type systems make entire classes of bugs impossible at runtime. The stronger (read less permissive) the type system, the more classes of bugs cannot occur.

Re: Cold Showers

#79

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

Allegedly? Have you ever written code in a dynamically typed language? I'm forever fixing TypeErrors and AttributeErrors and the like.

I suppose it's not even necessary to argue about experience fixing them or not, just the fact that those are runtime errors rather than compile-time (and so we presume not shipped) shows it reduces bugs doesn't it?

Re: Cold Showers

#80

Earlier 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

this is why I love spec (though I am starting to explore replacing it with malli)
Post reply on HN