3 ms·
More evidence IMO that when people think they need template metaprogramming, what they probably really need is basic collections primitives. Go is a good examp
by ninkendo 9y ago
More evidence IMO that when people think they need template metaprogramming, what they probably really need is basic collections primitives. Go is a good example of this. (Strings, maps, lists, slices are just done once by the language, you don't get to write your own implementation because there's no generics, but in practice nobody cares.)
- wrinkl3 9y ago> but in practice nobody cares I haven't worked with Go personally, but "no generics" is probably the most commonly vocal complaint I hear about it, so clearly some people do care.
- rrcaptain 9y agoIt's kind of a meme at this point though. Shitting on other people's favorite language is a well honored SWE tradition.
- littlestymaar 9y ago“lol no generics” is the meme. But the lack of generics is a real problem that bothers a lot of people (and several already developed their own solution to work around this problem)
- Touche 9y ago> but in practice nobody cares. Not my observation at all.
- mickronome 9y agoPeople actually do care a lot about the fact that you can't have type safe and thread safe code, or abstractions without tons of synchronization code repeated ad nauseum throughout the code. Multiply that by 10 if you have several junior team members who have been told, and read, that concurrency and parallelism is easy in go.
- temac 9y ago"nobody" is a little strong. Advanced users might want to use advanced data structures that are not built-in in the langage, and templates can be convenient to do that.
- pcwalton 9y agoHave you ever wanted to call .map() on an array? Or sort with a custom comparison function?
- SamReidHughes 9y agoSorting you can do -- the function takes indices. And no, I've never wanted to call .map() -- I love writing for loops over and over, it feels really productive.
- deleted 9y ago[deleted]