[v4,06/12] Rephrase section on short functions for readability

Submitted by Christophe de Dinechin on Feb. 15, 2018, 4:06 p.m.

Details

Message ID 20180215160625.75406-7-christophe@dinechin.org
State New
Headers show
Series "Updates to the style guide" ( rev: 3 ) in Spice

Not browsing as part of any series.

Commit Message

Christophe de Dinechin Feb. 15, 2018, 4:06 p.m.
From: Christophe de Dinechin <dinechin@redhat.com>

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
---
 docs/spice_style.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 996c5cd9..9e6536e4 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -178,7 +178,7 @@  If multiple related constants are to be defined, consider the use of enumeration
 Short functions
 ---------------
 
-Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with inline short functions or functions that were splitted for readability reason.
+Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with `inline` functions that were splitted for readability reason or that are very short.
 
 Return on if
 ------------

Comments

On Thu, Feb 15, 2018 at 05:06:19PM +0100, Christophe de Dinechin wrote:
> From: Christophe de Dinechin <dinechin@redhat.com>
> 
> Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
> ---
>  docs/spice_style.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> index 996c5cd9..9e6536e4 100644
> --- a/docs/spice_style.txt
> +++ b/docs/spice_style.txt
> @@ -178,7 +178,7 @@ If multiple related constants are to be defined, consider the use of enumeration
>  Short functions
>  ---------------
>  
> -Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with inline short functions or functions that were splitted for readability reason.
> +Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with `inline` functions that were splitted for readability reason or that are very short.

I'd just drop the second sentence. The compiler usually knows better.

Christophe
> On 16 Feb 2018, at 10:05, Christophe Fergeau <cfergeau@redhat.com> wrote:
> 
> On Thu, Feb 15, 2018 at 05:06:19PM +0100, Christophe de Dinechin wrote:
>> From: Christophe de Dinechin <dinechin@redhat.com>
>> 
>> Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
>> ---
>> docs/spice_style.txt | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/docs/spice_style.txt b/docs/spice_style.txt
>> index 996c5cd9..9e6536e4 100644
>> --- a/docs/spice_style.txt
>> +++ b/docs/spice_style.txt
>> @@ -178,7 +178,7 @@ If multiple related constants are to be defined, consider the use of enumeration
>> Short functions
>> ---------------
>> 
>> -Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with inline short functions or functions that were splitted for readability reason.
>> +Try to split code to short functions, each having simple functionality, in order to improve code readability and re-usability. Prefix with `inline` functions that were splitted for readability reason or that are very short.
> 
> I'd just drop the second sentence. The compiler usually knows better.

Agreed, done.

> 
> Christophe