• Complain

Avdi Grimm - Exceptional Ruby

Here you can read online Avdi Grimm - Exceptional Ruby full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2011, publisher: Pragmatic Programmers, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Avdi Grimm Exceptional Ruby
  • Book:
    Exceptional Ruby
  • Author:
  • Publisher:
    Pragmatic Programmers
  • Genre:
  • Year:
    2011
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Exceptional Ruby: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Exceptional Ruby" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Exceptional Ruby is an in-depth guide to exceptions and failure handling in Ruby. Over 100 pages of content and dozens of working examples cover everything from the mechanics of how exceptions work to how to design a robust failure management architecture for your app or library. Whether you are a Ruby novice or a seasoned veteran, Exceptional Ruby will help you write cleaner, more resilient Ruby code. What Youll Find: A detailed look at the lifecycle of a Ruby exception. Overriding Kernel#raise for fun and profit. Alternatives to exceptions, for when fail fast isnt the right answer. How to write a crash logger. Advanced dynamic exception matching in rescue clauses. Avoiding failure cascades with the Barricade and Circuit Breaker patterns. 5 questions to ask before raising an exception. Exception safety testing for critical methods. How to create an error API for your library that will make other developers want to kiss you. The 3 exception classes every app or library needs. And much, much more... over 100 pages of tips, guidelines, and awesome hacks!

Avdi Grimm: author's other books


Who wrote Exceptional Ruby? Find out the surname, the name of the author of the book and a list of all author's works by series.

Exceptional Ruby — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Exceptional Ruby" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Exceptional Ruby
About

Exceptional Ruby

Copyright 2011 by Avdi Grimm. All rights reserved.

Unauthorized distribution without paying me is lame and bad for your karma. If you somehow came into a possession of this document without purchasing it, I'd really appreciate it if you'd do the decent thing and head over to http://exceptionalruby.com to buy a legit copy. Thanks!

Exceptional Ruby was written using the wonderful Org-Mode package for Emacs. The PDF edition was generated using LaTeX. Source code highlighting is by Pygments, via the LaTeX "minted" package.

The cover is by RabidDesign.

This text originated as the talk "Exceptional Ruby", which I first gave in early 2011. It contains revised and extended examples, as well as a number of completely new sections.

History
  • 2011-02-08 Initial
  • 2011-02-09 Got started on intro and definitions.
  • 2011-02-10 Up through exception safety testing.
  • 2011-02-14 Beta
  • 2011-02-24 Added section on dynamic exception lists for rescue. Added section on dynamic exception matchers. Colorized source listings.
  • 2011-02-24 Added a section on rescue as a statement modifier.
  • 2011-02-25 Fixed a couple of typos (Tim Knight). Made title casing more consistent. (George Anderson)
  • 2011-02-26 Various typos and improvemens from George Anderson. Improved explanation of the stack unwinding process.
  • 2011-02-26 Added an explanation of why rescue catches StandardError by default (George Anderson)
  • 2011-03-06 Expanded on re-raising the current exception (George Anderson).
  • 2011-03-06 Expanded the illustration of disallowing double-raise (George Anderson).
  • 2011-03-06 Fixed the trap example (George Anderson).
  • 2011-03-06 Made exception-in-thread example a little clearer (George Anderson).
  • 2011-03-06 Lots of fixes from George Anderson.
  • 2011-03-06 Renamed and expanded the handler method section.
  • 2011-03-06 More fixes from George Anderson.
  • 2011-03-15 Finished going through notes and corrections from George Anderson.
  • 2011-03-15 Added much-expanded section on the "else" clause.
  • 2011-04-26 Added section on module tags.
  • 2011-04-27 Assorted PDF formatting improvements.
  • 2011-04-27 Converted longer code samples into floating listings. Removed chapter/section numbers.
  • 2011-04-28 Fixed figure size. Added nicer page headers.
  • 2011-04-28 Added detailed commentary on exception tester implmentation.
  • 2011-04-28 Added a bit more about design by contract (Dave Thomas)
  • 2011-04-28 Improved exception performance section, and other tweaks (Dave Thomas)
  • 2011-04-28 More edits from Dave Thomas
  • 2011-04-28 Finished incorporating feedback from Dave Thomas.
  • 2011-04-28 Incorporated errata from Sean Miller. Global spell check.
  • 2011-04-28 Added a discussion of Timeout::Error (Sean Miller)
  • 2011-04-28 Expanded a few explanations based on Pat Maddox' feedback.
  • 2011-04-28 Incorporated feedback from Evan Light.
  • 2011-04-28 Fixed a typo in the Rack example (Florent Guileux)
  • 2011-04-28 Incorporated errata from Ginny Hendry. Added coverage of Cond library.
  • 2011-04-28 Added mention of Nestegg gem.
  • 2011-04-28 Misc tweaks.
  • 2011-04-30 Fixed errata from George Anderson and Michel Demazure. Ditched the uppercase "Exception" convention.
  • 2011-05-01 Numerous tweaks to the appearance of console output.
  • 2011-05-01 Many small tweaks, mainly to source listings.
  • 2011-05-01 Added section on "The no-raise library API"
  • 2011-05-02 Added acknowledgements.
  • 2011-05-02 Errata from Yale Kaul.
  • 2011-05-03 Fixed a few incorrect output listings.
