I don't miss Javas generics so much for the ability to create generic
libraries but for using them.

Things like map, group, filtering etc is so much simpler to write (maybe
not always read).
And it is fine to loop explicitly by hand coding but with grouping and
perhaps several levels of filtering and mapping it gets messy.

I find that it is actually the "functional" bits I miss most rather than
the basic generic types.

mån 31 juli 2017 kl 09:31 skrev Olivier El Mekki <oliv...@el-mekki.com>:

> I can relate to Shawn's experience, here. I wrote a few programs in C, but
> mostly used interpreted and untyped languages professionally, before Go.
> When I started using Go, I fought for a while with the type system, just
> for the time to get used to it in general in daily usage. Once it was done,
> I never felt the need for generics, and was surprised to discover it was
> considered a problem.
>
> Maybe there's an other reason it doesn't get in the way, though. My first
> year with Go, I used custom types a lot, with embedded types and
> interfaces. Then I realized I was just trying to do OOP all over again, and
> was hurt by the same problems (mainly, not knowing at a glance where
> methods come from and what set of methods are available in a given scope).
> Nowadays, I mainly do FP style architecture (not trying to enforce any
> "function purity" like in FP, but mostly writing small packages with a
> bunch of methods that take simple types as arguments) and usually have a
> couple types at most (usually, configuration types set at initialization).
>
> Could generics need be a sign that we may try to force OOP on Go, putting
> types in a central place?
>
>
> On Friday, July 28, 2017 at 3:09:38 PM UTC+2, Shawn Milochik wrote:
>>
>> I programmed in about a dozen different languages before Go. None of them
>> had generics. I use Go, love it, and never noticed anything missing when I
>> write everything from command-line tools to complex servers. I've always
>> been puzzled when people represented the lack of generics to be a flaw in
>> Go, sometimes to the point that they claimed the language to be unusable. I
>> personally hope that simplicity continues to rule the governing body of Go
>> and we never get a feature that gives Go more than one obvious way to do
>> things. This would violate the "Lego" policy of the Go group, which is to
>> give us everything we need to build everything we want -- not everything we
>> want.
>>
>> Go rules!
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to