[systemd-devel] [systemd-commits] 4 commits - catalog/systemd-fr.catalog catalog/systemd-ru.catalog configure.ac Makefile.am po/.gitignore po/LINGUAS po/ru.po

Lennart Poettering lennart at poettering.net
Mon Dec 2 11:25:22 PST 2013


On Mon, 02.12.13 19:25, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> > I must say I really dislike mixing declarations and code. And I also
> > know that by accident I did this in many cases myself and was thankful
> > for the compiler to tell me about this.
>
> I never understood this. There are many situations where initializing
> variables right when they are declared leads to more readable code.
> And if everything has to be declared at the top, this often isn't
> possible. Especially with long functions which have many logically
> separate segments this leads to an unreadable lump of declarations at
> the top. We already declare variables at the start of internal scopes,
> and declaring them in the middle of code is just another small step.

I figure this means that your function is probably too large and you
should actually just split it up into many ... That's almost definitely
the best option usually...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list