Re:Generics enabled by default in Go tip
by bogota on Saturday August 21, 2021 @12:57AM
(#28254334)
If i wanted or needed generics i would use another language. I have been able to write great code without them for 5 years now though. But now i get to defend my codebases from the unneeded introduction of them from largely developers who think they are too smart.
[ Parent
| on HN ]
You can totally do fine without generics depending what you do. It mostly affects code that supposed to be reusable, especially libraries.
Re:Generics enabled by default in Go tip
by lamontcg on Saturday August 21, 2021 @02:22AM
(#28254714)
you sound like you're too smart for generics.
No I’m likely too dumb for them but my code base is clean and easy to onboard people to. I take great pride in new hires telling me something is easy to do after only working in it a week
And like i said generics have a place its just a way smaller place than many people think
Re:Generics enabled by default in Go tip
by silisili on Saturday August 21, 2021 @01:09AM
(#28254384)
Same here. But I think it's more laziness than 'too smart.'
I like to liken it to house construction. Imagine if a number of people demanded that natural gas and water be combined. Why do I have to make two separate pipes? They even look the same!
There are just things you can’t do without having generics in your language. User-defined collections, for one. Statically typed higher order functions, for another. To paraphrase (I believe) Bob Harper, you either have a statically typed language with generics, or you have a dynamically typed language. That’s the result of not having generics. Code that needs them becomes more dangerous and error-prone.