4 ms·
You're arguing that it's good to (intentionally) break with common code idioms for certain classes of libraries?? Also, have you actually seen the auto-generat
by akavlie 10y ago
You're arguing that it's good to (intentionally) break with common code idioms for certain classes of libraries??
Also, have you actually seen the auto-generated APIs he's referring to?
Here are the Godocs for the BigQuery API: https://godoc.org/google.golang.org/api/bigquery/v2 https://godoc.org/google.golang.org/api/bigquery/v2
Here's some example code demonstrating the API's bad habits -- such as deeply nested struct pointers, and Do() methods everywhere:
https://github.com/google/google-api-go-client/blob/master/examples/bigquery.go#L205 https://github.com/google/google-api-go-client/blob/master/e...
- chrisbroadfoot 10y agoHere's the idiomatic library for bigquery: https://godoc.org/google.golang.org/cloud/bigquery https://godoc.org/google.golang.org/cloud/bigquery
- akavlie 10y agoThanks for that link, looks like that API was created after I started the project using BigQuery. It's still labeled "experimental" though, which makes me a bit wary to use it just yet.
- chrisbroadfoot 10y agoThat's right. It's production-quality, but the API surface might change. If you're OK with changing your code sometime in the future, then I'd recommend giving it a try for this or your next project. Changes will likely be minimal.
- voltagex_ 10y agoFor a production app, wouldn't you "pin" your dependency to a particular version? I know I wouldn't be allowed to track master in my workplace.
- chrisbroadfoot 10y agoYes! Please do that. Use something like git-vendor: https://github.com/brettlangdon/git-vendor https://github.com/brettlangdon/git-vendor