Re: why the perl docs suck
- From: robic0@xxxxxxxxx
- Date: Sun, 23 Oct 2005 14:54:27 -0700
On 22 Oct 2005 12:09:11 -0700, "Al" <acummingsus@xxxxxxxxx> wrote:
Wow, I guess a guess is a good as you can make. You didn't write
Perl did ya??? Or what?
If you know simple C, just how would you implement this, ie:
how would you handle memory allocation/re-allocation?
Is the author trying to give you a "hint" on lower level
implementation (performance), from a Perl specific higher level
construct? Does each "itteration" in the "for", allocate new,
free old each time through? Does "push()" create an array of
pointers then add up each "element" size, allocate/re then
(possibly use stack) then use a single mem alloc/de-alloc?
Well you don't know do you? You can't say. You don't know
the granularity of a Perl push statment. Hey, I'll bet
you don't know that memory allocation is not contiguous!
And memory is fragmented and on the system level is
always a linked list of discontinuous address blocks.
But how would this relate to a "higher" level lang
like Perl? Maybe you don't know or care. If you don't know,
maybe you shouldn't act like you do. Cause I'm pretty sure
you don't unless your the writer of Perl. I can pretty
much tell you "in general" how it should be. But you
"can't tell me how it is". Mostly because of the misguided
attitude of newcommers to higher level languages who
read hype and parrot unusually stupid, unanswered proclimations
of the lower level "un-educated (some call themselves GOD) posters".
The bottom line is this: You can't mindleslly proclaim or
condone or promote ANY documented claim of performance/efficiency
unless you know, or ready to back up, what it means.
Bells ringing, back to class!
>
>> > Maybe you'll be able
>> > to translate just what the documentation means by
>> > "more efficient".
>
>> > Tell you what, you bring out any example in the docs
>> > with this statement in there and you tell me how
>> > its more efficient. Lets see what you know.
>
>I can only wonder if the above is meant with this next to be as the
>context:
>
>[ perldoc -f push ]
> end of ARRAY. The length of ARRAY increases by the
>length of
> LIST. Has the same effect as
>
> for $value (LIST) {
> $ARRAY[++$#ARRAY] = $value;
> }
>
> but is more efficient.
>------------
>
>BTW you'll not "see what I know"
>
>my *guess* is that the for(..){} of course iterates -- so, via
>iteration, one at a time onto end of array. And my *guess* is that
>push just directly puts (however many are specified) all at once onto
>end of array.
.
- Follow-Ups:
- Re: why the perl docs suck
- From: Tassilo v. Parseval
- Re: why the perl docs suck
- From: Al
- Re: why the perl docs suck
- References:
- Re: why the perl docs suck
- From: Jürgen Exner
- Re: why the perl docs suck
- From: Jürgen Exner
- Re: why the perl docs suck
- From: robic0
- Re: why the perl docs suck
- From: Tassilo v. Parseval
- Re: why the perl docs suck
- From: robic0
- Re: why the perl docs suck
- From: robic0
- Re: why the perl docs suck
- From: robic0
- Re: why the perl docs suck
- From: Jürgen Exner
- Re: why the perl docs suck
- Prev by Date: Re: question about forked processes writing to the same file
- Next by Date: FAQ 8.47 How do I keep my own module/library directory?
- Previous by thread: Re: why the perl docs suck
- Next by thread: Re: why the perl docs suck
- Index(es):