Next time you have an interview
-
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Beats me. I look this stuff up when we're getting ready to conduct interviews. It makes a good "i'm better than this guy" question. Then i forget it again.
Shog9 wrote:
It makes a good "i'm better than this guy" question.
LMAO I started a interview questions file years ago that I would print out and take into interviews to remember questions I considered telling of a persons experience. After I while I had to add hints to the answers to many of the questions in the file because I couldn't always remember them! :laugh::laugh:
led mike
-
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayEnnis Ray Lynch, Jr. wrote:
Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three
- Polymorphism 2) Polymorphism 3) Polymorphism 4) Polymorphism 5) Polymorphism 6) Polymorphism 7) Polymorphism 8) Polymorphism I'm serious. This is what's important to me. Polymorphism allows you to manage dependencies by hiding implementation behind interfaces. So you can vary implementation in one area without affecting another area. Books will mention encapsulation, inheritance, and whatever when describing OOP. But the most important concept is Poly. She's the gal you want to take to the dance.
-
Ennis Ray Lynch, Jr. wrote:
Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three
- Polymorphism 2) Polymorphism 3) Polymorphism 4) Polymorphism 5) Polymorphism 6) Polymorphism 7) Polymorphism 8) Polymorphism I'm serious. This is what's important to me. Polymorphism allows you to manage dependencies by hiding implementation behind interfaces. So you can vary implementation in one area without affecting another area. Books will mention encapsulation, inheritance, and whatever when describing OOP. But the most important concept is Poly. She's the gal you want to take to the dance.
Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayEnnis Ray Lynch, Jr. wrote:
In fact, without inheritance you can't have polymorphism.
Not true. :-) In C++, you have several different kinds of polymorphism. Inheritance allows for run-time polymorphism; I can change the implementation behind an interface at run-time. Templates give us compile-time polymorphism. The implementation behind an interface is determined at compile-time. Compile-time polymorphism via templates doesn't rely on inheritance. Parametric polymorphism can be done through overloading of methods. This doesn't necessarily rely on inheritance, either. In other languages you don't even need inheritance at all for run-time polymorphism. Smalltalk is an example (I think).
-
Ennis Ray Lynch, Jr. wrote:
In fact, without inheritance you can't have polymorphism.
Really? :~ I'm gonna have to think about this one a bit.
Think of a case without inheritance where there is polymorphism. All polymorphism is basically a vtable lookup to determine which method in the inheritance chain to call. The real challenge is the new keyword in .NET which allows methods to be shadows which breaks the polymorphic chain causing novice programmers to make some real fun mistakes.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Ennis Ray Lynch, Jr. wrote:
In fact, without inheritance you can't have polymorphism.
Not true. :-) In C++, you have several different kinds of polymorphism. Inheritance allows for run-time polymorphism; I can change the implementation behind an interface at run-time. Templates give us compile-time polymorphism. The implementation behind an interface is determined at compile-time. Compile-time polymorphism via templates doesn't rely on inheritance. Parametric polymorphism can be done through overloading of methods. This doesn't necessarily rely on inheritance, either. In other languages you don't even need inheritance at all for run-time polymorphism. Smalltalk is an example (I think).
You are actually referring to two totally different concepts confused by the overloading in the computer science community of the word polymorphism. In reality, as the wiki article states, in the context of OO languages parametric polymorphism is referred to as generics to remove the ambiguity. http://en.wikipedia.org/wiki/Polymorphism_(computer_science)[^]
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayEnnis Ray Lynch, Jr. wrote:
In fact, without inheritance you can't have polymorphism.
I don't think that is an accurate statement. In C++, you can definitely have static polymorphism with templates (I am not talking about the operator overloading). In C++, dynamic polymorphisms is acheived through virtual functions (and of course inheritance). The C++ templates book (by Josuttis and Vandevoorde) explains the difference in both static and dynamic polymorphisms in detail. I think one of the Herb Sutter's book also talks about static polymorphism. Disclaimer:- The last time I looked at these books was probably 3 years back and there is a chance that I could be wrong about the fine details. Also I don't write code these days :) :) :) :)
modified on Tuesday, March 4, 2008 12:19 AM
-
Think of a case without inheritance where there is polymorphism. All polymorphism is basically a vtable lookup to determine which method in the inheritance chain to call. The real challenge is the new keyword in .NET which allows methods to be shadows which breaks the polymorphic chain causing novice programmers to make some real fun mistakes.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayWhat about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)
-
What about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)
At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
At a certain point you cross the boundaries between OO and just a language where anything goes. Eventually there is a line in the sand where you have to say this language doesn't fully enough structure to even be considered a full OO language and that is why there are so many qualifications for an object oriented language. It is also why there are not "true" object oriented language. Be your own judge and draw your own line.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayEnnis Ray Lynch, Jr. wrote:
Be your own judge and draw your own line.
Getting back to the context of your thread, if this were a job interview and we were to have this discussion, I wonder how it would be viewed by the inteviewer? In other words, if we had a give and take about the nature of OO, would that be considered a plus? Or would the interviewer be irked by not getting the canned answer he/she was looking for?
-
What about dynamic binding systems such as ObjectiveC, Javascript, or IDispatch? In these systems, i can have a reference to an object and call methods on it/send messages to it, all without making any requirements on how the object is actually implemented, or what it inherits. Now, if you want to argue that these systems still depend on inheritance to the extent that every object must at least inherit the mechanism for dispatching messages, well, i'll concede that. :)
"Quack quack" If it quacks like a Shog9? ;P
-
Ennis Ray Lynch, Jr. wrote:
Be your own judge and draw your own line.
Getting back to the context of your thread, if this were a job interview and we were to have this discussion, I wonder how it would be viewed by the inteviewer? In other words, if we had a give and take about the nature of OO, would that be considered a plus? Or would the interviewer be irked by not getting the canned answer he/she was looking for?
Usually the interviewer asks, "What are the pillars of OO"? and I respond, "Do you want the 3, 5 or 8?" I only launch into a pedantic discussion with poor interviewers who are wasting my time and for the interviewer that needs a sense of feeling superior. Of course for the later I don't want the position anyway so I take pride in answering with the most technically complete answers in order to totally baffle the person. If I really want the gig, I just parrot the big three.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Throw the guy for a loop when he or she asks for the three fundamental concepts of object oriented programming. Depending on which book you read there are three, five, or eight fundamental concepts of object oriented programming. Who can name all eight without looking, all five, and all three? Bonus, if you can identify which book the five and eight come from. (No web searching)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest HemingwayWhat is "Encapsulation, polymorphism, abstraction, inheritence, reuse"?
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed. Lotus Notes is a conspiracy by the forces of Satan to drive us over the brink into madness. The CRC-32 for each file in the installation includes the numbers 666." Gary Wheeler "The secret to a long and healthy life is simple. Don't get ill and don't die." Pete O'Hanlon, courtesy of Rama "I realised that all of my best anecdotes started with "So there we were, pissed". Pete O'Hanlon
-
Not to quibble but polymorphism is not the most important concept in OO. In fact, without inheritance you can't have polymorphism. (BTW, hiding implementation behind interfaces is a form of inheritance)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway