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

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Allow declaration after statement and reformat code to use it
Дата
Msg-id
1760990.1629390445@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Allow declaration after statement and reformat code to use it Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: Allow declaration after statement and reformat code to use it Ranier Vilela <ranier.vf@gmail.com>
Re: Allow declaration after statement and reformat code to use it Tom Lane <tgl@sss.pgh.pa.us>
Re: Allow declaration after statement and reformat code to use it Michael Paquier <michael@paquier.xyz>
Re: Allow declaration after statement and reformat code to use it Chapman Flack <chap@anastigmatix.net>
Re: Allow declaration after statement and reformat code to use it Tom Lane <tgl@sss.pgh.pa.us>
Re: Allow declaration after statement and reformat code to use it Bruce Momjian <bruce@momjian.us>
Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it Jelte Fennema <Jelte.Fennema@microsoft.com>
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 Andrew Dunstan <andrew@dunslane.net>
Re: [EXTERNAL] Re: Allow declaration after statement and reformat code to use it Ranier Vilela <ranier.vf@gmail.com>
Chapman Flack  writes:
> I'm in sympathy with all of those points. I've never believed that the
> arbitrary separation of declaration from use that was forced by C < 99
> made anything more readable. If the project were started now from scratch,
> I would be all in favor of declaring at first use.

Yeah, if we were starting today, I'm sure we'd use C99 or C++ as our
baseline and not arbitrarily exclude some language features.  But ...
we're not.  The rule against declaration-after-statement was kept
after significant discussion, which you can find in the archives if you
look.  We're not going to drop it just because one person shows up with
a patch to do so.

>>> It uses a Perl regex to search and replace! (obligatory jokes at the
>>> bottom of the email)

> However, even if such an idea were to get the green light, I think I would
> take the obligatory regex jokes seriously, and instead use something like
> srcML [0] and do the analysis and modification on proper parse trees.

Agreed.  I think the odds of introducing bugs are near 100% if it's done
without using a tool that actually understands the code semantics.

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Fujii Masao
Дата:
От: Alvaro Herrera
Дата:
FAQ