
One base class to rule them all. - davepeck
https://www.destroyallsoftware.com/blog/2011/one-base-class-to-rule-them-all
======
joshuaxls
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._

~~~
idonthack
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

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

~~~
socratic
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?

~~~
Groxx
Closest you can get is something like this: <http://hnpoints.com/about>

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

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

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

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

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

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

~~~
garybernhardt
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... ;)

------
JonnieCache
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.

~~~
judofyr
Wilson: <https://github.com/seattlerb/wilson>

~~~
JonnieCache
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...](http://confreaks.net/videos/198-rubyconf2009-worst-ideas-ever)

------
jerf
Clearly the next step is to hook this up to
[http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/...](http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/index.html)
, <https://github.com/zephirworks/ruby-perl> , and
<http://jmettraux.wordpress.com/2009/03/16/ruby-to-lua/> . Truly one language
to rule them all.

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

~~~
JonnieCache
I think I may have just had a brain hemorrhage.

------
KevinEldon
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...](https://www.destroyallsoftware.com/blog/2011/continuous-automated-
performance-testing)

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

~~~
rohitarondekar
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.

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

~~~
Groxx
Neither did I. Isn't Ruby amazing?!

------
jroseattle
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.

~~~
saurik
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).

~~~
garybernhardt
Done:
[https://github.com/garybernhardt/base/commit/65e8ca5d432be72...](https://github.com/garybernhardt/base/commit/65e8ca5d432be72bbc16f625de002ba90e0f4006)

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

------
silentbicycle
Of _course_ it's Ruby.

~~~
garybernhardt
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.

~~~
cbs
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.

~~~
Luyt
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?

------
adgar
Pull request 5: Auto-require every gem.

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

Wow.

------
dwhitney
awsome

------
spullara
Hey, look! They made C! :)

------
Confusion
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.

