OOP in various languages
Introduction
There are a number of concepts that are commonly seen as defining Object Oriented development. These concepts appear in many OOP languages, but are noted slightly differently in different languages (different syntax).
- The concepts
class
and object
/instance
.
constructor
(or initializer
, instance creating
, new
)
Encapsulation
(properties
, accessors
, private
)
static
methods, fields and properties.
interface
(protocol
, abstract base class
)(so NOT as in: User Interface!)
inheritance
(sub class, super class, base class, derived class).
- Can you make up or find more internet?
Number of languages that are interesting to look at because there is a reasonable chance you will encounter them:
- Java (C# and Java are close (how come?)).
- Kotlin: Android.
- Swift: iOS.
- Python: (Applied Data Science; Infra semester 2).
- C++ : devised to enable OOP in (an extension to) C. C++, like C, focuses on performance.
- … or are you interested in another language …
The assignment
Pick a language that seems interesting to you and go on the Internet to find how OOP concepts are implemented in that language.
Is there a student or teacher who already knows a language? Perhaps the teacher is eager to give a demo in her/his favo language?
- Can you find all the concepts? If not, do they exist in that language? Why not? Do they have another solution?
- Is it similar to what you are used to? Maybe it seems more convenient? Elegant syntax? Or just less readable?
- Is the language ‘natively’ intended for OOP or does it seem to have been ‘glued on’ later?
- Take a program you’ve programmed before and consider how different it would be in this language. More readable? Shorter?
- Other questions are bound to surface as you work on it.
- Also agree on what you want to deliver at the end: a (written) document?, a video?, presentation?
Resources