Hacker News new | ask | show | jobs
by davidp 3044 days ago
This light bulb is exactly why many people prefer statically-typed programming languages, especially above a certain codebase size/complexity and team size.

Make my tools do the grunt-work for me, thanks, so I can focus on the actual problem domain.

2 comments

> This light bulb is exactly why many people prefer statically-typed programming languages, especially above a certain codebase size/complexity and team size.

I agree, with the caveat that sometimes you need an escape valve.

Basically I want static typing 99% of the time and I don't want guff from the compiler (or fanboys) in that 1%.

C# and Typescript are great at this, and a great combo together.
That’s what (unchecked) exceptions are for.

They’re supported by all general purpose programming languages because we — as developers — are smarter than the compiler.

1. GP is talking about type safety in general, not just exceptions.

2. Not “all general purpose programming languages” support exceptions. To name a few that don’t: C, Rust, Go.

Go has the empty interface, if you really need it.
The empty interface is not an unchecked exception, but panic() is. https://golang.org/pkg/builtin/#panic
I don’t actually know Go, but can panic() be caught? If not, it’s not an exception.
But this is about application or user specific config.

In my experience, those tend to be either json, yml or plain terminal args regardless of the fact that the language is typed or not.

Am I missing something?