Showing posts with label object orientation. Show all posts
Showing posts with label object orientation. Show all posts

Wednesday, August 29, 2012

Ruby: can I name the class of a particular variable? is there something like "is_a?"?

What is a simple / elegant way in Ruby to tell if a particular variable is a Hash or an Array? - Stack Overflow

The answer is of course: yes, you can.
And: yes, exactly.

XmlSimple treats elements with attributes as Hash, w/o attributes they are simply String.

"googlecl-0.9.12 -> googlecl-0.9.13" brought a change, where a specific element now does not have attributes any longer, and this broke my code, that reads "google contacts list … --fields=xml".

Solved one of my two urgent home software problems.

Thursday, August 2, 2012

O'Reilly Media book: Intermediate Perl, 2nd Edition

Intermediate Perl:
Get a clear roadmap for improving your skills with Intermediate Perl, and gain working knowledge of Perl's objects, references, and modules—ingredients that make the language so versatile and effective. Written by the authors of the bestselling Llama book, Learning Perl, and updated for Perl 5.14, this book offers a gentle but thorough introduction to intermediate programming in Perl.

  • Chapters 14 and 20: testing
  • Chapter 12: Creating Your Own Perl Distribution; has a section on "Plain Ol’ Documentation" (POD)
  • Chapter 19: Moose
  • Chapter 13 and 15: OO

Monday, April 16, 2012

o'Reilly Media book: Perl Best Practices

  • Perl Best Practices - O'Reilly Media
  • its Appendix B gets provided for the public by the publishing house, it lists all the recipes with brief descriptions [Link]
  • "PBP Module Recommendation Commentary" on Socialtext [Link, actually Perl Foundation links to that via "perlfoundation.org/perl5/index.cgi?pbp_module_recommendation_commentary"]; some "yes", "mostly yes", "no", "maybe" regarding the modules recommended in the book; short resp. compact and worth reading resp. good for looking up a module, that you are tempted to use after reading about it in the book, so you have another (useful) opinion
  • a collection of 256 guidelines – find them listed on a refcard here!

  • it got released in 2005 though, and time went on in the meantime!
  • rather nice to read
  • its author also teaches classes in courses by this name, they should be rather up-to-date
From the TOC:
  • Chapter 2: Code Layout: …, Vertical Alignment, …
  • Chapter 7: Documentation (this is the most extensive text on POD, that I know in the Perl literature)