Welcome,
Guest
. Please
login
or
register
.
July 03, 2025, 09:08:13 PM
News:
tastyspleen.net discord server:
http://discord.tastyspleen.net
Home
Forum
Help
TinyPortal
Search
Calendar
Login
Register
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
Funny reply on ruby programming mailing list
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Funny reply on ruby programming mailing list (Read 1780 times)
quadz
Loquaciously Multiloquent Member
Posts: 5352
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.
Logged
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."
Print
Pages: [
1
]
Go Up
« previous
next »
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
Funny reply on ruby programming mailing list
El Box de Shoutamente
Last 10 Shouts:
RyU
June 29, 2025, 06:27:46 PM
Q2 must never die
|iR|Focalor
May 26, 2025, 01:17:30 PM
-Unh0ly-
May 24, 2025, 10:08:35 PM
https://drive.google.com/file/d/1qwsj3EM4s5svp0b8oJLZt_An6990RB-o/view?usp=sharing
QUAKE 2 RTX
-Unh0ly-
May 22, 2025, 05:45:28 PM
https://drive.google.com/file/d/1VB1if3QjStPWCpbB33vbx7OOef-Negd3/view?usp=sharing
DUST 2 HD TEXTURES PUT IN BASEQ2 folder
Yotematoi
May 17, 2025, 08:33:15 AM
Yo desde el año 2007 me enfermé de Q2, es incurable
Morir y revivir es costumbre, lástima q el QT estaba bueno
ImperiusDamian
May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
|iR|Focalor
May 11, 2025, 02:33:39 PM
-Unh0ly-
May 03, 2025, 08:02:46 AM
198.179.6.200:30634
Yotematoi
May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery."
-Unh0ly-
April 20, 2025, 09:52:16 AM
https://drive.google.com/file/d/1hKRIIKPk_G9TLPpY3B4ZIbVK_00Mbwfw/view?usp=sharing
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
July 03, 2025, 09:08:13 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search