• Vytzka (unregistered) in reply to Teis Johansen
    Anonymous:

    Close, all COM objects are required to at least implement IUnknown, which contains methods for getting other interfaces



    Why not IDontKnow?
  • Johannes (unregistered) in reply to Marcelo
    Marcelo:

    <font color="#0000ff">public override bool Equals(object item)
            {return Equals(this, item);}</font>


    Is that Object.Equals(object, object)? Which is implemented as (in super-compactness):

    <font color="#0000ff"><font face="Courier New">public static bool Equals(object foo, object bar) {
      return (foo == bar) || (foo != null && foo.equals(bar));
    }</font>
    </font>
    That's.... very special.
  • (cs) in reply to Ann Coulter
    Anonymous:
    OneFactor:

    Anonymous:
    Hungarian notation? What does I stand for then?

    This looks more like Asimovian notation for me :)

    The three rules of IObject-ics

    1. An Object may not disinherit an IObject, or, through indirection allow a subclass to disinherit an IObject
    2. An Object must extend the interface given to it by an IObject, except where such extension would conflict with the First Law
    3. An Object must implement its own interface, as long as such implementation does not conflict with the First or Second Law



    The first rule of IObject is to never talk about IObject. The second rule of IObject is to never talk about IObject.


    rule #1: No IObjects!
    rule #2: No member of the facilty is to malcode the IObjects in any way - if there is anybody watching!
    rule #3: No IObjects!
    rule #4: Alright, and this term I don't want to catch anyone not inheriting!
    rule #5: No IObjects!
    rule #6: There is no ... rule #6!
    rule #7: No IObjects!
  • Vytzka (unregistered) in reply to Johannes
    Anonymous:
    Marcelo:

    <font color="#0000ff">public override bool Equals(object item)
            {return Equals(this, item);}</font>


    Is that Object.Equals(object, object)? Which is implemented as (in super-compactness):

    <font color="#0000ff"><font face="Courier New">public static bool Equals(object foo, object bar) {
      return (foo == bar) || (foo != null && foo.equals(bar));
    }</font>
    </font>
    That's.... very special.


    The infinite recursion, you mean? ;)
  • Peter Schaefer (unregistered)

    Actually, there might be uses for this:

    Imagine that you had an experimental addition of features to Object.
    You would simply ask all users of the new features to cast their objects to the IObject interface before using the new features.

    Not a very safe way, but maybe useful if your codebase loaded classes at run-time, so that you would prefer to find the users of the IObject Interface by a textual search.

    You could also move the IObject interface to a subclass lets say IObjectAdapter, after which you could attach to the Object class the next versions of the IObject interface, hopefully named IIObject, IIIObject, IVObject, VObject, VIObject and VIIObject.

    Now, that would be a WTF ..

  • (cs) in reply to Jonathan Thompson
    Anonymous:
    marvin_rabbit:
    OneFactor:

    Anonymous:
    Hungarian notation? What does I stand for then?

    This looks more like Asimovian notation for me :)

    The three rules of IObject-ics

    1. An Object may not disinherit an IObject, or, through indirection allow a subclass to disinherit an IObject
    2. An Object must extend the interface given to it by an IObject, except where such extension would conflict with the First Law
    3. An Object must implement its own interface, as long as such implementation does not conflict with the First or Second Law


    A wonderfully derivitive homage.  My complements!

    How do you complement? :)

    complement

    xlnkovnvmg

  • Stoffel (unregistered) in reply to GoatCheez
    GoatCheez:
    Anonymous:

    I'm dying to know what methods that interface exposes.


    Probably something like GetType();


    This gets my vote for the best post.

    I forget where I read (Meyers? Lakos?) about a consultant company brought in to design a new software architecture, and they had a room with all their class and inheritance charts all over the whiteboards, and every single class inherited from "Object" with the public member "type".  The author walked in, saw this, and said, "My god, you have no idea what you're doing."
  • Stoffel (unregistered) in reply to Johannes
    Anonymous:
    Marcelo:

    <font color="#0000ff">public override bool Equals(object item)
            {return Equals(this, item);}</font>


    Is that Object.Equals(object, object)? Which is implemented as (in super-compactness):

    <font color="#0000ff"><font face="Courier New">public static bool Equals(object foo, object bar) {
      return (foo == bar) || (foo != null && foo.equals(bar));
    }</font>
    </font>
    That's.... very special.


    No, its implementation is:
      return !((foo < bar) && (bar < foo));

    Der.
  • (cs)

    Not a lot of good system architechs about I see.

    Interfaces have inheritance just like objects, this gives a solid root that allows access to the whole object tree through either class or interface references.  It might be extra work, but sometimes you might need access through one instead of the other.  You can either apply it to 3 classes that you need today and have to hunt to change the others as you need (if the app is that large, that sounds very bad), OR you could just make sure it is all consistant from the start.

    I've noticed that most people are just to damn lazy to do it right and dispariage those that go to the extra effort.

  • SwordfishBob (unregistered) in reply to Stoffel
    Anonymous:
    Anonymous:
    Marcelo:

    <font color="#0000ff">public override bool Equals(object item)
            {return Equals(this, item);}</font>


    Is that Object.Equals(object, object)? Which is implemented as (in super-compactness):

    <font color="#0000ff"><font face="Courier New">public static bool Equals(object foo, object bar) {
      return (foo == bar) || (foo != null && foo.equals(bar));
    }</font>
    </font>
    That's.... very special.


    No, its implementation is:
      return !((foo < bar) && (bar < foo));

    Der.

    that would be: return true;


    On the original post, a bit dull technically, but inspired some great humour..

    Oh, and the captch test wants me to prove I am not a Robot. Perhaps it should say "Prove you are not a derived object"

  • (cs) in reply to OneFactor
    OneFactor:
    Anonymous:
    Anonymous:

    How do you complement? :)

    In this case: with threes-complement.

    If twos-complement is for subtraction, what is threes-complement for? detraction?

    That would be retraction (as with a post)

  • (cs) in reply to SwordfishBob
    Anonymous:
    On the original post, a bit dull technically, but inspired some great humour..

    Oh, and the captch test wants me to prove I am not a Robot. Perhaps it should say "Prove you are not a derived object"



    What would your mother say?

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Gene Wirchenko
    Richard Nixon:
    Gene Wirchenko:
    Anonymous:
    On the original post, a bit dull technically, but inspired some great humour..

    Oh, and the captch test wants me to prove I am not a Robot. Perhaps it should say "Prove you are not a derived object"



    What would your mother say?

    Sincerely,

    Gene Wirchenko



    Completely off-topic and inappropriate. Considering this post and your moderation history, it's quite clear that not only are you a poor moderator, you also contribute nothing of value to the forum. It's pathetic how you go around stroking your own ego all the time.

    sincerely,
    Richard Nixon


    gets out marshmellows and weenies

    whooo hooo, the start of a flame war.  I'm so excited.

    Edit:
    Acctually, sorry to side with Gene but... I think he just means that Anonymous is a derived object from Anonymous's mother (and presumably father)...


  • Gnictigezoink (unregistered) in reply to TankerJoe

    This is nitpicking, but shouldn't that be

    I.canLie = false;
    otherBrothers.canDeny = false;

    It seems like those are properties.

  • bah (unregistered) in reply to Marcelo

    It really goes to show you that just because you can, doesn't mean you should.

  • Konrad (unregistered)
    Alex Papadimoulis:

    Every once in a while, I like to present a representative line of code from a titanic (an adjective chosen for more than its synonymity with "frickin' huge") application. That's right -- hundreds of codefiles with thousands of classes with hundreds of thousands of lines of code -- all into one, single line. Today's line comes from an application whose team Marcelo recently joined, and is the from the definition of the base class for all objects in their system ...

    <FONT color=#000080>public abstract class</FONT> Object : IObject {

    I'll leave it as an exercise for the reader to try to imagine how well things took off from here.

     
    No on a scale of 1 to 10
    1 being strange but ocationally usefull
    10 being WTF  I don't know wether to laugh of cry
     
    theis scores about a 2. my reaction is ok that seemed pointless but there just
    isn't enough meat here. Where's the ridiculusly long if elseif block which checks
    the type of the object wheres the hand rolled reimplementation of quick sort
    where is the XML  and Why is IObject just an ordinery interface shouldn't it be a
    a SOAP proxy ?
     
    the Real WTF ... is an excersie for the reader
  • (cs) in reply to Anon

    Completely off topic, but what does captcha mean when you all say it? I thought captcha meant an image or something used to tell a human from a robot on a website?

  • WhiskerTheMad (unregistered) in reply to Jonathan Thompson

    "You're looking mighy acute today"

    Shamelessly stolen from bash.org :)

  • (cs) in reply to jesirose
    jesirose:
    Completely off topic, but what does captcha mean when you all say it? I thought captcha meant an image or something used to tell a human from a robot on a website?


    I think they're just quoting what their CAPTCHA code was, because they think it's funny, appropriate, or ironic.
  • error (unregistered)

    I'm not ready to call this a true WTF without more information.  It's possible that for some reason they needed to differentiate objects defined within their system from other objects. By deriving all objects in their application from this object class then they are able to test any object to determine if it is theirs or someone else's.  They may have wanted each derived object to force an implementation of whatever IObject does without labriously adding the interface to each class.

    Without knowing what the rest of the code is like and the problems they're trying to solve, you cannot be sure this is a WTF. I would agree their naming choice is poor.

  • Nomen Nescio (unregistered) in reply to jesirose

    Apparently some people find it humorous to comment on which image (CAPTCHA) is shown when they post. And some people are apparently baiting them by putting in Brillant captcha strings to prove they aren't a robot.

    This is not a registered user account. I type this name in every time, by hand.

  • sql_lall (unregistered) in reply to Xepol

    <font color="#000000" face="Verdana" size="2">This must be just Apple, making their mark on programming:
    iPod, iTrip, iRiver, and now iObject ;)
    </font>

  • yagni (unregistered) in reply to Xepol

    Not a lot of good system architechs about I see.

    Interfaces have inheritance just like objects, this gives a solid root that allows access to the whole object tree through either class or interface references.  It might be extra work, but sometimes you might need access through one instead of the other.  You can either apply it to 3 classes that you need today and have to hunt to change the others as you need (if the app is that large, that sounds very bad), OR you could just make sure it is all consistant from the start.

    I've noticed that most people are just to damn lazy to do it right and dispariage those that go to the extra effort.

    I tried to find the humor in your post, but failed, so I would assume that you are one of those system architects that failed your basic economics course.

    Basically, you advocate taking out an insurance against possible later needs, which means you want to pay more now in order to pay less later. However, that only makes sense when you have a lot of people sharing the cost of the insurance. In a private system you have to bear your own insurance costs, which is always more expensive than just bearing the cost if the event occurs. You need to pay interest on the insurance premium in the form of more expensive coding all through the project, which really explodes when something happens that you didn't insure against.

    So, yes, it may make sense to do it, but only if you already know that you are going to need it.

    				</div>
    
  • Fake Coworker. (unregistered) in reply to jesirose
    jesirose:
    Completely off topic, but what does captcha mean when you all say it? I thought captcha meant an image or something used to tell a human from a robot on a website?


    Theres 3 reasons, pick 2:

     - The real WTF is the forum software. Actual version is much better, but its still dificult to login, and continue loged. Jokes abour the forum software are posible. Captcha is one.
     - The server refuse to post a message because he already know it. So you repost is with a minor change. Maybe copypasting the captcha. This reason can be fake.
    - Its a tradition. And as all traditions, is a nonsense you repeat on a nonsensicall way.

    And It provens you have a broken humour sense, slashdot style, community maker way. You sould read books from the filosopher Jose Luis Lopez-Aranguren.

    --Tei
  • disappointed (unregistered)

    Now this wtf is really poor. Are people becoming smarter these days?
    I like the name titanic though. Like a software that is supposed to be the best ever, and then it sinks in the sea. Not that I would call an app of hundreds of files a giant one. How about an app that had 2000+ java files (no, they weren't fine-grained, they were huge, 10000+ lines sometimes) and 500+ jsp-s? It wasn't fun, definitely a titanic. I used to feel tempted to post some of it :)

  • I Object to Colon Syntax (unregistered) in reply to squirrel

    Anonymous:
    Wait, is Object *extending* or implementing IObject? The colon syntax confuses me. Obviously I was thinking IObject is an interface so it must implement. That'd be an extra and completely pointless dependency, betraying a lack of understanding of the point of polymorphism. Yet, extending the IObject class would be poetic for a WTF - rich in its construction, with a completely ambiguous obtuse meaning. I hope it's extending. Then the code is deliciously special.

    Any self-respecting Java compiler would probably be confused, too, if you threw C# syntax at it...

  • anony (unregistered) in reply to disappointed
    Anonymous:
    Are people becoming smarter these days?

    It's summer, they just don't work that much now.



    @ wtf:
    wtf?
  • Marmaliser (unregistered) in reply to crazyPhil
    Anonymous:
    Anonymous:

    Some people are asking where the wtf is?

    Ok:

    this is c#, isn't it.

    c# has object (or Object)

    (etc.)



    That's assuming that anybody is actually using (or being forced to use) this base class, which we don't know. Also it's assuming that the IObject interface is not empty, which we don't know. We can *imagine* a lot of bad things that *could* be in the system in question, but as somebody else said - it's hard to get worked up over this one line of code. To me, this still looks like a very contrived WTF.

    quoting the post

    Today's line comes from an application whose team Marcelo recently joined, and is the from the definition of the base class for all objects in their system ...

    [my italics]

    Where's the contrivance?

    This looks like a classic WTF to my mind: I think it's an example of

    "I am the world"

    http://www.megat.co.uk/wrong/

     

  • Tom (unregistered) in reply to Marmaliser

    The real WTF is that their Object (that implements? IObject) already derives from the System.Object class that is an implicit parent of all objects in .NET world...

  • Tbee (unregistered) in reply to JoeBloggs

    Anonymous:
    If IObject were a system-supplied base class, then inheriting from it to make an application-wide base class might make sense.

     

    Ah. So I'm not the only one who doesn't quite see the problem. Maybe this is a BM base class and was intended to hold default post-or-pre persistence event handling. If it doesn't contain anything else, it could / should be refactored out. So before judging: what other methods are in there???

  • Marcelo (unregistered)

        Ok,let add a few word:

     - First, this is the base classe for all objects in the system, and does pretty much nothing other than be inherited by all objects just in case the enterprise decides that all objects must now implement a new function that makes .Equal behave diferently or some other stupid functionally which may somehow be apropriate for both "EnterpriseNamespace.BaseWebForm", "EnterpriseNamespace.BaseWindowsForm" and "EnterpriseNamespace.FileReader", since both inherit this Object.

     - There is a object and Object(sort of an alias) on .net/C#.

    so if you look at this code:

    <font color="#0000ff">    Object myobject = new Object();</font>

    you have no idea of what Object are we talking about.   


     - C# is case sensitive. So why not party at it.

    The following is "Compilable", and since its perfectly acceptable to use Object as

    an class name, we might as well:

     <font color="#0000ff">   public class If {}
        public class Null {}
        public class INT32 {}
        public class FLOAT {}

        INT32 balance = new INT32();</font>


    I guess the real WTF is that the guy that wrote the unhappy Object and IObject wasn't alone in believing Object is a perfectly sound name :)
       

  • Marcelo (unregistered) in reply to Marcelo

        Forgot to remind you all to see the Equal that this Object implements.

  • dave (unregistered) in reply to biziclop
    biziclop:


    Every lesson teaching the basics of coding and design should start with the most important rule. Namely, that before acting always ask yourself one question: "Do I really need this thing? Am I the first one to bump into this or that problem?"

    And this website could probably close down.


    But then I might actually have to be productive - and on a Friday, no less!
  • (cs)

    Alex Papadimoulis:
    <FONT color=#000080>public abstract class</FONT> Object : IObject {

    <FONT style="BACKGROUND-COLOR: #7fffd4" face=Tahoma color=#a52a2a size=2>NO WTF HERE!!! This makes sense to use an interface so you don't have to call any Object class directly (Or is that a Class object?).  That way, you'll be able to easily replace Object with some other thing that isn't an object and doesn't yet exist in this universe to effectively describe.  All of your code will still work because you were smart - you coded everything to use the IObject interface.  Brillant!</FONT>

  • Reed (unregistered)

    I've worked with libraries that used an Interface/Implementation policy. But the Implementation class didn't inherit from the Interface class. Instead, if an Implementation had an Interface, then the Interface object had a pointer to the Implementation object.  And sometimes there were wrapper objects.

    So sometimes you called  Interface->Method().  Sometimes you called Interface->GetImplementation()->Method().  Sometimes you called Wrapper->Method().  Sometimes you called Wrapper->GetObject()->Method().  Sometimes you called Wrapper->GetObject->GetImplementaiton()->Method().  Sometimes you don't have the wrapper so you have to call Object->GetWrapper()->Method().

    Figuring out what method to be called usually required about 10 minutes in the documentation, before writing one line of code.

  • (cs)

    We called messy procedural code "spaghetti code".

    What do we call messy OOP code?

    For messy PHP Object Oriented Programming we have POOP.

    What about the rest?

  • (cs) in reply to jo42
    jo42:

    We called messy procedural code "spaghetti code".

    What do we call messy OOP code?



    Depends on which kind of mess it is.
    For example, it could be "spaghetti code" as well.
    It could be a "blob" aka "god object" if most actual code is in the methods of one class and other classes (if they exist at all) are just structural without noteworthy methods.
    It could be "functional decomposition" if the class model looks like the modules of structured code; i.e. classes represent some kind of processes.
    (the "createCustomer" class, the "orderEntry" class etc.)
    If you want to know more about it, look for "antipatterns", there are whole books written about that topic.
  • Gnictigezoink (unregistered) in reply to jo42
    jo42:

    We called messy procedural code "spaghetti code".

    What do we call messy OOP code?

    For messy PHP Object Oriented Programming we have POOP.

    What about the rest?



    "Craptastic"
  • Anonymous GIS User (unregistered)

    I think I know where they got this:

    http://edndoc.esri.com/arcobjects/9.1/default.asp?url=/arcobjects/9.1/ComponentHelp/esriGeoDatabase/IObject.htm

    This is a COM architecture with a .NET API.  I don't believe COM has an Object base class, so they had to make their own.


  • Haresh Kumarski (unregistered) in reply to Gnictigezoink
    Anonymous:
    jo42:

    We called messy procedural code "spaghetti code".

    What do we call messy OOP code?

    For messy PHP Object Oriented Programming we have POOP.

    What about the rest?



    "Craptastic"


    What about Craptain Captastic and his filmy erectile bunch?

    -----
    After a while we got up
    And started a hunt for the harvest land
    I felt rather like a berserk pup

  • GBroderick (unregistered) in reply to OneFactor

        So what's the Zeroth law?

  • Roger (unregistered)

    Ok I'll have a shot at defending this ;-)

    Lets say that you build a game , and in this game there are "objects" as in physical objects not as in system.object objects..

    now lets assume that this game has a "world" it would be quite neat to be able to add "objects" to it.
    but lets also assume that incase you for some strange reason have to add an object that needs to inherit some other baseclass (not from Object ot decendants) , you could let your world class accept IObjects

    that must be it :-)

  • Rydian Morrison (unregistered) in reply to OneFactor

    The real WTF is people arguing over what the REAL WTF is when the guy that always posts the WTFs on this site made for WTFs posted it as a WTF. ):

    Oh god. On the subject of Captcha, mine was Foxtrot. My little brother hasn't stopped listening to that one song by The bloodhound gang, "Foxtrot, uniform, charlie, kilo", in like three months. Always playing it on some loud speakers. And of course not knowing what the song's about. D:

  • (cs) in reply to Roger

    <FONT face=Tahoma size=2>shouldn't it be virtual - then they could stop everyone from using it?
    </FONT>

    <FONT face=Tahoma size=2></FONT> 

    <FONT face=Tahoma size=2></FONT> 

    <FONT face=Tahoma size=2>;)

    </FONT>
  • Keybounce (unregistered) in reply to jo42
    jo42:
    We called messy procedural code "spaghetti code". What do we call messy OOP code? For messy PHP Object Oriented Programming we have POOP. What about the rest?

    Bumpity. (Does this site have a "by comment date" view somewhere?)

    Object Oriented Programming Spaghetti should be called "OOPS".

    Captcha: Why not "Recaptcha"? Turn us all into proofreading robots :-).

Leave a comment on “I, Object”

Log In or post as a guest

Replying to comment #:

« Return to Article