Hacker News new | past | comments | ask | show | jobs | submit login
One base class to rule them all. (destroyallsoftware.com)
325 points by davepeck on Sept 5, 2011 | hide | past | web | favorite | 40 comments



As long as we're being silly with Ruby metaprogramming, my favorite: https://github.com/thorncp/fsck

Fsck allows you to express your feelings while you're developing. It does this by allowing you to add words to method names on the fly.


How clever. I've been inspired, I'm going to write a module named "mkfs" and it will do absolutely nothing related to making a filesystem


Yeah! Your joke library that appeals to a niche audience is really going to fill that second page of google results.


One issue with the current karma-less HN is that one cannot visually determine who won an exchange such as this one.

Is there a mechanism for determining the karma of a particular comment with additional effort?


I thought that was \the point\ of invisible karma.


Closest you can get is something like this: http://hnpoints.com/about

Otherwise, no, the information simply isn't available.


Not true. After 6 days you can view the karma points when you search at http://hnsearch.com/


I think we both lost :P.


I'd be laughing if I didn't fear that I'd someday be running into (or working with) someone who uses this.


I was cringing all the way down through this article. Thank god for the last paragraph.


exactly my first thought..


I started reading this seriously and at some point just burst out laughing. First 'tech text' to make me laugh like that. Very good.


I'm getting some serious Poe's Law vibes from this thing. If not for the disclaimer I would be rightly terrified.


I was tempted to leave the disclaimer off, both in the README and the blog post. But I think there's a strong enough chance of someone actually using it as it is... ;)


My favourite idiotic ruby gem: Tenderlove's NeverSayDie, which allows you to resuce segfaults.

https://github.com/tenderlove/neversaydie

I seem to remember a gem that allowed for inline assembly too, but perhaps fortunately I can't remember what it's called.



Ah, thanks, and now I've remembered where I saw these: tenderlove's "Worst Ideas Ever" talk at rubyconf, where he and ryan davis basically try and run all this shit at the same time, so they're rescuing segfaults then fixing them using inline assembly, cross compiling rails 2.3's AST into XML and then executing it, cross compiling rails into PHP, and all sorts of awful shit. Hilarious.

http://confreaks.net/videos/198-rubyconf2009-worst-ideas-eve...



Great gem. But why not include it in module form so I can mix it into BasicObject?


I think I may have just had a brain hemorrhage.


This base class (all your methods are belong to us?) is amusing, but the screencasts on Destroy All Software are pretty helpful. The $9/month was worth it for the continuous performance testing w/ RSpec explanation: https://www.destroyallsoftware.com/blog/2011/continuous-auto...

I am in no way affiliated w/ Destroy All Software other than being a happy new customer.


The screencasts are definitely very helpful. Also since they are not very long, they don't take much time to watch and you learn quite a lot.


Huh... I had no idea that a cantaloupe has five days.


Neither did I. Isn't Ruby amazing?!


I think that assumes refrigeration.


Issue #2 (https://github.com/garybernhardt/base/issues/2) is pure gold.

What license is this released under? I would assume an awesome base class needs a corresponding awesome license.


My preference would be "all OSI approved licenses; not any one in particular, but all of them at once" (and yes: this might legally conflict, but I think that would be a feature in this case, allowing for even more hilarious descriptions).



IANAL, but it's my understanding that there's no particular conflict here. You'd be licensing the same work under multiple licenses; if any one of them authorizes some particular use, that's enough to be an affirmative defense against copyright infringement. If you violate the terms of one license, that particular license may become void, but as long as some others remain, you're fine.

In other words, licenses don't make certain uses of works forbidden; they make them _permitted_. If you license it under both GPLv3 and BSD, and someone does something permitted under BSD but forbidden under GPLv3, the GPLv3 can't forbid the BSD license.

That said, the current wording (the 'union of the terms specified' by all OSI licenses) is not multiply licensing, but something far stranger...


Wow a pull request and forks already. Is there anything Ruby can't do?


Of course it's Ruby.


I could port it to Python if you want? ;) I probably wouldn't have done this when Python was my main language, though. That community has a much harder time laughing at itself than Ruby's does.


Fortunately the Perl community have no trouble laughing at itself either! So here's a port to Perl :) https://gist.github.com/1204277

Moose's MOP makes this "port" quite easy (as does Perl having multiple inheritance!). Does mean it only works on Moose classes but a universal approach is also possible but it wouldn't be as succinct!


Python already has one base class to rule them all, `object`. From just the title I thought that's what the post was going to be about.


The same thing in Python would require you to import all modules, and place all functions and classes in those modules in one class. Probably can be done, but whether it's useful?


Maybe C or k? ;)


Pull request 5: Auto-require every gem.

https://github.com/garybernhardt/base/pull/5

Wow.


awsome


Hey, look! They made C! :)


I'm sorry, but why is this joke being upvoted so much? It hardly seems HN material to me: I'm sure we've all jokingly considered about something like this once. I doubt anyone learned anything from it.




Registration is open for Startup School 2019. Classes start July 22nd.

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

Search: