On 1-May-07, at 6:11 PM, Theodore H. Smith wrote:
>>> On 02/05/2007, at 12:04 AM, Norman Palardy wrote:
>>>
>>>> This starts to border on religion.
>>>> How the heck did people write good software in C, Pascal or RB when
>>>> this capability was not available ?
>>>
>>> As far as C is concerned, I've used block-scoped declarations for
>>> years.
>>
>> Yes.
>> Forcing a new cope level with {} was a trick you could use.
>> Many did.
>
> Block scoping was more a C++ trick to be honest. It allowed for
> better control of object destructors.
Very true for C++
> C doesn't really have so much speed loss with variables, if you don't
> initialise it to a value....
Speed was not really the issue though.
More the inadvertent use when the variable should no longer be
considered "valid" and so a scoping level made sense to control that
kind of behavior and usage
> I suppose tighter scopnig of variables may make the optimisers job
> easier, though.
Not sure if C compilers don't have that down pretty well without
hints like this.
A really good optimizing C compiler can crank out pretty decent code
although not necessarily the fastest on the planet and a human may be
able to optimize assembler by hand better. But there just aren't many
who do still write assembler that much to be that good at it
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>