News for hackers. Stuff that matters.
Re:My Go Resolutions for 2017 by lmm on Thursday January 19, 2017 @09:46AM (#13436148)
> 1) Abstract data types encourages closed systems. You may view this as a positive: It enables exhaustiveness checks. But I view it as a way to make your program more fragile. Go's type asserts let you convert to interface types, so you can add new interface implementers later and not have to go fix-up old type-assertions.

Is the idea here that all types should be open? Should I be able to e.g. add 1.5 as a possible instance for the Int and String types?

Interfaces should be open, but one also needs the ability to represent closed datatypes.

There are no comments on this comment yet.