I'm more with the crowd that says you should keep the declaration as
close as possible to the first use.
On Sun, Nov 11, 2018 at 4:44 PM Leif Hedstrom <zw...@apache.org> wrote:
>
> This might sound petty, but I really much prefer that we consistently put 
> empty lines after local variable declarations. We do so much of the time, but 
> definitely not consistently. Besides looking cleaner, doing this consistently 
> really helps making clang-format not indent code stupidly.
>
> For example, without the empty line we get
>
>   if (auto it = g_records_ht.find(name); it != g_records_ht.end()) {
>     RecRecord *r = it->second;
>     *buf         = (char *)ats_malloc(sizeof(char) * 1024);
>
>
>
> Note how clang-format will align the =’s, even though they really aren’t 
> related.  Whereas with the empty line, it looks a lot nicer as
>
>   if (auto it = g_records_ht.find(name); it != g_records_ht.end()) {
>     RecRecord *r = it->second;
>
>     *buf = (char *)ats_malloc(sizeof(char) * 1024);
>
>
>
> My $0.01 of the day.
>
> — Leif
>

Reply via email to