Comment

Comment by oblique63

> [static typing] feels like it's in the way between components and results in some boilerplate, verbosity, and overly tight coupling

Just curious, is this with regards to Elm / ML-style static typing specifically, or were you talking about it in combination with languages like C#/Java/etc?

I'm an elm noob, but I've been using F# for a good while, and its ML style of static typing is almost like the exact opposite experience of working with things like Java. Significantly less code, less boilerplate, and more expressive[0][1]. For example, one of the coolest features of F# that really showcase this, are type providers:

https://channel9.msdn.com/Blogs/Seth-Juarez/Type-Providers-i...

With them, you can leverage F#'s type system to automatically infer the structure and type of any external data source. Which means practically zero boilerplate or "ORMs" needed for things like reading-from/writing-to databases, making web api calls, parsing json/xml, or even interfacing with packages from entirely different languages like R [2].

So static typing can definitely have a lot of cool/practical benefits besides just catching bugs that make life easier, while still maintaining the flexible/lightweight feel of languages like python. However languages like C++ and Java have definitely seemed to have given it a bad name for a while, and haskell's whole tie-in with abstract math hasn't historically made it very accessible for us average programmers to notice all the tricks it has up its sleeve.

Elm is still young and I'm a total novice to it, but after working in F#, I'm definitely sold on it and like where it's going.

[0] https://fsharpforfunandprofit.com/series/why-use-fsharp.html

[1] https://skillsmatter.com/skillscasts/4971-domain-driven-desi...

[2] https://www.youtube.com/watch?v=_BOST3W88-Y

parent oblique63 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton