|
Sounds good, but I think you meant method overriding (override default behavior with behavior specific to a derived class) and not overloading (provide an alternate signature for a method).
/ravi
|
|
|
|
|
I meant the latter. But both would provide an example of polymorphism in my book.
Jeremy Falcon
|
|
|
|
|
Infraction -- You're object has methods GoFast(byte speed) and GoFast(long speed)
Misdemeanor -- Your child looks like you, the parent, so it passes off your ID card to buy beer.
Felony -- The key that unlocks your 1960 VW also unlocks the neighbor's Porsche.
Marc
|
|
|
|
|
Strange, though I've been doing good OOP for over 25 years, this question stumped me, and induced a mild kind of panic. There are three aspects? Not four or five (I'm thinking SOLID here)? What are they? Who made the list? What if I name an aspect not on the approved list? That's a mean thing to do to someone on an interview.
A more neutral and less panic-inducing question might be "What are the important principles of Object Oriented Programming?"
|
|
|
|
|
All such programming revolves simply around adding a layer of abstraction.
Moving further away from the machine code, and into the business side or into objects,
is just a layer of abstraction.
The problem with OOP was simply this:
- It was SOLD to management as being more closely related to THEIR WORLD
- Programmers found it better to design Objects that made more sense to the SYSTEM
- We are left with something that makes nobody quite that happy!
So, I could tell you how it was supposed to go, but since we both know it never got there...
|
|
|
|
|
We started to write on stones.
Today we put a X in a checkbox and in real time in the other side of the world a package with something inside start ad some $ is subtracted from my virtual pocket.
I don't see any abtraction, polymorphism, inhertance, encapsulation in any direction that can connect the stone with the monitor and the write with the click.
After six times, a told story is completally changed.
The 80% of companies don't survive to the 2nd generation of the family management.
OOP is a something of psicologivally compliant that give us a pleasure as the visual interface.
But anybody can calculate that 10 fingers with 26 sysmbols are more efficient of a mouse and some widget.
Programming today prevents bugs thanks to better tools that give us syntax highl. and autocompletition. I don't see any OOP support in this.
On the contrary, the information hiding cancels dramatically the benefits of inheritance when I have to expand the level where communication uses messages (WM_PAINT & C) but do not know the mechanisms and even try to create a wrap that actually makes an anti-wrap base class.
The world is not of objects. The world is a structure of strucures where actions happen because there is because there is a potential difference between two structures, not because there is an intention, as if there were an abstract divine will.
And a dog (biologically speaking) is not an instance of Animal but of mammal, belonging to the animal kingdom.
s.z.
|
|
|
|
|
Should you shoot first and ask Christian Slater?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Why not shoot him too?
|
|
|
|
|
Can't argue with that!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
What did Christian Slater do to warrant that comment? Just curious.
|
|
|
|
|
I was being fecetious for gods sake.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
|
That one bowelled me over!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
This thread is a gas!
/ravi
|
|
|
|
|
This thread is being used as a stool for making more puns.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Yes, it seems to be moving well.
/ravi
|
|
|
|
|
That's good, you know I wouldn't want to get pooped.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Agreed. I think this thread needs more control - it seems too lax.
/ravi
|
|
|
|
|
I hope it doesn't take a turd for the worse.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
I fear the moderators are about to flush this thread.
/ravi
|
|
|
|
|
You're not going toilet that happen, are you?
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
He would never let them wipe this thread.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
|
I'm not dung yet.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|