GoogleCloudPlatform / samples-style-guide

Guidelines on writing effective Google Cloud samples.
https://googlecloudplatform.github.io/samples-style-guide/
Apache License 2.0
11 stars 19 forks source link

Proposal: Clarify Process the Result "no return type" #169

Open grayside opened 4 weeks ago

grayside commented 4 weeks ago

Description

In Process the Result, we specify "Methods should avoid a return type whenever possible."

This is not sufficiently clear.

Samples should not return values as part of presenting how to work with the API response. Instead, they should output meaningful properties from the response object to teach developers how to work with the response, and confirm for folks running the code that it works as expected.

A PR to address better code examples has been opened, which addresses #135, #136, #137, but not the main guideline text.

Impact

This is clarifying a generally understood sample guideline amongst existing sample contributors, and help clarify the expectation for folks onboarding to samples.

Challenge

This is a clarification of the existing guideline.