Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: I want you to convince me to learn Perl

by soonix (Curate)
on Sep 25, 2013 at 10:01 UTC ( #1055643=note: print w/ replies, xml ) Need Help??


in reply to Re^3: I want you to convince me to learn Perl
in thread I want you to convince me to learn Perl

yep, that's what I meant with "more differences than that". OTOH, wether something is annoying (and how much so), very often is influenced by what you have been using before, or what you are used to. E.g. I had seldom need for anonymous subs, so didn't miss multiline ones :-)


Comment on Re^4: I want you to convince me to learn Perl
Re^5: I want you to convince me to learn Perl
by BrowserUk (Pope) on Sep 25, 2013 at 10:43 UTC
    I had seldom need for anonymous subs, so didn't miss multiline ones :-)

    You've never spread a sort block or map block or grep block over two or three lines?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      something like this? (excerpt from App::tkiv)

      my @img = map { $_->[0] } sort { $tsort{$Option{thumbsorting}}->() } map { my $seq = m/(\d+)/ ? $1 : 0; [ $_, $seq, (stat "$Idir/$_")[7,9], lc $_, rand 1 ] } grep { my $if = "$Idir/$_"; # Sanity check. Minimal image size 100 my $s = -s $if; # Skip MacOS working copies $if =~ s{/\._([^/]+)$}{/$1} && -s $if and $s = 0; $s and $s > 100; } # convert can't deal with .ico files (yet) # Tk can deal with Tiff/NEF as of 804.027_501 with Tk::TIFF grep m/\.(jpe?g|gif|x[pb]m|png|bmp|tiff?|nef)$/i => readdir +IDIR;

      Enjoy, Have FUN! H.Merijn
      See, those little helpers are our friends. Don't good friends deserve a name? :-)
        Don't good friends deserve a name?

        Sorry. I see your smiley face, but I'm going to answer the question seriously: Absolutely frikkin' not :)

        Why contrive a name for something that will never be called anywhere else?

        Why contrive a name for a block of code that only makes sense in one place in the source?

        That will often will only work in one place in the source because it needs access to lexical variables in scope at that position (closures). If you make the blocks named subroutines, then they have to be declared out-of-line of where they are used, which means you now need to pass (what would be) closures via arguments; and that means making up more names for the formals.

        Take a look at this, and tell me, what would you name the two map blocks?

        And if you're going to go that route, how about naming the blocks for your while loops; and for loops; and if & elsif & else bodies; and ...


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        NO!

        Wasting time inventing a name for something I use once, ensuring the name is unique within its namespace, moving the three lines somewhere far away from the place they are used and risking someone calls them differently than originally intended, just because the author of the language could not think of a nice enough syntax? No thanks!

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (16)
As of 2014-12-18 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls