javacodegeeks.com

Golang - Optional Arguments for APIs

I was recently directed towards Dave Cheney’s article Functional options for friendly APIs where he shares his thoughts on designs for optional parameters in APIs. Dave ends with a proposal for functional arguments that are optionally passed to a type constructor. There is no question this design is superior to having a single constructor with lots of arguments.However:Dave’s design is...

javacodegeeks.com

Golang – The database/sql package

This post is part of a series where I do my best to organize my thoughts around Go: its paradigms and usability as a programming language. I write this as a Java programmer that respects the principles of Elegant Objects.I am studying the Go Code Review mantra Accept Interfaces, Return Structs and was inspired to write this post after coming across Eli Bendersky’s post Design patterns in Go’s...

javacodegeeks.com

Golang – Smarter containers

This post is part of a series where I do my best to organize my thoughts around Go: its paradigms and usability as a programming language. I write this as a Java programmer that respects the principles of Elegant Objects.I wish to make a correction in this post. I want to focus on this statement:Products is not a “smart” container – see point #3 in the Java proposal. You would have to...