Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it
Дата
Msg-id 88e6a2fb-0fc7-3513-ad36-0cc2fd496a9b@dunslane.net
обсуждение исходный текст
Ответ на Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
On 8/20/21 12:30 PM, Ranier Vilela wrote:
>
>
> There is a reason why GMs Brian Kernighan and Dennis Ritchie made the
> C89, less buggy.
> IMHO C99 makes it easy to make more mistakes.
> One more step and we won't even need to declare a variable.
>
>

I've used both styles in different languages over the years. I don't
know that one is a clearly better way, notwithstanding what various
theorists might say.

Note that in C89 it's fantastically easy to put the declaration as close
as you like to the first use of a variable. All it takes is a pair of
braces enclosing the variable scope.

Even if we were to relax our rules on this, making wholesale changes
along these lines and even more backpatching them seem out of the question.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it