Review: Ruby by Example

    Date23 Jul 2007
    CategoryBook Reviews
    31142
    Posted ByBrittany Day
    Learning a new language cannot be complete without a few 'real world' examples. 'Hello world!'s and fibonacci sequences are always nice as an introduction to certain aspects of programming, but soon or later you crave something meatier to chew on. 'Ruby by Example: Concepts and Code' by Kevin C. Baird provides a wealth of knowledge via general to specialized examples of the dynamic object oriented programming language, Ruby. Want to build an mp3 playlist processor? How about parse out secret codes from 'Moby Dick'? Read on!



    Date: July 23, 2007

    Vitals:

    TitleRuby by Example: Concepts and Code
    AuthorKevin C. Baird
    Pages281
    ISBN1-59327-148-4
    PublisherNo Starch Press
    Edition1st Edition
    Purchasehttp://www.oreilly.com/catalog/9781593271480/

    Audience:

    The book is aimed at being immediately accessible to all levels of Ruby programmers, however it has a very interesting slant towards the often overlooked functional programming strengths of Ruby. If you love your scripting languages served with a burst of lambdas and proc objects, or you're a fan of Haskell and Lisp, this book is for you. Anyone looking for a Rails or Web 2.0 tutorial should look elsewhere as this book concentrates on other natures of Ruby.

    SUMMARY:

    The book is divided into 10 chapters that increase in complexity as far as examples and paradigms go. The first five chapters will introduce the core concepts of Ruby's dynamic object oriented nature. Concepts such as variable assignment, booleans, methods, and constants are introduced with an interactive approach - the reader is encouraged to follow along with Ruby's IRB (Interactive Ruby) to type in the actual code and see feedback within a keystroke. Example scripts that readers could hack on include printing the lyrics to '99 Bottles of Beer on The Wall', detecting palindromes in strings, and dicing up text through a series of manipulation how-to's. These examples are a concise showcase of Ruby's scripting abilities as a language.

    From chapter 6 on, you can clearly see the author's enthusiasm for functional programming - he confesses his love of writing the intro chapter for proc blocks! By utilizing proc blocks and anonymous lamda functions, Baird goes on to use these concepts to extract code from Moby Dick, and even walks the reader through setting up a DJ Song Sampler. Mathematically inclined programmers will be right at home in this section and will appreciate the simple abstract blocks used to solve the problems mentioned above.

    Baird finishes out the book with a quick touch upon the Web abilities of Ruby, including a brief introduction of Ruby On Rails, a highly effective web development framework. Web developers and designers will be able to manipulate css style sheets, hack up some cgi scripts, and get a taste of Ruby's killer application, Ruby on Rails.

    OPINION:

    The book definitely provides great learning examples with some slick functional programming goodness thrown in for good measure. I've yet to see a Ruby book delve this far into the mathematical nature of Ruby. The author also leaves some tidbits about the history of how Ruby came about by citing other programming languages' strengths and weaknesses. Baird's honesty in this case helps round out your skill set by challenging you to not only Ruby, but to examples of related genres around.

    Hardcore Rubyists will appreciate the heavier examples used to demonstrate the functional facets of Ruby, while others will make use of the highly applied examples for everyday programming problems. This book is great for all the mathematically inclined and will serve well in guiding them down the less beaten paths of Ruby.
    You are not authorised to post comments.

    Comments powered by CComment

    LinuxSecurity Poll

    What do you think of the articles on LinuxSecurity?

    No answer selected. Please try again.
    Please select either existing option or enter your own, however not both.
    Please select minimum 0 answer(s) and maximum 3 answer(s).
    /main-polls/24-what-do-you-think-of-the-quality-of-the-articles-on-linuxsecurity?task=poll.vote&format=json
    24
    radio
    [{"id":"87","title":"Excellent, don't change a thing!","votes":"65","type":"x","order":"1","pct":57.52,"resources":[]},{"id":"88","title":"Should be more technical","votes":"15","type":"x","order":"2","pct":13.27,"resources":[]},{"id":"89","title":"Should include more HOWTOs","votes":"33","type":"x","order":"3","pct":29.2,"resources":[]}]["#ff5b00","#4ac0f2","#b80028","#eef66c","#60bb22","#b96a9a","#62c2cc"]["rgba(255,91,0,0.7)","rgba(74,192,242,0.7)","rgba(184,0,40,0.7)","rgba(238,246,108,0.7)","rgba(96,187,34,0.7)","rgba(185,106,154,0.7)","rgba(98,194,204,0.7)"]350
    bottom200

    We use cookies to provide and improve our services. By using our site, you consent to our Cookie Policy.