Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Top 10 things to read when your flight is canceled

by bobf (Monsignor)
on Mar 13, 2007 at 16:00 UTC ( [id://604590]=perlmeditation: print w/replies, xml ) Need Help??

My connecting flight was canceled last night. I was too tired to code anything so I decided to peruse perldoc - something I should do more often. The time flew by (pun intended) and I learned a few things. In fact, it was one of the more productive and enjoyable layovers that I have experienced (except for the fact that all of the restaurants were closed).

Here is what I read*. I started with the perldeltas (I never reviewed them after upgrading from 5.6.1 to 5.8.8), then learned about attributes, and then browsed through my installed modules.

  1. perldelta 5.6.1 to 5.8.8
  2. attributes pragma
  3. constant pragma
  4. perlsub
  5. Attribute::Handlers
  6. Class::Accessor
  7. DBIx::Class
  8. Exception::Class
  9. List::Util
  10. Params::Validate

That's all I had time to read (although I skimmed many others). Overall, it was a nice combination of reviewing old material and learning new material.

This got me thinking: what do other monks do during layovers? If you had a couple of spare hours, what would you read?

*Update: Please note that the inclusion and ordering of the items above are not a measure of relative importantance, they are simply the 10 items that I spent the most time on after starting from the top of the table of contents. :-)

  • Comment on Top 10 things to read when your flight is canceled

Replies are listed 'Best First'.
Re: Top 10 things to read when your flight is canceled
by Mutant (Priest) on Mar 13, 2007 at 17:03 UTC
    Some of those are definitely on my list of things to read.

    ++Class::Accessor and DBIx::Class.

    I am not a big constant fan however. I went through a phase (well, probably about 2 years) of using them, but they can be fiddly at times, especially if you use them for complex data structures. You often end up with something like:
    print "I have " . FOO()->{APPLES} . " apples".
    which to me is just ugly, and gets unreadable pretty quickly, especially if you have constants in different packages.

    Besides that, I realised there's actually nothing stopping you modifying the values. Like most things in Perl, it's really just a convention. If that's the case, I'd rather just use uppercased variable names, which is a pretty widely used convention, and not as messy as the pragma.
      In Perl Best Practices (Ch. 4) TheDamian recommends "use Readonly" instead of "use constant", both because it prevents further modification of the value, and because Readonly gives your constants the syntax properties you would expect to go with their having a sigil.
        The disadvantage to Readonly is that it isn't optimized away, if it was possible. For example:
        use constant DEBUG => 0; print STDERR "foo = $foo\n" if DEBUG;
        The second statement gets optimized away. But in
        use Readonly; Readonly::Scalar $DEBUG => 0; print STDERR "foo = $foo\n" if $DEBUG;
        the last statement is not optimized away, and the test is indeed performed every time the statement is encountered.

        Even worse: a Readonly variable is a tied variable, so the test will be slower than it would have been if it wasn't Readonly.

      printf "I have %s apples", FOO()->{APPLES};
Re: Top 10 things to read when your flight is canceled
by jdporter (Paladin) on Mar 13, 2007 at 16:40 UTC

    I usually "cross-train" by reading books on philosophy, religion, or theoretical physics... or maybe a good book on enterprise software development. ;-)

    For flights, I also usually bring along one of those big books of mixed puzzles, and a pad sudoku puzzles.

    A word spoken in Mind will reach its own level, in the objective world, by its own weight
Re: Top 10 things to read when your flight is canceled
by Old_Gray_Bear (Bishop) on Mar 14, 2007 at 01:05 UTC
    The last time I was at loose ends in an airport I was working my way through Effective Perl Programming, Hall & Schwartz, for the second time. If I were stranded today, I have Advanced Perl Programming, 2nd Ed., Simon Cozens, in the back-pack. I like to have something useful to read when I am taking a take a sanity break from work. (My Boss thinks I just go find an out-of-the-way table and think Deep Thoughts About Work when I go on breaks....)

    ----
    I Go Back to Sleep, Now.

    OGB

      OGB said:

      (My Boss thinks I just go find an out-of-the-way table and think Deep Thoughts About Work when I go on breaks....)

      That's such a strange phenomenon, but it's a very useful one. My (slightly)PHB has a similar misconception. Since I often come back from breaks with good ideas to sticky problems, he has come to believe that my breaks involve me disappearing to puzzle on Deep Matters of the Project.* Naturally, it follows that I need to take more breaks. ;-)

      *: In reality, I go for a walk by the river (nearby); or, in colder weather, perhaps retire to a conference room (we have no lounge) with a fresh cuppa and my Nintendo DS. It's the relaxation that helps me percolate the good ideas. ;-)

      <radiant.matrix>
      Ramblings and references
      The Code that can be seen is not the true Code
      I haven't found a problem yet that can't be solved by a well-placed trebuchet
Re: Top 10 things to read when your flight is canceled
by zerogeek (Monk) on Mar 13, 2007 at 16:21 UTC
    That's not what I was expecting based on your title. I was expecting maybe some new magazines or books or something along those lines. I have been stuck in many layovers and never considered perldoc to pass the time.

    Someone might need to revoke my geek card :)

      Sorry for the confusion. The original title was "...Perl things to read..." but I didn't think it sounded as good and I didn't want to limit the replies too much.

      In all honesty, I spent the first leg of the flight reading the newspaper and Perl Best Practices. :-)

Re: Top 10 things to read when your flight is canceled
by Moriarty (Abbot) on Mar 14, 2007 at 07:47 UTC

    Given that it's been quite a while since I flew anywhere, and considering that I can't take my craft on a plane (for some reason crochet hooks are considered lethal weapons), I guess I would have to go with a couple of computer magazines, a crossword book and a book of Sudoku and Karuku puzzles (why are pens allowed? Aren't they mightier than the sword?).

    Update: Corrected typos

Re: Top 10 things to read when your flight is canceled
by andyford (Curate) on Mar 13, 2007 at 20:49 UTC
Re: Top 10 things to read when your flight is canceled
by DrHyde (Prior) on Mar 14, 2007 at 10:19 UTC

    I'd read a book. When travelling I always carry several.

    I'd also not fly, because it's such a gigantic pain in the arse. Take the train instead when possible. Only fools fly when there's an alternative.

      I had 10 really short flights last year (20 minutes tops) and I can tell you that it's not flying that sucks, it's the airports. Technically I was at the airport all day for each one, but it was really more like a beach party than a lobby.

      -Paul

Re: Top 10 things to read when your flight is canceled
by greatshots (Pilgrim) on Mar 14, 2007 at 10:12 UTC
    I relax my soul and mind to the maximum when my flight is cancelled.
Re: Top 10 things to read when your flight is canceled
by valdez (Monsignor) on Mar 18, 2007 at 17:45 UTC

    That happened to me many times during last year, because my work now is split between Italy and China. The average layover is 5 hours, so I have plenty of time to read and program!

    The most important discoveries were definitely Net::Server and Net::Server::Mail, they transformed some daunting tasks into a real programming pleasure!

    Next modules on my list are Attribute::Handlers, Params::Validate and Config::General::Validate.

    The second discovery was a bookshop in the center of Beijing, where I buy O'Reilly books that are useful after my laptop battery runs out: they are so cheap that I tend to read even topics not related to my job (ie. AI for Game Developers).

    Ciao, Valerio

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://604590]
Approved by philcrow
Front-paged by derby
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found