Uh oh!
There was an error while loading. Please reload this page.
bigquery: remove references to Guava from snippets. - #1410
Conversation
garrettjonesgoogle
commented
Nov 17, 2016
So I understand the argument that people may not be familiar with Guava, but in cases like this, it is obvious what the Guava code is doing, whereas the |
lesv
commented
Nov 17, 2016
Guava is something developers should hear about. We might include a link Guava |
tswast
commented
Nov 18, 2016
If we don't want to include Guava in these snippets (the imports aren't visible in the included javadocs), I could make a parallel sample in java-docs-samples so we can show the imports in the cloud docs. |
lesv
commented
Nov 18, 2016
@jgeewax@anthmgoogle JJ / Anthony - do you have an opinion? As I mentioned earlier, I think it's ok to use guava in samples for the obvious stuff. |
anthmgoogle
commented
Nov 18, 2016
My weak opinion is that allowing guava seems OK. My reasoning would be that it is highly regarded and if you need the utility in the sample, it will avoid either polluting the sample with more code in a different problem domain, or using an even more obscure library (much like @garrettjonesgoogle's case above). However, I'm concerned that @mziccard recommended against it and I be interested understanding more about the risks. However he is no longer employed by the project and may not weigh in. I would defer to @jgeewax on this issue. |
garrettjonesgoogle
commented
Nov 18, 2016
I think @aozarov might provide some useful input here - could you weigh in? |
daf2b59 to
e3a6da2CompareI know that Guava makes snippets look smaller and possibly nicer but users do not necessarily know how to use it. Purpose of snippets is to show how our code works in the most general environment possible. Users might be more familiar with other libraries such as apache-commons (or they might be using google-cloud from java8) and I believe we should not teach the guava-dependent way of using our library. In particular, I am against using |
aozarov
commented
Nov 18, 2016
I am also in the opinion that we should not use third-party libraries in the API layer and avoid them in samples. I would definitely prefer using I can see how In most cases I think we can achieve good enough result even without using thirdparty libraries. Even in this case, we can use |
| * .setFormatOptions(FormatOptions.csv()) | ||
| * .build(); | ||
| * TableDataWriteChannel writer = bigquery.writer(writeChannelConfiguration); | ||
| * ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024); // 16 KB buffer |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lesv
commented
Nov 18, 2016
Sigh - "Cg0NDg0=" is a lot less likely to be understood. |
Then add a comment saying that this a base64 encoded string. Also, FYI Java 8 added an API call for it. |
anthmgoogle
commented
Nov 18, 2016
I find these arguments convincing, so I'll change my preference to avoid Guava here. |
e3a6da2 to
862a69aCompareWe should avoid references to third-party libraries in snippets.
862a69a to
ad29f3eComparetswast
commented
Nov 22, 2016
PTAL. I've incorporated your comments, which makes the sample much simpler without Guava. |
aozarov
commented
Nov 22, 2016
LGTM |
coveralls
commented
Nov 22, 2016
Changes Unknown when pulling ad29f3e on tswast:bigquery-snippets into ** on GoogleCloudPlatform:master**. |
…onfig to v1.5.1 (#1410) * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
…en-plugin to v1.7.0 (#1410)
…en-plugin to v1.7.0 (#1410)
…o v1-rev20240524-2.0.0 (#1410)
The Guava classes may not be as familiar to people.
Re: #1407 (comment)
@mziccard FYI
@garrettjonesgoogle@lesv PTAL