Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Next time you have an interview

Next time you have an interview

Scheduled Pinned Locked Moved The Lounge
csharpcomalgorithmsoopquestion
23 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Ennis Ray Lynch Jr

    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

    M Offline
    M Offline
    Madhu Cheriyedath
    wrote on last edited by
    #11

    Ennis 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

    1 Reply Last reply
    0
    • E Ennis Ray Lynch Jr

      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

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #12

      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. :)

      E L 2 Replies Last reply
      0
      • S Shog9 0

        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. :)

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #13

        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

        S L 2 Replies Last reply
        0
        • E Ennis Ray Lynch Jr

          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

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #14

          Ennis Ray Lynch, Jr. wrote:

          Be your own judge and draw your own line.

          :) fair 'nuff.

          1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            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

            L Offline
            L Offline
            Leslie Sanford
            wrote on last edited by
            #15

            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?

            E 1 Reply Last reply
            0
            • S Shog9 0

              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. :)

              L Offline
              L Offline
              Leslie Sanford
              wrote on last edited by
              #16

              "Quack quack" If it quacks like a Shog9? ;P

              1 Reply Last reply
              0
              • L Leslie Sanford

                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?

                E Offline
                E Offline
                Ennis Ray Lynch Jr
                wrote on last edited by
                #17

                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

                1 Reply Last reply
                0
                • E Ennis Ray Lynch Jr

                  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

                  L Offline
                  L Offline
                  leppie
                  wrote on last edited by
                  #18

                  Next time cover his question/answer sheet, and ask him to name them to you without pause.

                  xacc.ide - now with IronScheme support
                  IronScheme - 1.0 alpha 2 out now

                  O 1 Reply Last reply
                  0
                  • E Ennis Ray Lynch Jr

                    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

                    N Offline
                    N Offline
                    NormDroid
                    wrote on last edited by
                    #19

                    My 3 are: Encapsulation Inheritance Polymorphism I couldn't name all 8:~

                    Brainware Error - reboot required.

                    1 Reply Last reply
                    0
                    • E Ennis Ray Lynch Jr

                      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

                      M Offline
                      M Offline
                      Mustafa Ismail Mustafa
                      wrote on last edited by
                      #20

                      What 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

                      1 Reply Last reply
                      0
                      • E Ennis Ray Lynch Jr

                        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

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #21

                        Ennis Ray Lynch, Jr. wrote:

                        without inheritance you can't have polymorphism

                        I disagree. How about polymorphic funcitons in C, take printf() foro example. THats got plenty of forms.

                        Morality is indistinguishable from social proscription

                        1 Reply Last reply
                        0
                        • E Ennis Ray Lynch Jr

                          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

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #22

                          Ennis Ray Lynch, Jr. wrote:

                          three fundamental concepts of object oriented programming

                          Data hiding must be the highest on the list since it is the reason why we have OO engineering. Polymorphism is crucial to creating objects of different type with similar interfaces alowing the same code to manipulate any type. Inheritence is usefully, but not necessary, so it comes down the list. As for the rest, they must be minor details like abstract classes, multiple inheritence, operator overriding, ... hmm, thats ablout it for me.

                          Morality is indistinguishable from social proscription

                          1 Reply Last reply
                          0
                          • L leppie

                            Next time cover his question/answer sheet, and ask him to name them to you without pause.

                            xacc.ide - now with IronScheme support
                            IronScheme - 1.0 alpha 2 out now

                            O Offline
                            O Offline
                            Oakman
                            wrote on last edited by
                            #23

                            leppie wrote:

                            Next time cover his question/answer sheet, and ask him to name them to you without pause.

                            a 5

                            Jon Smith & Wesson: The original point and click interface

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups