Rene Kita wrote:

> To be clear: I don't want to start a discussion/war about coding style
> here! I'm just curios.
> 
> In vim's source code, why is the line with the return type and modifiers
> of a function indented? Is there a rational? Historical reason? Or is it
> just that Bram likes it this way?
> 
> Example:
>     int
> vim_main2(void)
> {
> 
> I know for reasons to put the int on its own line, just wondering about
> the indent.

This makes it easier to spot the function name.  The type can be long,
and then there's usually a comment above it, the "indent gap" makes the
name stand out.

I have been thinking of aligning the return type with the paren before
the first argument:

           int
 vim_main2(void)
 {

But I don't think it is an improvement.


-- 
How To Keep A Healthy Level Of Insanity:
6. In the memo field of all your checks, write "for sexual favors".

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202012251641.0BPGft4o3582231%40masaka.moolenaar.net.

Raspunde prin e-mail lui