On Sun, Jan 4, 2009 at 11:45 AM, Bob goolsby <bob.gool...@gmail.com> wrote:
> Not 'wrong headed', just a compiler compiler optimization.  By putting
> the declarations before the usage, you reduced the number of complete
> passes through the source by one and made the parsing code easier.
> This is an artifact from the time when Machine-Time was expensive and
> Programmer-Time was (relatively) cheap.
>

It's a human optimization, too. When the programmer is responsible for
allocating and deallocating memory, it makes sense to group
declarations together, so the programmer can quickly tell what's out
there, and check to make sure everything is correctly initialized and
destroyed so the program doesn't leak.

In a language like Perl, which automates garbage collection, the most
effective way to keep track of memory and prevent leaks is usually to
properly scope variables.

Best,

-- j
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to