Questions tagged [object-oriented]

Questions about the principles of the object-oriented programming paradigm.

91 questions
54
votes
1 answer

What is the earliest use of the "this" keyword in any programming language?

I understand the this (or self or Me ) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The earliest language I could find which has such a concept was Smalltalk, which uses self but was…
huijing
  • 651
  • 1
  • 5
  • 7
18
votes
9 answers

What problems of procedural programming does OOP solve in practice?

I have studied the book "C++ Demystified" . Now I have started to read "Object-Oriented Programming in Turbo C++ first edition (1st edition)" by Robert Lafore. I do not have any knowledge of programming which is beyond these books. This book might…
14
votes
6 answers

Definition of the state of an object in OOP

I need a concise definition of the "state of an object" in object-oriented programming (for a paper). For about half of a day I searched for a paper that I can cite on this topic, but I couldn't find one. All the papers I found were mostly general…
13
votes
3 answers

What is the difference between Abstract Data Types and objects?

An answer on Programmers.SE characterizes an essay by Cook ( Objects are not ADTs ) as saying Objects behave like a characteristic function over the values of a type, rather than as an algebra. Objects use procedural abstraction rather than type…
13
votes
2 answers

Is there a theory/abstraction behind OOP?

Functional programming has the very elegant Lambda Calculus and its variants as a backup theory. Is there such a thing for OOP? What is an abstraction for the object oriented model?
11
votes
3 answers

Automatic Downcasting by Inferring the Type

In java, you must explicitly cast in order to downcast a variable public class Fruit{} // parent class public class Apple extends Fruit{} // child class public static void main(String args[]) { // An implicit upcast Fruit parent = new Apple(); // An…
Sam Washburn
  • 215
  • 1
  • 7
11
votes
0 answers

Denotational semantics of object-oriented languages

I am interested in denotational semantics of object oriented languages. Namely, what are the common/typical denotations of objects used in the literature? Is this an interesting topic these days? The most comprehensive article I've found dates back…
11
votes
2 answers

Is there an equivalent of lambda calculus for object oriented languages?

Lambda calculus serves as a foundation for all sorts of functional languages and its various extensions are compiler targets for languages like Haskell, ML, etc. So what is the equivalent for object oriented languages? Is there a minimal object…
user22635
10
votes
1 answer

What is the origin of dot notation?

In object-oriented programming, dot notation is used when accessing the properties or methods of a class: Dog dog print dog.name >> "Fido" dog.walk() >> Walking the dog now... What is the origin of that syntax and why the . to notate it? It must…
JeffThompson
  • 235
  • 2
  • 6
9
votes
2 answers

Difference between multimethods and overloading

Context I've been programming in java for a few years now. And atm i'm learning something totally different: Clojure. There the expression problem can be solved by using multimethods whereas in java you will need something like the visitor pattern…
7
votes
1 answer

The C3 linearization algorithm for method resolution in multiple inheritance OO languages: Looking for a justification for some implementation detail

According to this description of Python's method resolution order (mro), a.k.a. C3 linearization , the algorithm can be described recursively as follows: L(O) = <O> L(C) = <C> + merge(L(B1),..., L(Bn), <B1,...,Bn>) where O is the class from which…
7
votes
3 answers

Inheritance, and dynamic access to members/attributes and methods in Java-like languages

I have a question about inheritance in Java-like OO programming languages. It came up in my compiler class, when I explained how to compile methods and their invocation. I was using Java as example source language to compile. Now consider this Java…
7
votes
2 answers

Are class methods closures?

In the wiki article about closures one can read: closure ... is a function or reference to a function together with a referencing environment At the same time in the wiki article about class methods : Accessor methods are used to read data values of…
Vitaly
  • 173
  • 5
6
votes
1 answer

Is it possible to implement dependent types by any object oriented language supporting inheritance and classes?

When I was reading Agda tutorial, I noticed resemblance between dependent type declarations and class definitions which I've been primarily used to work with. I'm not totally sure how much sense this questions makes, but what is the real practical…
MarkokraM
  • 405
  • 2
  • 9
6
votes
2 answers

What would "sum types with functions" look like in OOP?

It's fair to summarize classes in OOP as "product types with functions." However, couldn't there be something like "sum types with functions"? How would inheritance work with them? I'm trying to scout if anybody has considered this question before…
1
2 3 4 5 6 7