I'm less interested in generics in Go after reading this intro to Boost, the C++ template library. The resulting code is impenetrable to anyone but an expert. I don't think generalization is as important as computer scientists say it is. Approachability should be the biggest concern given that developing software is almost always a social problem, not a technical one.
Rob Pike's solution for generic programming in Go could be his proposal for the "generate" command in the Go toolchain. This addresses a whole range of requirements, including lexers, binary embedding, and protocol buffers. Templating for Go generics is just a natural consequence of the design. It'll be interesting to see if existing attempts at generics in Go move to use "generate" instead.
I'm Brett Slatkin and this is where I write about programming and related topics. You can contact me here or view my projects.
10 July 2014
About
I'm the author of the book
Effective Python. I'm a software engineer at Google (currently in the Office of the CTO) where I've worked for the past 19 years. Follow @haxor on Twitter
if you'd like to read posts from me in the future. You can also
email me here.
© 2009-2024 Brett Slatkin