Author Topic: Funny reply on ruby programming mailing list  (Read 1727 times)

Offline quadz

  • Loquaciously Multiloquent Member
  • ****
  • Posts: 5352
    • View Profile
  • Rated:
Funny reply on ruby programming mailing list
« on: February 13, 2010, 03:39:29 PM »
Subject: Re: Is there a way to get a method to always run at the end of any descendent's initialize method?
From: The Higgs bozo

Thomas Sawyer wrote:
> > Or something like:
> >
> > require 'facets/kernel/as'
> >
> > class MyClass
> >   class << self
> >     alias _new new
> >     def new
> >       instance = _new
> >       ancestors.reverse_each do |anc|
> >         if anc.instance_methods(false).include?(:preinitialize)
> >           instance.as(anc).preinitialize
> >         end
> >       end
> >     end
> >   end
> > end
> >
> > Then define #preinitialize at any level you wish.
> >
> > (Note this is off the top of my head so it may need tweaking to
> > run).

Yeah, that was Ryan's point about overly clever solutions. That may
look good now, but someone who is debugging some code which depends on
it will hate you. And when you are debugging six months from now,
you'll hate yourself.

If you really want to do this, put some real effort into designing a
clean API for it. Put it in a gem. Make it real, real obvious that
you're putting a twist on the conventional method calling
chain. Document the API so it's obvious in a coherent, readily
understandable way.

Don't slip a concrete dildo into someone's box of Fruit Loops. They
won't be happy with your Morning Breakfast Surprise. Put the concrete
dildo in a clearly labeled box, with instructions. Then when someone
encounters a problem, "Hey, something is screwing me here. Maybe it's
the concrete dildo?" at least they know to ask.



:dohdohdoh:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."

 

El Box de Shoutamente

Last 10 Shouts:

 

|iR|Focalor

April 02, 2025, 02:47:07 AM
 

Yotematoi

February 14, 2025, 12:41:48 PM
 :-*
 

|iR|Focalor

February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.

0rbisson

February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last
 

rikwad

February 08, 2025, 10:48:18 PM
Seattle FFA now has working HTTP downloads. Thanks Unholy!
 
RIP Pepp   ✟
 
 

-Unh0ly-

February 03, 2025, 01:20:14 AM
vvvALL WEAPS HAVE MUZZLE FLASH vvvv
 

|iR|Focalor

December 25, 2024, 12:15:35 AM
 

|iR|Focalor

December 25, 2024, 12:06:54 AM
 

RailWolf

December 23, 2024, 09:15:50 AM
Fixed the image for you =)
And Die Hard is a great Christmas movie

Show 50 latest
Welcome, Guest. Please login or register.
April 10, 2025, 01:12:13 AM

Login with username, password and session length