Re:From Node.js to Go
by liotier on Friday January 30, 2015 @10:35AM
(#8972484)
Uh ? Even for a library you certainly can make decisions about types, document them and enforce them. Who wants to accept unspecified data types ?
[ Parent
| on HN ]
Literally everyone who's ever written a container.
Re:From Node.js to Go
by omega_rythm on Monday February 02, 2015 @02:44PM
(#8986394)
That doesn't mean no decision has been made: in a typed language with subtyping, this amounts to choose the "top" type of the type hierarchy, and without subtyping, you're choosing not to enforce structural constraints. In untyped languages with structured values (like any usable language), you make those decisions in the way your code checks for this or that value attribute or runtime structure. I guess unspecified and specified as "any" is often the same, but for me the former is a design mistake.