Live data from Hacker News

Cold Showers

github.com

91–100 of 363 posts

Re: Cold Showers

#91
post #88
post #77

Earlier quoted context omitted.

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.

This is true in a local context, but entirely breaks down when a codebase becomes larger than a single person can fit into their brain-RAM. Not arguing or saying you're wrong - just presenting the very quickly reached boundary where the argument breaks down.

It's not just local context. Reading a dense book is still more difficult than reading a less dense book, given a fairly similar amount of information and style in conveying that information. Larger codebases suffer the same problem you mention in a different way, and cargocults in most static languages tend to advocate very verbose writing styles.

Where this falls apart, the more verbose writing style hasn't been proven to convey more information or in a better way. That's an assumption still tossed around.

Re: Cold Showers

#92

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.

Interesting. I wonder what about software development that we do that you can prove scientifically then.

Does planning a project mean faster delivery?

Does thinking about architecture up front reduce refactors and technical debt.

Does estimating lead to faster software development?

There is a lot we have to decide without evidence in how we develop software.

Maybe we just pick the things that feel right and make us happy.

Re: Cold Showers

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

Well, it also fails to compile. Which to me is better than blowing up at runtime, or worse, not blowing up but giving weird results.

Re: Cold Showers

#94
post #75

Earlier quoted context omitted.

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.

I think it really depends on your data size. All the benchmarks I can find are on massive datasets, with tens of millions of rows or thousands of columns. I’m sure there are significant performance gains in these situations. Our data just wasn’t big enough.

With larger data it really depends on the algorithm. If you must iterate over more than a few GB at a time, GPU memory capacity and bus speeds become prohibitive, while a dead-simple implementation on a single CPU with 100+ cores and TBs of RAM goes brrr.

Re: Cold Showers

#95

Earlier quoted context omitted.

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?

AFAIK that should still be the case.

Re: Cold Showers

#96

Earlier quoted context omitted.

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…

> hugely reducing the likelihood of runtime errors You say this like it's a fact... but again nobody has been able to show this in a proper scientific study.

I don't think a scientific study is needed. There exist different classes of bugs. The stronger static typing, the more classes of bugs become impossible to make. You will not see a NullPointerException in Haskell.

The only way in which strong static and dynamic typing could produce the same number of bugs would be if strong static typing resulted in introducing other bugs, ones which wouldn't be introduced in a dynamically typed language. Proving that would probably require a scientific study ;)

Re: Cold Showers

#98
post #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?

I'd say it reduces bugs... in size, making them harder to find.

Re: Cold Showers

#99
post #88

Earlier quoted context omitted.

This is true in a local context, but entirely breaks down when a codebase becomes larger than a single person can fit into their brain-RAM. Not arguing or saying you're wrong - just presenting the very quickly reached boundary where the argument breaks down.

It's not just local context. Reading a dense book is still more difficult than reading a less dense book, given a fairly similar amount of information and style in conveying that information. Larger codebases suffer the same problem you mention in a different way, and cargocults in most static languages tend to advocate very verbose writing styles. Where this falls apart, the more verbose writing style hasn't been pr…

It is just a fair bit harder to figure out the types as program grows.

Re: Cold Showers

#100
post #96

Earlier quoted context omitted.

> hugely reducing the likelihood of runtime errors You say this like it's a fact... but again nobody has been able to show this in a proper scientific study.

I don't think a scientific study is needed. There exist different classes of bugs. The stronger static typing, the more classes of bugs become impossible to make . You will not see a NullPointerException in Haskell. The only way in which strong static and dynamic typing could produce the same number of bugs would be if strong static typing resulted in introducing other bugs, ones which wouldn't be introduced in a dyn…

[deleted]
Post reply on HN