# Tag Info

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 ...
• 1,783
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 ...
• 14.1k

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

So what is the equivalent for object oriented languages? Lambda calculus. I mean, there is Cardelli's object calculus (and a handful of derivatives), but in general, there's nothing fancy about ...
• 499

### Is there a theory/abstraction behind OOP?

The connection between object model core and set theory is described in the following documents: Object Membership: The Core Structure of Object Technology Object Membership – Basic Structure What Is ...
• 227

### What problems of procedural programming does OOP solve in practice?

In a procedural language you can't necessarily express restrictions that are required to prove that the caller is using a module in a supported fashion. In the absence of a compiler checkable ...
• 470
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 ...
• 1,944
Accepted

### What is the difference between Abstract Data Types and objects?

Google brought up a similar question with an answer that I think is very good. I've quoted it below. There's another distinction lurking here that is explained in the Cook essay I linked. ...
• 301

### What problems of procedural programming does OOP solve in practice?

A bit of history is in order, I think. The era from the mid-1960s to the mid-1970s is known today as the "software crisis". I can't put it better than Dijkstra in his Turing award lecture from 1972: ...
• 18.8k

### What problems of procedural programming does OOP solve in practice?

Procedural/functional programming is in no way weaker than OOP, even without going into Turing arguments (my language has Turing power and can do anything another will do), which do not mean much. ...
• 19.1k

### What problems of procedural programming does OOP solve in practice?

None, really. OOP doesn't really solve a problem, strictly speaking; there's nothing you can do with an object-oriented system that you couldn't do with a non object-oriented system- indeed, there's ...
• 161

### 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 ...
• 29.1k
Accepted

### Creating arrays of object of abstract class in statically-typed object-oriented languages

In statically-typed object oriented languages (like Java), you can not create an object of an abstract class. Abstract classes are (usually) not completely defined, so creating such an object wouldn'...
• 17.3k
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: ...
• 14.1k
Accepted

### What's the difference between declarative syntax and encapsulation?

They're orthogonal. In declarative programming, you describe what would count as an acceptable solution, without necessarily describing how to find it. For instance, a declarative program might have ...
• 140k

### What is the difference between Abstract Data Types and objects?

If you look at the ADT proponents, they consider an ADT to be what OOP would call a class (internal, private state; a limited set of operations allowed), but no relation between classes (no ...
• 13.6k

### 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 ...
• 1,846
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,...
• 9,325

### 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 ...
• 141
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 ...
• 14.1k

### 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 ...
• 29.1k
Accepted

### What is the difference between the friend class and inheritance consept in C++?

To declare a class (or a function) a friend allows the friend to access private members [the naming in C++ is not my fault!] (data or function) directly. They aren'...
• 13.6k

### 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: ...
• 213

### 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 ...
• 1,524

### What problems of procedural programming does OOP solve in practice?

Having written embedded C for a few years managing things like devices, serial ports, and communications packets between the serial ports, network ports, and servers; I found myself, a trained ...
• 279

### What is the difference between Abstract Data Types and objects?

I always understood it this way: An ADT is an interface: it is just a collection of methods, their type-signatures, possibly with pre-and-post conditions. A class can implement one or more ADTs, by ...
• 29.1k

### 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 ...

### 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 ...
• 29.1k

### 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 ...
• 11.8k