Re:Hard-won lessons: Five years with Node.js
by _pmf_ on Thursday April 20, 2017 @01:50PM
(#14159050)
> I think the best compromise is optional typing. The language should encourage it by default, but allow some variables to be declared as dynamic/untyped.
Like C#'s dynamic keyword (not to be confused with its var keyword, which just does type inference).
I think the best compromise is optional typing. The language should encourage it by default, but allow some variables to be declared as dynamic/untyped. This greatly simplifies things like parsing of JSON data, which should essentially all be considered a string until there's some reason to consider it something else, but enforces consistency and safety through most of the application. Haxe does a pretty OK job with that.