News for hackers. Stuff that matters.
Re:The Next Step for Generics by apetrovic on Tuesday June 16, 2020 @05:59PM (#23544784)
To be fair, Swift have a bit strange generics implementation that forces programmer to jumps through hoops to achieve something quite common in similar programming languages. The whole standard library is peppered with AnyThis and AnyThat, the language doesn't have generators (yield) and I'm not sure they're possible with the current generics design and programmers needs to learn what is type erasure just because the core team decided that returning generic interface from a function is something nobody will want.

I like Swift a lot, for many reasons, but generics design isn't one of these reasons.

Re:The Next Step for Generics by ChrisMarshallNY on Tuesday June 16, 2020 @06:56PM (#23545337)
Fair 'nuff. I was always a fan of the way C++ did it, but it was a great deal more technical.

Swift is sort of "generics for the masses." C++ is a lot more powerful, but also a lot more "in your face." I really do like the way that Swift allows generics to have implicit types.

Re:The Next Step for Generics by icholy on Tuesday June 16, 2020 @08:52PM (#23546368)
Can't get enough of those template errors.