in reply to Re^6: Perl scoping not logical...?
in thread Perl scoping not logical...?
I disagree with many things that Damian Conway writes in his books. Learning Perl is important if you want to program in Perl.
That you have not seen the idiom frequently used may be due to you not encountering situations where having a subroutine if a lexical scope is necessary.
It may be due to your different exposure. Even though I only listed "recent" languages (Visual Basic dates from 1991), that is mostly because I remember the scoping rules for these quite well. I think the decision on whether support lexically scoped subroutines was made on a performance/implementation aspect. For lexically scoped subroutines, you need to do more housekeeping with the stack than on subroutines that do not allow such, at least for language implementations that allocate all variables on the stack. The "early" languages did that quite often, as the stack has hardware support while allocating from the heap is more expensive.
If you're bent on categorizing C as a "scripting language", feel free to do so, but it detracts from whatever point you might be trying to make otherwise.
As an aside, your run on sentences make your text hard to follow. You should try to take a step back and see whether your sentences are complete, contain matched sets of parentheses and whether the points you're trying to make are clear. I found many of your paragraphs very hard to follow and thus don't comment on them.
|
|---|