logoalt Hacker News

andaiyesterday at 12:26 PM0 repliesview on HN

You mentioned there are reasons not to type check your program. I would very much like to hear what they are!

Also, I have to point out that of course Ruby has types. And it does type checking. It just does it when the line of code actually runs. (i.e. runtime type errors).

So the discussion here isn't should we check types or not. It's a question of when to do it.

Do you want to know you've made a mistake when you actually make it? Or do you want to find out an unknown amount of time later (e.g. in unfortunate cases, several months later, debugging an issue in prod. Not that I would know anything about that ;)

---

My own thinking on the subject is that it should be configurable.

Rust's level of correctness, for example is probably overkill for a game jam. (As is, arguably, using a low level language in the first place.)

But my thinking here is that correctness should be opt out rather than opt-in. If you have a good reason to make your program wrong by default, then you should be allowed to do that. But it should be a conscious choice! And every source file, at the top of the file, should remind you that you are making that choice: #JAMMODE

And if you intend to actually ship the thing, and charge money for it, in Serious Release Mode the compiler should refuse to build anything that's still in jam mode.

My point here is that some languages make jam mode the only option you have.