Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: (RFC) Arrays: A Tutorial/Reference

by kyle (Abbot)
on Jan 13, 2007 at 14:24 UTC ( #594541=note: print w/ replies, xml ) Need Help??


in reply to (RFC) Arrays: A Tutorial/Reference

Good article, just a few suggestions...

Your list of "fundamental Perl array operations" should be linked to the sections later in the node, like an index. See General-Purpose Linking.

In your "Clear an array" section, you don't mention this:

@array = ()

...but it does show up at the end of the section on splice.

At your quiz, you say "highlight text to see it", but then use a <spoiler> tag.

Your description of pop could be as detailed as your description of shift. Maybe put shift first and refer back to it.

I'm not sure "array slice" counts as jargon.

I think the whole section on splice would be better with examples. Showing equivalences to other operations such as shift is good, but those are available in the splice documentation that you link, and it might be nice if a novice could come learn about splice without reading everything else. The kind of examples I'm talking about are similar to what you write for unshift and friends.

@array = ( 'a', 'b', 'c', 'd', 'e' ); @s = splice @array, 1, 2;

@s will contain ( 'b', 'c' ) and @array will contain ( 'a', 'd', 'e' ).


Comment on Re: (RFC) Arrays: A Tutorial/Reference
Select or Download Code
Re^2: (RFC) Arrays: A Tutorial/Reference
by jdporter (Canon) on Jan 13, 2007 at 16:33 UTC
    In your "Clear an array" section, you don't mention this:

    @array = ()

    Please look again.

    Keep in mind that there is the Clear an array section, and then there are Clear an array - Round 2 and Clear an array - Round 3. Perhaps you were looking in one of the latter two.

    At your quiz, you say "highlight text to see it", but then use a <spoiler> tag.

    That's because I've configured spoiler tags to render as <div>, in my Display Settings. Probably I shouldn't say anything, and just let the user figure out how to deal with spoilers.

    Your description of pop could be as detailed as your description of shift. Maybe put shift first and refer back to it.

    I wrote it this way because I think of pop as being somewhat more fundamental, or intuitive, than shift. Clearly it could have been written the other way. A choice had to be made. :-)

    I'm not sure "array slice" counts as jargon.

    I think it's programming jargon, and frankly I've never heard the term used in relation to programming in any language other than Perl, though obviously it could be. The point was to introduce the reader to this term, which, if never encountered before would seem like jargon, and so ease the introduction by admitting that it's jargon.

    Thank you for all your excellent comments.

    A word spoken in Mind will reach its own level, in the objective world, by its own weight

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-09-21 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (173 votes), past polls