Anyone able to give me a simple example demonstrating why Go needs this?
Anyone able to give me a simple example demonstrating why Go needs this?
Yesterday I was in a pairing interview where I debugged and sped up some code. All-in-all I wound up with about 200 lines or so of Golang, including a lot of "yes, another loop" code. All I was doing, really, was mapping, forking and joining.
Meanwhile in Java, I could have gotten most of this in about 20 lines withJava 8 Streams and .parallel(). Generics make that tractable.
I guess writing a numeric library, like Python's NumPy, is a lot more convenient using generics. But I've never tried...
Most places where the empty's interface is used now could benefit from it. Eg. the json package could state it always uses float64 for numbers (except when you tell it to use Number).