- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Why not IDontKnow?
Admin
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.
Admin
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!
Admin
The infinite recursion, you mean? ;)
Admin
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 ..
Admin
complement
xlnkovnvmg
Admin
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."
Admin
No, its implementation is:
return !((foo < bar) && (bar < foo));
Der.
Admin
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.
Admin
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"
Admin
That would be retraction (as with a post)
Admin
What would your mother say?
Sincerely,
Gene Wirchenko
Admin
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)...
Admin
This is nitpicking, but shouldn't that be
I.canLie = false;
otherBrothers.canDeny = false;
It seems like those are properties.
Admin
It really goes to show you that just because you can, doesn't mean you should.
Admin
Admin
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?
Admin
"You're looking mighy acute today"
Shamelessly stolen from bash.org :)
Admin
I think they're just quoting what their CAPTCHA code was, because they think it's funny, appropriate, or ironic.
Admin
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.
Admin
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.
Admin
<font color="#000000" face="Verdana" size="2">This must be just Apple, making their mark on programming:
iPod, iTrip, iRiver, and now iObject ;)
</font>
Admin
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.
Admin
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
Admin
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 :)
Admin
Any self-respecting Java compiler would probably be confused, too, if you threw C# syntax at it...
Admin
It's summer, they just don't work that much now.
@ wtf:
wtf?
Admin
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/
Admin
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...
Admin
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???
Admin
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 :)
Admin
Forgot to remind you all to see the Equal that this Object implements.
Admin
But then I might actually have to be productive - and on a Friday, no less!
Admin
<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>
Admin
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.
Admin
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?
Admin
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.
Admin
"Craptastic"
Admin
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.
Admin
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
Admin
So what's the Zeroth law?
Admin
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 :-)
Admin
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:
Admin
<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>Admin
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 :-).