Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I rarely find myself frustrated with the lack of generics in Go and am so glad to never deal with the kind of over-engineered generic madness that is so common in Java, except...

When dealing with collections. It's maddening to have to keep duplicating basic functions like getting the keys from a map, or checking if a slice contains a given item.



I don't think I've ever seen generics be the cause of over-engineered complexity in Java.

It's pretty much always giant, complex class hierarchies or a bunch of reflection (or both).


Aren't collections 30% - 40% of code? (We seldom deal with just one thing.)

That's why I feel generics are so important.

You can build complicated messes with any programming paradigm. It's a matter of discipline to use the tool correctly. Don't hate on generics, but rather the unskilled use of them (which I frankly see far less than abuse of other patterns/paradigms/language features).

The biggest negative with generics is compile time, but the clarity and conciseness of generics is worth it for me.


> and am so glad to never deal with the kind of over-engineered generic madness that is so common in Java

Over engineered how?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: