in reply to Re^2: Extracting elements from array
in thread Extracting elements from array

dereferencing a simple array reference

I always dereference with curly braces, AND whitespace! Sure, it's redundant, but it allows my tired old eyes to see what I just wrote.

keys %$href
keys %{ $href }
I have to squint a little to read the former; not so much on this page, but on the terminal, definitely. :-( But to each their own, eh?

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^4: Extracting elements from array
by GrandFather (Saint) on Jan 15, 2016 at 21:13 UTC

    When you read English prose like :

    He (Tom) ...

    where do you expect to see white space ? Why should your expectations be different for other languages ( even artificial ones ) ?

    You have been trained since your first exposure to printed English to very standardised use of white space . Are you suggesting we should throw away all that hard wired preprocessing and reinvent a whole ' nother wheel ? Have you even tried typing prose with " silly " white space ? It ' s actually quite slow because it ' s not at all " natural ". What ' s it like to read ? Do ( ( redundant ) ) or ( unnecessary ) brackets help ?

    Premature optimization is the root of all job security

      Well, besides the eyesight issue, there's the fact that I wasn't actually trained that way in Perl.

      When I started at the University of RTFM I was looking at a lot of very ugly code. Lots of global vars up top, massive chunks of comments, lots of repeated lines to populate data, lots of report()/write() sections ... all the glories of Perl 4, Matt's Script Archive; it was ugly.

      The first thing I used to do (and still do) was to put in a bunch of blank lines and spaces so I could see what was going on. I got used to writing that way, and maybe because of that, as you say, and maybe because it's intrinsically clearer, I find it it much easier to take in paragraphs of code at a time.

      YMMV :-)

      The way forward always starts with a minimal test.

        FWIW, I'm in your camp on using lots of white space and less fancy code.