|
True words, OOP ain't worth it!*
*Says the person who uses C#, Java and C++ only.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
That means that there's a collission if I find another God-object after the interview.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There can be only one.
Jeremy Falcon
|
|
|
|
|
Polymorphism: the ability to take on the shape of any person, big or small.
Inheritance: the money I got when great aunt Matilda popped her clogs.
Encapsulation: covering oneself in peanut butter and nutella to hide from the boss.
Abstraction: sorry, I wasn't listening to your inane questions...
|
|
|
|
|
R. Giskard Reventlov wrote: Abstraction: sorry, I wasn't listening to your inane questions... Niiiiiice
Jeremy Falcon
|
|
|
|
|
What about open recursion?
My teacher always had five 'pillars' for his OO; definitions simply vary, and wikipedia can not have the last word.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Your teacher favored a fifth? It shows.
|
|
|
|
|
Tx
|
|
|
|
|
Eddy Vluggen wrote: What about open recursion?
Didn't we already talk about that?
|
|
|
|
|
What? Did we discuss on .this or SO?
|
|
|
|
|
I'm not going to go over it again!
|
|
|
|
|
I might reply:
"Well, that depends on what you consider OOP is; are you referring to the concepts of C.A.R. Hoare, or to the work of Dahl and Nygarrd, or to the refinements proposed by Sutherland, or to Alan Kay, and the refinements of Kay's work by Goldberg et. al. ...
or, are you referring to the almost meaningless collage of associations and usages bandied about like a shuttlecock by the digerati of today ?" [^]
... of course, if you don't several hours to plumb that deeply, we could move on to the next question ...
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin
|
|
|
|
|
I like to use non-programming examples when describing abstract principles.
This is how I usually explain these three areas:
polymorphism
A vehicle can have one wheel, two wheels, three wheels or more. Passengers in a vehicle can also be encased in a shell or in the open.
Power steering assists the steering wheel so that the steering wheel behaves differently at high vehicle speed in contrast to slow vehicle speed.
inheritance
A car is a vehicle. By telling people that a car is a vehicle they will know that it is a form of transport.
encapsulation
I don't need to understand everything about how an engine works to drive a car. I just put my foot down on the accelerator pedal and I know that the car will accelerate.
[edit - corrected polymorphism analogy]
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 30-Jan-16 16:26pm.
|
|
|
|
|
That's a good idea. I like the last two examples especially.
Jeremy Falcon
|
|
|
|
|
Thanks - I find it helps me if I can associate abstract principles with things I understand at least a little bit about.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
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.
|
|
|
|