Madness this way lies...

Discussion in 'Ruby' started by John Carter, Aug 30, 2006.

  1. John Carter

    John Carter Guest

    Ah me. In a fit of over user friendliness I did a couple of
    the most colossally stupid things in a class.

    I, with head hung in shame, record them here so that...
    * others may avoid them,
    * I remember to avoid them later,
    * writers of obfusticated ruby may benefit.

    a) Name a method the same as something in the Kernel module and then
    forget that you have done so.

    In particular I overrode "puts" in something that didn't inherit from
    IO. OUCH! That really does make printing debugging statements
    interesting.

    b) Put various key Ruby terms (eg. "raise") in alias statements.

    c) Do two or more of these very very dumb things in the same body of code.




    John Carter Phone : (64)(3) 358 6639
    Tait Electronics Fax : (64)(3) 359 4632
    PO Box 1645 Christchurch Email :
    New Zealand

    "We have more to fear from
    The Bungling of the Incompetent
    Than from the Machinations of the Wicked." (source unknown)
     
    John Carter, Aug 30, 2006
    #1
    1. Advertising

  2. John Carter

    Hal Fulton Guest

    John Carter wrote:
    > Ah me. In a fit of over user friendliness I did a couple of the most
    > colossally stupid things in a class.


    [snip]

    But aren't you glad you *can* do these things... ;)


    Hal
     
    Hal Fulton, Aug 30, 2006
    #2
    1. Advertising

  3. Hal Fulton wrote:
    > John Carter wrote:
    >> Ah me. In a fit of over user friendliness I did a couple of the most
    >> colossally stupid things in a class.

    >
    > [snip]
    >
    > But aren't you glad you *can* do these things... ;)
    >
    >
    > Hal


    But then there is the punishment...

    100.times {puts "I will not do colossally stupid things in a class."}

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
     
    Joel VanderWerf, Aug 30, 2006
    #3
  4. Joel VanderWerf wrote:
    > Hal Fulton wrote:
    >> John Carter wrote:
    >>> Ah me. In a fit of over user friendliness I did a couple of the most
    >>> colossally stupid things in a class.

    >>
    >> [snip]
    >>
    >> But aren't you glad you *can* do these things... ;)
    >>
    >>
    >> Hal

    >
    > But then there is the punishment...
    >
    > 100.times {puts "I will not do colossally stupid things in a class."}
    >

    But ... but ... but ... you *redefined* "puts"

    :)
     
    M. Edward (Ed) Borasky, Aug 30, 2006
    #4
  5. On 8/30/06, Robert Dober <> wrote:
    > On 8/30/06, John Carter <> wrote:
    > >
    > > Ah me. In a fit of over user friendliness I did a couple of
    > > the most colossally stupid things in a class.
    > >
    > > I, with head hung in shame, record them here so that...
    > > * others may avoid them,
    > > * I remember to avoid them later,
    > > * writers of obfusticated ruby may benefit.
    > >
    > > a) Name a method the same as something in the Kernel module and then
    > > forget that you have done so.
    > >
    > > In particular I overrode "puts" in something that didn't inherit from
    > > IO. OUCH! That really does make printing debugging statements
    > > interesting.
    > >
    > > b) Put various key Ruby terms (eg. "raise") in alias statements.
    > >
    > > c) Do two or more of these very very dumb things in the same body of code.

    >
    >
    > This is a chellange, I am sure I can do better or was it worse?


    This reminds me of the cartoons which are sprinked throughout
    "Smalltalk-80: Bits of History, Words of Advice." No doubt long out
    of print.

    Some of these were

    A black frame with a cartoon word bubble saying "OOPS! I just typed
    'Processor <- nil.'!"

    A plane with the right wing coming off and flames coming out, and the
    pilot saying "I think we'd better boot and resume!"

    A woman painting a floor with a paint labled "New System" she's
    painted herself into a small corner labled "Old System" then she steps
    out of the corner, paints it and says "The nice thing about Smalltalk
    is that the paint dries instantly!"

    And my favorite, a series of pictures on the left word balloons on the right:

    "Here we go!"
    3+4
    FLASH "Oh...too bad"
    later
    "Once more!"
    3+4

    DzzDD,,
    Geep
    Z,4hcn
    "Hmmmmm"
    later
    "This out to be better!"
    3+4

    LAD Compiler doe
    not understand => ^h,,3ep

    "Well now!..."
    later
    3+4
    Class text image
    "Oh, I think I know what that is..."
    later
    3+4
    9
    "All Right!
    Hey everybody, Smalltalk works!"
    --
    Rick DeNatale

    My blog on Ruby
    http://talklikeaduck.denhaven2.com/
     
    Rick DeNatale, Aug 30, 2006
    #5
  6. You're probably right about it being out of print, but you can
    download a PDF from the following URL. The scan is a bit fuzzy but
    it's fairly readable.

    <http://www.iam.unibe.ch/~ducasse/FreeBooks/BitsOfHistory/>

    Regards, Morton

    On Aug 30, 2006, at 11:20 AM, Rick DeNatale wrote:

    > This reminds me of the cartoons which are sprinked throughout
    > "Smalltalk-80: Bits of History, Words of Advice." No doubt long out
    > of print.
     
    Morton Goldberg, Aug 30, 2006
    #6
  7. John Carter

    John Johnson Guest

    On Wed, 30 Aug 2006 16:00:20 -0400, Morton Goldberg =

    <> wrote:

    > You're probably right about it being out of print, but you can downloa=

    d =

    > a PDF from the following URL. The scan is a bit fuzzy but it's fairly =

    =

    > readable.
    >
    > <http://www.iam.unibe.ch/~ducasse/FreeBooks/BitsOfHistory/>


    Cool! Thanks. Used on Amazon start at US$41.66!

    I still think Ruby would be great in the Smalltalk environment.
    Squeak + Ruby =3D Reek ?

    Maybe I'll get around to writing it myself one day. Better do a Google =

    first :)

    As far as redefining, I seem to have a penchant for doing that with 'typ=
    e'.

    Regards,
    JJ

    -- =

    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
     
    John Johnson, Aug 31, 2006
    #7
  8. John Carter

    Chad Perrin Guest

    On Thu, Aug 31, 2006 at 08:38:46PM +0900, John Johnson wrote:
    >
    > I still think Ruby would be great in the Smalltalk environment.
    > Squeak + Ruby = Reek ?


    Scooby?

    --
    CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
    This sig for rent: a Signify v1.14 production from http://www.debian.org/
     
    Chad Perrin, Aug 31, 2006
    #8
  9. John Carter

    Eric Hodel Guest

    On Aug 29, 2006, at 8:23 PM, John Carter wrote:

    > Ah me. In a fit of over user friendliness I did a couple of the
    > most colossally stupid things in a class.
    >
    > I, with head hung in shame, record them here so that...
    > * others may avoid them,
    > * I remember to avoid them later,
    > * writers of obfusticated ruby may benefit.
    >
    > a) Name a method the same as something in the Kernel module and then
    > forget that you have done so.
    >
    > In particular I overrode "puts" in something that didn't inherit
    > from
    > IO. OUCH! That really does make printing debugging statements
    > interesting.


    Actually, I love to do this for tests, especially when I use open-uri.

    http://blog.segment7.net/articles/2005/11/20/open-uri-makes-tests-easy

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
     
    Eric Hodel, Aug 31, 2006
    #9
  10. Chad Perrin wrote:
    > On Thu, Aug 31, 2006 at 08:38:46PM +0900, John Johnson wrote:
    >> I still think Ruby would be great in the Smalltalk environment.
    >> Squeak + Ruby = Reek ?

    >
    > Scooby?
    >


    Can anyone recommend a good neurone peeling brand? I need a brainscrub.

    David Vallner
     
    David Vallner, Sep 1, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bailo
    Replies:
    1
    Views:
    452
    Andrew Thompson
    Nov 7, 2004
  2. Replies:
    0
    Views:
    346
  3. projecktzero

    lies about OOP

    projecktzero, Dec 14, 2004, in forum: Python
    Replies:
    80
    Views:
    1,868
    Christos TZOTZIOY Georgiou
    Dec 31, 2004
  4. Ben O'Steen
    Replies:
    2
    Views:
    302
    Paul McGuire
    Oct 28, 2005
  5. Marius Horak

    Madness, I call it madness

    Marius Horak, Jun 4, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    161
    Raterus
    Jun 4, 2004
Loading...

Share This Page