Hacker News new | ask | show | jobs
by wolfadex 2013 days ago
In my 10 years of paid development, Elm. Because it's the only language of the 13+ I've used in production code where the compiler actually helps you.

I've written C, C++, C#, Java, JS ES5+, ActionScript, HTML5 and CSS since IE6, many various compile-toJS languages, many different frameworks and more. Elm is the only language where I can jump into a foreign code base or my own months later and feel confident that I can change something, push to production, and not break things.

edit: I've also written Perl and Ruby in production too.

edit2: How does it help? When you make a change that isn't valid, like adding a new argument to a function, the compiler can tell you everywhere you need to make a fix and sometimes even suggest how to fix things. Add on top of that the editor tooling in Intellij or with the elm-langauge-server in VSCode and other editors and it's just super smooth. Build times are also crazy fast. There's no waiting for the compiler. The whole notion of "If it compiles, it works" I find to be true 99% of the time.

1 comments

Any statically typed language allows for a compiler to detect breaking changes like you describe. That’s the point!
In practice that's very not true. Plenty of room for undefined behavior in statically typed languages like Java, C# etc.
Of course there is. That's not my point.
???

You literally posted that using a statically typed language prevented breaking changes?

Did I literally post that? You might want to reread my comment.

I can say from experience for every language above, save C++ (with which I have never worked), that they will fail to compile if you change a function signature in a backwards-incompatible way and fail to update all call sites.

The purpose of static typing as a method of program verification is to enforce type constraints at compile-time for all possible executions of that program. A function signature is, you guessed it, a type constraint.