Gabriel Sechan wrote:
> It is?  I've never heard that.  In fact, I frequently hear (and agree with) 
> the exact opposite-  put every declaration at the top so that you can easily 
> find the declarations of all variables.
You are working with a different definition of "modern languages". That
is thinking is still very strong in the C community, although even they
stopped forcing that thinking with the advent of C99. The modern
thinking is that you should declare a variable around when it is first
used, so that the declaration is right by the code that actually uses it.
>   As a bonus, you can read the variables used and their types at the begining.
...and as an extra bonus, you have almost no context for understanding
each of their roles until you start reading. This means you have to
remember what all the variables are and/or constantly refer back to them
while reading the code, even if some of them may not yet be relevant.

Of course, if you are at the point that this matters much one way or
another, there is a distinct chance that you are doing something wrong.
> This is honestly the first time I've *ever* heard of it being considered bad 
> style.
>   
Java, C++, C#, most scripting languages, etc....

--Chris

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to