Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object-oriented languages without class concept [closed]

I am reading introduction to Scala paper and found following statement:

It should be noted that some object-oriented languages do not have the concept of class.

Question: Which object-oriented languages do not have class concept and how do they handle type(class) - object(type instance) relationship ?

like image 269
tommyk Avatar asked Dec 18 '12 11:12

tommyk


People also ask

Can OOP be implemented without class?

Notice, however, that nothing about OOP requires classes specifically. A form of OOP can even be implemented in C through the adoption of certain conventions. Classes are but one path to OOP's promise of reusability.

Do all object oriented languages have classes?

OOP languages are diverse, but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types. Many of the most widely used programming languages (such as C++, Java, Python, etc.)

Which language does not support OOPs concept?

There are many programming languages which are not a true object-oriented programming languages like Fortan, Algol, Cobol, Basic, Pascal, C, Ada, and etc.

What are the 3 concepts of OOP?

Encapsulation, inheritance, and polymorphism are usually given as the three fundamental principles of object-oriented languages (OOLs) and object-oriented methodology.


1 Answers

Although it is common in popular languages to conflate them, classes and types are different concepts. A class is properly understood as a blueprint for an object, defining the attributes and methods that instances of the class possess, but an (object) type is an interface, describing what methods can be called with what parameters.

Thus, it is not difficult to imagine languages without classes. All you need is some kind of a construct for creating objects and for giving (new) objects attributes and methods; Javascript is a well known example. Inheritance will look a bit unusual in such languages, but certainly can be done (see for example Antero Taivalsaari's article "On the notion of inheritance").

like image 175
ibid Avatar answered Sep 21 '22 15:09

ibid