Skip to main content
Share Your Experience: Take the 2024 Developer Survey
62 votes
Accepted

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

Simula 67 is generally considered the first object-oriented language and predates Smalltalk by a number of years. It also used the this keyword for the same ...
Brian Tompsett - 汤莱恩's user avatar
24 votes
Accepted

Automatic Downcasting by Inferring the Type

Upcasts always succeed. Downcasts can result in a runtime error, when the object runtime type is not a subtype of the type used in the cast. Since the second is a dangerous operation, most typed ...
chi's user avatar
  • 14.6k
10 votes
Accepted

What is the origin of dot notation?

In [1] (authored by one of the co-creators of Simula), there is a suggestion that Simula 67 may have been the first to use this dot notation. Given that Simula is widely credited for being the first ...
mhum's user avatar
  • 2,102
7 votes

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

The key to remember is that there's a sort of dualism between functional sum types, and OOP implementations of a superclass or interface: Sum types require the variants for a type to be specified up ...
Joey Eremondi's user avatar
5 votes
Accepted

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

Without the last list: merge(<B,D,O>, <C,F,O>, <D,O>) = <B,D,C,F,O> With the last list: ...
chi's user avatar
  • 14.6k
4 votes

Identity of object in OOP

Depending on the programming language, some or all objects might have reference semantics. What this means is that when you assign the object to a variable or pass it to a method, it's still the same ...
svick's user avatar
  • 1,866
4 votes
Accepted

Which object-oriented programming language is the closest to the untyped sigma-calculus?

JavaScript looks perfectly like untyped sigma calculus. It supports first-class citizens, described in paper concepts in terms of prototypes, closures, clone (called split), (dynamic) method override,...
Evil's user avatar
  • 9,465
4 votes

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

Hm, I don't have the points to comment, but are you sure you mean that? Classes already are a sort of sum type: polymorphism means that a variable declared to refer to something of type "A" could ...
phlummox's user avatar
  • 141
4 votes

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

So, things like this are possible, but the usefulness varies depending on your system. First, you can absolutely model object oriented programming in a functional, formal setting. System F-sub is the ...
Joey Eremondi's user avatar
4 votes
Accepted

Was multiple inheritance ever implemented by adding redundant data members?

It does not matter how you implement multiple inheritance, the inherent issues coming from that still apply. If $C$ is a class, and $D$ a derived class (subclass), and $d:D$ we can write ...
chi's user avatar
  • 14.6k
3 votes

Does the concept of subtype require dynamic method binding?

No. It doesn't even require a notion of "method" at all. Even if you have objects and methods, it doesn't necessarily require a notion of dynamic dispatch. Indeed, dynamic dispatch is only relevant if ...
Derek Elkins left SE's user avatar
3 votes

Which is a type of objects in mainstream OO languages: a class, an interface, an abstract class, a metaclass?

Unfortunately I don't have a copy of TAPL with me, so I can't figure out exactly what the author intends. But there is a point we should make, that types are something which classifies terms or values,...
Jason Carr's user avatar
3 votes

How to implement polymorphism in a turing complete environment?

So, first, a question. Are you using dynamic or static dispatch? i.e. if Circle and Shape provide implementations of the same ...
Joey Eremondi's user avatar
3 votes

Are synchronous message sends a subset of async. ones?

There are several possible semantics for asynchronous message passing, so there isn't a single answer to this question. It depends how the scheduler works. From a theoretical perspective, the ...
Gilles 'SO- stop being evil''s user avatar
3 votes

Automatic Downcasting by Inferring the Type

It's a matter of where do you want to draw the line. You can design a language that will detect validity of implicit downcast: ...
Agent_L's user avatar
  • 213
3 votes

Automatic Downcasting by Inferring the Type

Usually downcasting is what you do when the statically known knowledge the compiler has about the type of something is less specific than what you know (or at least hope). In situations like your ...
Ben's user avatar
  • 1,704
3 votes

What subfields in computer sciences may one study without learning Object Oriented Programming?

Depending on where you study, you might be able to get a CS degree without Object Oriented Programming, but the chances are slim. Most degrees would require you to take some programming courses using ...
gnasher729's user avatar
  • 30.4k
3 votes

Are objects appropriate for modeling the real world?

Object-oriented programming languages are designed to support programming. Whether they "properly" model the real world is beside the point and not the primary goal. So, when you ask "...
D.W.'s user avatar
  • 161k
3 votes

Why we dont use dot operator with int or any other datatype

There are languages where "everything is an object". The archetype is Smalltalk, although Smalltalk does not think in terms of "method calls", but rather "messages". In ...
Pseudonym's user avatar
  • 22.2k
2 votes

Are grandparent classes also parents?

You cannot answer this question unambiguously. Different OOP languages implement OOP paradigm differently. In Ruby you will get only "Hi, I am bird!" ...
fade2black's user avatar
  • 9,837
2 votes

how does an object find the reference to its instance variables

Since the class is fixed in advance in C++-style languages, the offset to a5 or a450 is known in advance, in compile time. Each ...
Yuval Filmus's user avatar
2 votes
Accepted

Term for members of a class that are not inherited

Just a member variable. If you want to specify that it is not inherited, I suppose you could call it 'noninherited member variable'. Wiktionary lists this as a term in computing.
Arthelais's user avatar
  • 248
2 votes

What does Harper mean by "class"?

This is a very generic, informal definition of the concept of classes which is commonly implemented in programming languages. I can't think of a programming language that uses the term “class” in a ...
Gilles 'SO- stop being evil''s user avatar
2 votes

Definition of the state of an object in OOP

The term ‘state’ may be used in various senses, which may not even all be susceptible of a precise definition. It was therefore important that you include a definition in your paper, to make quite ...
PJTraill's user avatar
  • 380
2 votes
Accepted

What's the difference between subtyping and inheritance?

See the following discussions in other stack exchange groups. See discussion in https://stackoverflow.com/questions/23592131/what-is-the-difference-between-subtyping-and-inheritance-in-oo-programming ...
Richard Chambers's user avatar
2 votes

Is the implementation relation between an interface and a class an instantiation or inheritance relation, or neither?

From notes I have from university, here is an explanation I found useful that may help An interface, or protocol as it is sometimes called, is a device that is used to allow unrelated objects to ...
lPlant's user avatar
  • 1,612
2 votes

Usage of stacks and heaps in object-oriented programming. Reasons?

I am not sure if choosing stacks/heap is related with object oriented programming. The stacks are adopted by many programming languages because they are perfect fit for scoped variables, e.g. create ...
Ryoji's user avatar
  • 419
2 votes
Accepted

What subfields in computer sciences may one study without learning Object Oriented Programming?

Object Oriented Programming is a type of programming paradigm. A Computer Science degree is mostly theoretical (not only machine learning and applied statistics! Believe me there is so much more), so ...
nir shahar's user avatar
  • 11.6k
2 votes

Are objects appropriate for modeling the real world?

It sounds like you have already answered all of your own questions: objects are not meant to model the real world, although they have been marketed as such and perhaps that was an intention at some ...
Aaron Rotenberg's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible