- 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
Whoa... Guess I can give up all hopes of ever becoming a senior developer. I shall never achieve SUCH stupidity, that's for sure.
Admin
Do you think he was simply making a point that Inheritance as a programming tool becomes so confusing in a real world (IT) application as to be very dangerous?
Its fine with trivial animal examples of course, and I *always* use it for that sort of application:-)
Admin
I would report these people to one or more of
a) HR department, for removal
b) Owners and board of the company, for strategic reorganization
c) Public health authorities, for mandatory treatment
d) Their CS professors, for the shame value
Admin
A former VB programmer, I'll wager... should be taken outside and poked with sharp sticks
Admin
And for the next question....
Who can tell me the difference between inheritance and hierarchy?
...
Walkthrough? Walkthrough my ass...(not literally, of course).
Admin
Eek, these people are just getting worse and worse. Unrolled recursion; whatever next?
Admin
Damn. Remind me to never work with any of you folks.
(Seriously, because you'll kill me, eventually. I'll die laughing when you take someone outside and start jabbing sharpened sticks at them)
Admin
This had the whole office in stitches - not to mention the comments - why can we not have a fun WTF like this every day ... This process adds new meaning to parenting ....
Admin
WTF! The difference is RTFM, everybody knows [6]
Admin
Assuming you really want to know, a book about Object Oriented programming can give you the gory details. Here is the basic difference. Inheritance occurs when a class gets at least part of its definition from another class, called a base class. Hiearchy is the location of the class in the namespace and affects how you instantiate the class.
Admin
Loops are for wimps. What you need here is full-blow recursion.
Admin
Awesome. I have actually written "getGrandChildren" methods (lazy) but never "brother in law". [:P]
Admin
Huh? Recursion is easy. Converting a slow stack overflowing recursive method to a loop can be challenging.
Admin
I've written Uncle() and Sister() functions to travel a tree hierachy.
Several months later, I discovered recursion and reduced my script by 75%.
Admin
Well I guess that I would be the one being poked [:D] But my saving grace is I also know C, C++, C#, Java, Assembly, and Pascal. Damn, I get a head rush saying all that, way too many frickn years learning all that crap. That is why I use VB, it's simplicity is beautiful, but (ducks more sharp instruments) you can screw up just as bad in any language. It's the programmer not the language. [:P][:D]
Admin
This one is up there :-)
Is it even possible for Parent to be null?
Admin
True. However, some languages just promote irresponsible coding, by sheer virtue of being targetted at inexperienced "programmers", or adevertised as the cure for (overly) Rapid Application Development.
dZ.
Admin
Dammit! That should have been "... as a tool for ..."
dZ.
Admin
Sometimes I wonder about the code I see here, and if I was less experienced I might not believe someone actually wrote this.
We should introduce a 'Wall of Shame' and post this guy's data on it, preferably linked to his CV for easy future reference for potential employers. It would be a civil service. My God, the horror ! the Horror ![:#]
Admin
Heh, we could even write methods to XPath programatically (PrecedingSibling, AncestorOrSelf etc), and it would fit the context [:S]
Admin
<FONT size=2>What I find even more amusing is that nobody even mentioned the fact that this code won't compile anyway. The method signature indicates a bool return value. He obviously needs to be turned on to ReSharper; it wouldn't help his (advanced) design skills, but would ensure the code compiled.</FONT>
<FONT size=2>As an exercise for anyone with TMTOTH, I'd love to see the FxCop report on the assembly.</FONT>
Admin
I absolutely agree. RAD is not necessarily the best thing in all situations, I would rather have it work than have a zillion bugs to deal with. After a few late nighters I have written a few doozies in my day (blushes) but, I have caught them before going into production.
Admin
<FONT size=1>Drat! My copy/paste skills need a brush up. I see now that it does return a bool...</FONT>
Admin
Surely CrazyAuntYouOnlyMeetOnHolidays would be a property. GetKissFromCrazyAuntYouOnlyMeetOnHolidays would be a method.
Admin
That's only an issue with tree recursion. If your compiler doesn't do tail recursion on it's own, replace it. Even for C, there's no reason not to support at least some amount of TCO.
Admin
Whenever I hear someone describe VB as simple, it's is all I can do to keep from laughing myself silly. VB is only easy for trivial work; the language itself is a crawling horror. Even VB.Net, which cleans things up a lot, is still comparable to C++ and Ada for sheer complexity, and the fact that they keep changing it only makes things worse.
Algol 60 was simple. Scheme is simple. The original K&R C was simple, in certain ways (but a pain to work in). Python is simple. Visual Basic is far from simple.
Admin
It also works well with shapes, although I can never remember if a circle is a kind of ellipse or an ellipse is a kind of circle.
And I've heard that at Borland it is good for vehicles, with 2-doors, 4-doors, and hatchbacks being derived from ABCs (Abstract Base Cars).
Admin
I'm also bad at remembering things like that. I can never really remember if 2 is a special case of a number, of a number is a special case of 2 ;)
Admin
2nd "of" = "or"
Admin
No ASP.NET, just an obscure object model. 'base' was not to be seen anywhere in this system. This was not the only case, it actually was a lot worse, I mean worse. You should have seen the debugger when I tried to figure this out. Basically, you have a base class that every other class derives from. Instead of using a composite pattern or some other structural pattern in combination with a factory we have a model that looks like this
Base
Derived Derived Derived Derived Derived Derived Derived Derived Derived Derived Derived Derived
The entire system looks like this. Every object is a subclass of Base. That's it. Again, when I initially started debugging this it was a disaster.
Admin
Holy crap that's funny!
Admin
Admin
No he wouldn't be making such a point because (1) such a point is stupid, and (2) he was using a data hierarchy and not class inheritence. You can not point at inheritence as a programming tool and claim "it becomes so confusing in a real world application" because such a claim is ridiculously underqualified. You benefit from inheritence every damn day if you work with the .Net framework, and even Real World applications can benefit a great deal if the domain model includes IS_A relationships.
Seriously. If you're going to crusade against abstractions, at least point people at a concept high school students can't grasp.
Admin
Is there a threaded view of this forum or just the quoted quoted quote thing? Forgive my ignorance with this site but I cant find a threaded view and the "reply" button seems to just stick another message on the stack?
Admin
This is a forum style board, as opposed to the threaded reply that you're probably used to on Kuro5hin and Slashdot, so no, there are no threaded replies, since this whole discussion is a thread in itself.
Admin
TRTRWTF is a boolean function that doesn't return anything.