News for hackers. Stuff that matters.
Re:What is Hindley-Milner and why is it cool? (2008) by guelo on Monday August 21, 2017 @01:51PM (#15066248)
I don't really like where type inference is settling out. Maybe it does come from programmers becoming used to dynamic languages but it doesn't mean it's better.

I find

  val x = fn()
to be almost maliciously hiding the type when

  int x = fn()
is just as simple and gives you much more information, especially when reading code outside an IDE such as on github. val/let/def and the like are just low information cruft.

A lot of times I'll find myself creating an extra local variable just to have the type info in the variable name since otherwise it's invisible from just reading the code. Essentially adding an extra unchecked type system layer I have to manually maintain:

  val listOfThings = functionThatHopefullyReturnsThings()

There are no comments on this comment yet.