Acknowledgements

This book would not exist in its present form without the gracious help of a number of people.

Very special thanks go to George Anderson, who went above and beyond in providing copious, detailed proofreading notes and suggestions, constantly encouraged me, and who schooled me in the proper use of em-dashes.

Thank you to the technical reviewers who provided feedback on my early drafts: Evan Light, Jeff Casimir, Peter Cooper, Pat Maddox, Bryan Liles, and Dave Thomas.

Thanks to all of the Beta readers who bought the book in its unfinished form and thus gave me the confidence to keep working on it. Thanks especially to the Beta readers who sent me errata and other feedback: Sean Miller, Timothy Knight, Florent Guileux, Ginny Hendry, Michel Demazure, Yale Kaul.

Thank you to Jim Weirich, for sharing his failure-handling insights with me and helping clarify my thoughts on several points. Thanks to Larry Marburger, for always being around for me to bounce ideas off of. Thanks to the members of the Org-Mode mailing list for helping me with assorted LaTeX-export problems. Thanks to Robert Klemme, whose article "The Universe Between Begin and End" perfected my understanding of the else clause; and to Nick Sieger, for allowing me to reprint his code for printing out the Ruby exception heirarchy.

Thank you, finally, to my wife Stacey for being nothing but supportive of yet another project that keeps me in my office till all hours.

If I have missed anyone I sincerely apologize. Email me and I'll make sure you're included in future copies of the book.

Introduction

If software were a 10-year-old's bedroom, failure handling would be the tangled mass of toys and clothes crammed hastily into the closet before Mom comes to inspect. As programmers, we know that handling errors and failures is unavoidable, and on some projects we may spend half or more of our development hours chasing down tricky failure cases. Yet dealing with failure remains an afterthought in many projects, pushed off until it can no longer be ignored, and then dealt with in a piecemeal, haphazard fashion.

In most test suites, "happy path" tests predominate, and there may only be a few token failure case tests. Software books typically relegate handling failure to brief, cursory chaptersif the topic is addressed at all. And most mature codebases are riddled with the telltale signs of hastily-patched failure casesbusiness logic that is interrupted again and again by nil-checks and begin...rescue...end blocks.

This is a book about writing software with failure in mind. It's about how to write Ruby code that takes full advantage of the language's impressive array of features for signaling and handling unexpected conditions. And it is about approaching the problem of fallible software in a more disciplined, thoughtful way.

I have two goals for this book. I hope that after reading it, you will:

  1. Have a more complete understanding of the mechanics of Ruby's failure handling facilities; and
  2. Be equipped with the patterns and idioms you need in order to architect a robust failure-handling strategy for your apps and libraries.

Armed with a deep understanding of Ruby's powerful exception system and a toolbox full of failure-handling techniques, your code will be more reliable and easier to understand. It will crash less often, and when problems occur it will fail more gracefully. And you'll be a happier programmer, because you'll be spending more time on writing new features and less time chasing down unexpected exceptions.

What is a failure?
Definitions

So what exactly do we mean by "failure?" What about "error" and "exception?"

These are terms that are often used interchangeably in discussing software. In the interest of clarity, within this book I will adopt the definitions of these three terms used by Bertrand Meyer in his book "Object Oriented Software Construction":

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Exceptional Ruby»

Look at similar books to Exceptional Ruby. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Exceptional Ruby»

Discussion, reviews of the book Exceptional Ruby and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.