westonpace commented on a change in pull request #12661:
URL: https://github.com/apache/arrow/pull/12661#discussion_r829841013



##########
File path: docs/source/developers/cpp/development.rst
##########
@@ -85,6 +85,8 @@ This project follows `Google's C++ Style Guide
   conveniences.  For private headers the rules are relaxed further and structs
   can be used where convenient for types that do not need access control even
   though they may not be simple data containers.
+* We prefer pointers for non-optional output and input/output parameters (the
+  style guide recommends mutable references).

Review comment:
       I was specifically parroting the sentence in the style guide we are 
overriding (emphasis mine):
   
   > Parameters are either inputs to the function, outputs from the function, 
or both. Non-optional input parameters should usually be values or const 
references, **while non-optional output and input/output parameters should 
usually be references (which cannot be null)**. Generally, use std::optional to 
represent optional by-value inputs, and use a const pointer when the 
non-optional form would have used a reference. Use non-const pointers to 
represent optional outputs and optional input/output parameters.
   
   Without the greater context I agree that we are missing the sentence:
   
   > Use non-const pointers to represent optional outputs and optional 
input/output parameters.
   
   Would it be clearer if we were to say:
   
   ```
   We prefer pointers for output and input/output parameters (the
     style guide recommends mutable references in some cases)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to