On Mon, 02.12.13 19:25, Zbigniew Jędrzejewski-Szmek (zbys...@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
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to