Hacker News new | past | comments | ask | show | jobs | submit login
I just released an eBook about exceptions and failure handling in Ruby (exceptionalruby.com)
71 points by avdi on May 4, 2011 | hide | past | favorite | 38 comments



I'm loving the recent explosion in self-published books, but as a (general) request: they are so, so much more useful when they come in multiple formats (mobi, epub and pdf).


It's shameless self-promotion, but my startup Leanpub (http://leanpub.com) lets you write in HTML or Markdown, embed external code samples, save your files in Dropbox and produce PDF, EPUB and MOBI with one click. We sell all 3 formats, with automatic update distribution to existing readers when you publish a new version (so you can sell your book while it's in progress). You keep the rights to your book, etc.


Uh... That's actually awesome. I'll start writing a book now, and that's where I'll publish it.


Great! Let me know how it's going, and if there's anything you need us to improve...


I definitely will! Right now I just wish you supported LaTeX, though.


That sounds super cool. I'm gonna check it out.


Game on, my friend.


What to say when comment upvote counts are gone. Can't upvote this enough. (For me, mobi prefered.)


Me as well. And pdfs tend to look/read very poorly on a Kindle (especially if they contain code blocks).


I'm gathering feedback on which format to work on next. So far the most-requested has been .epub.


If you do go the epub route, let me know know if you're interested in trying eBookBurn.com (my startup's site), and I can issue you a promo code.

You'll also get a .mobi version simultaneously.


Yes, please.


+1 .mobi for kindle

avdi: let me know if you'd like any help packing a .mobi, I'm working on a quick-tutorial post.


As I replied above, I'll probably work on Epub first because that's the format I got the most requests for when I did a survey. But after that I'd be happy to get some Mobi pointers. Email me!


FWIW we (getdpd.com) totally agree and are working on adding this feature to our system soon. Vendors will be able to upload the file variants themselves or we will do the conversion on the backend.


As I'm usingn DPD for this book, I'm happy to hear that!

P.S. Would you mind getting in touch with me? I have a script to share with you guys.


Here are the slides from the presentation on the same topic given by Avdi.

http://avdi.org/talks/exceptional-ruby-2011-02-04/


Saw Avdi do this talk at Magic Ruby. It was really nice, and in depth, and answered quite a few questions. I bet the book is well worth the money.


Bought the book, found out Ruby has retry. Money well spent.


Thanks zizzler, now I don't need to buy the book ;-)


Wow, the timing could not be more perfect as Im trying to deal with a validate_uniqueness race condition :)


validate_uniqueness is a system that is completely broken once you have more than 1 ruby process running against the same database. It just can't work the way you want it to.

You must add constraints to the database and handle the resulting exceptions to ensure unique values.

They really need to kill validate_uniqueness since it is so totally broken


P.S. Just for that, im buying the book...


After seeing Avdi talk about this at Ruby on Ales, I've started using `fail` almost exclusively instead of `raise.`

It's the little things.


I quick check of the Ruby documentation (http://www.ruby-doc.org/core/) suggests that raise and fail are the same method.

Is there an actual difference between these methods?


Nope! It's strictly a style issue. As I explain in the video (or the book if you buy it), as a result of a conversation with Jim Weirich I'm starting to use "fail" once again.


Just read the sample pages and already learned something I am going to start using.


is it too late to suggest an epigraph?

"Ever tried. Ever failed. No matter. Try again. Fail again. Fail better." - Samuel Beckett


Anything like this for Python?


    try:
        your code
    except:
        handle the exception
    finally:
        clean up


That's all you'll find in my book, I just made the font really big and quintuple-spaced it.

;-)


"Check out the talk that that inspired the book" <- Find the the redundancy.


Now, if pointing out syntax errors on a commercial frontpage doesn't help the author, then I don't know, guys.


I want to read this book because I'm curious as to how you can stretch this topic beyond two pages. But I don't want to pay $15 for that. Any ideas?


The sample has more than two pages: http://exceptionalruby.com/exceptional-ruby-sample.pdf


"I think your book is crap. Give it to me for free?"


Not what I said at all. I am honestly intrigued, but not because I care about Ruby.


There's a video on the site of the conference talk that spawned the book, if that helps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: