News for hackers. Stuff that matters.
Re:Writing secure Go code by Arainach on Monday November 04, 2024 @03:28PM (#42045696)
I'm curious about your objection to the proposal. Sure, generics mean that libraries need a bit more syntax - that's true in all languages - but the actual consumption of the AssociationList type here is clean and readable.

Most types don't need to be generics. Containers do, and I prefer a bit of generics syntax to copy/pasting the container ten times for ten types.

Re:Writing secure Go code by JyB on Tuesday November 05, 2024 @04:58AM (#42050155)
You spend more time reading code that writing it. Optimising for the later is a mistake. I guess the noticeable pushback against including generics was not unwarranted, people are just now starting to see the ripple effects we were warned about.
Re:Writing secure Go code by consteval on Tuesday November 05, 2024 @09:20AM (#42051642)
Generics are, IMO, necessary for even a semi-modern language. Okay, you don't need a turing complete templating sublanguage like C++, but you do need at least a way to take generic functions and create generic containers.

In application code you will almost never write generics. To me, it's always been a non-issue.

Re:Writing secure Go code by Arainach on Tuesday November 05, 2024 @12:02PM (#42053260)
It's optimized so that it's easy to read the code that you read all the time: code iterating through the containers.

It is dramatically less common to read through the implementation of containers.