- 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
Were I on this project, I too would object.
Admin
'abstract' .. no pun intended.
Admin
And I think everything should be wrapped in a 'code' object too ... just to make it scalable and enterprisey
Admin
So the base class of *all* objects itself implements some sort of interface, named in true honor of hungarian notation with an "I" prefix and obviously only created to be implemented by exactly one class.
Did I miss anything else?
Admin
Hungarian notation? What does I stand for then?
This looks more like Asimovian notation for me :)
Admin
so todays WTF is that the class doesn't have a closing brace? Wow, debugging is easy!
Admin
I'm dying to know what methods that interface exposes.
Admin
Interface?
PS: captcha is 'craptastic' ;]
Admin
Admin
Probably something like GetType();
Admin
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.
Admin
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
Admin
what language is this?
isn't IObject going to be private?
what methods can be called thru Object to IObject ?
...
I dont know, is it private or not?
lol Captcha truthiness
.. lol that is a wtf
Admin
VB sucks... so does today's WTF
Admin
It's C#. The colon gives it away.
Captcha = enterprisey
Admin
I'll leave it as an exercise for the reader to point out that Alex may be getting repetetive. :)
Admin
That's what my proctologist said my problem was.
Admin
With such an enterprisey object-oriented paradigm, that's easy:
public abstract class I2Object : IObject {}
See? Infinitely scalable!
Admin
Wow, two days in a row of reader exercises. Maybe Alex thinks we are all getting too fat.
I think I would really like to see what is in the curly braces before I could pass judgement on the WTFness of this though.
Admin
Ok, I will tell you whats inside, this is as far as I can leak because of NDA issues.
<font color="#0000ff">public override bool Equals(object item)
{return Equals(this, item);}
</font>Its not a joke by the way.
Admin
This code (including the additional <FONT color=#0000ff>bool</FONT>) is pointless.
There has been much discussion on TheDailyWTF about code that can write itself.
This appears to be one step better: code that does not even need to be written !!
Admin
If IObject were a system-supplied base class, then inheriting from it to make an application-wide base class might make sense.
Admin
If it's C#, then there already IS an 'object' class, that what makes it extra WTF-ish.
also see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemobjectmemberstopic.asp
Admin
Isn't IObject a COM thing?
Admin
That deserves a drum roll....ba dum dum psssssshhhhh!
Admin
doooh, that's class'y :P
Admin
Admin
Maybe they needed to do reference counting. ;)
Admin
<sigh> hard to get worked up over one line of code...
Admin
Admin
The only WTF here is that the Object class is public.
Admin
That's not a drum roll, that's a .... oh, wait. Now I get it.
Admin
A wonderfully derivitive homage. My complements!
Admin
The first rule of IObject is to never talk about IObject. The second rule of IObject is to never talk about IObject.
Admin
Best... Post.. Ever..
Admin
Frankly, I fail to see the WTF here. Obviously, this Object class is pointless (and should have an additional isAWeeBitBrillant() method), but harmless.
If there's no real WTF to post on a given day, don't make one up...
Admin
I'd have to say that you've outdone yourself with the title of this WTF.
Admin
How do you complement? :)
Admin
Except that's a rimshot... were you being deliberately ironic? My head hurts..
Admin
Surely the WTF is that while everyone occasionally and inadvertently puts in something pointless in the rush to meet a deadline, this application appears to have been deliberately started, on programming day one, with something pointless.
(It may not literally have gone that way, but that's the impression it gives.)
Admin
<FONT face=Georgia>I would love to see a little bit more of that code. What were they thinking? Were they even thinking?</FONT>
Admin
In this case: with threes-complement.
Admin
Mostly harmless, you mean.
Now it's time to create your custom IObjectWrapper interface.
Admin
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.
Admin
<FONT face=Verdana size=2>They were **obviously** re-creating the most fundamental of all types in .NET:</FONT>
<FONT face=Verdana size=2>from the .NET Framework documentation..."Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy."</FONT>
<FONT face=Verdana size=2>And on top of that they created a public interface, namely IObject, from which to implement. Hmm....that's brillant!!!</FONT>
<FONT face=Verdana size=2>--Thiago</FONT>
Admin
Some people are asking where the wtf is?
Ok:
this is c#, isn't it.
c# has object (or Object)
This "Object" now has to be disambiguated from System.Object through it's namespace: nice.
This "Object" can't be instantiated: you have to implement something that does any real work, fair enough: you are required to pick up the baggage of the IObject interface and implement, whatever that may be, and no matter how irrelevant or inconvenient: nice.
.NET has alwayss had extensive support for smarter ways of handling global requirements for application objects with automatically discoverable information : attributes, databinding and reflection to name a few. Just as an aside, see IComparable in .NET for giggles related to a higher post. So, the wheel re-invented in what looks suspiciously like the output of a ham-fisted Java programmer: Nice.
There are going to have to be some base classes that will attempt to implement IObject correctly, to avoid similar code being cut and pasted 100s of times. This code of course, must be able to cater for any circumstance subclasses may throw at it, presumably through aggregating IOuijaBoard: nice.
I don't need to go on.
I've run out of circusmtances where this approach willl help, unless we are consider the boost to the career of a technical architect besotted with the idea of code-generating the world, and letting the developers pick up the pieces.
Admin
Great!
Admin
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.
Admin
Close, all COM objects are required to at least implement IUnknown, which contains methods for getting other interfaces
Admin
If twos-complement is for subtraction, what is threes-complement for? detraction?