Hacker News new | ask | show | jobs
by javabean22 3216 days ago
Stopped reading right here:

> The second error, “Type mismatch”, appeared 1771 times in the logs. That’s good news. It means the type system is working well: it catches type errors pretty often. Cool! I can finally honestly claim that I use Scala for a good practical reason.

That’s good news? Why? How? "Pretty often"? Comparing to what? Maybe it is, maybe it isn't. I don't know. 1771. Ok then.

2 comments

> "Pretty often"?

20 times a day in my case and 45 in case of another guy. If we suppose you code actively 6 hours a day it's like being interrupted 7.5 times a hour. That's "often" when compared to other errors.

> "Comparing to what?"

To other kinds of compilation errors (I think this point was clear in the article)

> "That’s good news"

If the compiler doesn't catch errors, most of them will go in production (you're usually not unit-testing all the possible type errors). I'm appealing to common sense here - It would be interesting to see if data confirm this.

This is a blog post, not a scientific paper. This is far from complete - it's just meant to be a good starting point. Factchecking everything is stated here would require an entire research team.

Why not?

I think it's fair to assume that programmers starts the compilation either when they believe their code is correct or when they do want to get an "hint" from the compiler.

Either way, they get a valuable feedback from the compiler and that happens multiple times per day.

Static type systems sometimes refuse to compile otherwise valid code. Type error is compiler telling "I can't prove this code correct with regard to some class of problems I'm supposed to catch". It does not necessarily prove the code is incorrect and would fail at runtime.

Therefore a high number of type errors may also mean the type system is very strict and getting in the way very often.

BTW I prefer the type system to be a bit too strict rather than not catching obvious bugs and then having to struggle with a debugger.