Photo by Galymzhan Abdugalimov on Unsplash
Object Oriented Programming
The fundamentals do not change!
Do you want to transition into tech? You have learned Fortran in school but never write a single line of code? Do you wish to be an elite developer but you don't have the courage to start learning? You find support here, on my blog. I will step by step teach you how to make Sage Code.
Is object oriented relevant?
One thing you need to learn first about programming language is the programming paradigm. There are several, but in this article we focus on a specific one that is very popular. OOP (Object Oriented Programming) was invented for SmallTalk, an older programming language. It was implemented later in Objective-C, C++ and become popular among developers. Then Java, a new pure OOP language was created by reducing C++ complexity.
OOP Was criticised for it's relative rigid way of doing things. Java has grown too complex and we want faster languages with reduced complexity. So lately, Functional Programming (FP) has become more popular and is competing against OOP.
Though many new languages are implementing FP, the old OOP paradigm is still relevant. You can use both, FP and OOP in modern languages, and combine advantages of both into beautiful algorithms.
What is object oriented precisely?
Object oriented consist in basic principles and specific syntax for particular programming languages. Once you have learned the principles you will be able to understand a new programming language that implements OOP.
These are 4 fundamental pillars of OOP:
Abstraction
Encapsulation
Inheritance
Polymorphism
Abstraction basically enables you to create abstract classes. These have method specifications but no implementation. It enable you to focus on important aspects and defer the implementation details to later implementation. You can create abstract classes, method signatures and interfaces. You can use this feature to improve code reusability and interoperability.
Encapsulation is referring to packages and classes. Is the ability to create components or containers that keep data and methods together. The container is usually an Object that has attributes. Objects are instances of classes. To implement encapsulation correctly, you should have the ability to control the access level to members of a class. That are: public/protected/private attributes or methods. So you can hide some details of implementation and protect some data from public access.
Inheritance is the ability to extend a class with new methods and attributes. The parent class can be a normal class or an abstract class. Usually you can extend a single parent class (single inheritance model) but in some languages you can extend many classes at the same time (multi-inheritance model). This feature enable you to create a hyerarchy of classes.
Polymorphism is referring to methods. A method is a subprogram that can receive parameters and return a result. Methods can have the same name and different parameters. That is, methods can be overloaded. Also a method that is implemented in a parent class can be overwritten in different subclasses. So a method has multiple forms, and is called polymorph. When you call the method, the right version is identified using a special feature called: dispatch.
Note: Programming languages implement OOP in different ways: Some languages use "single inheritance" while others use the "multiple inheritance" model. When you learn a new language you will notice this difference. The concepts remain the same.
What languages are OOP?
The OOP was implemented in many languages and is available for use. Some languages are pure OOP but some other languages enable FP, OOP and SP together. Next top 5 modern languages are most easy to work with and considered multi-paradigm:
Swift
Go
Rust
Dart
Nim
Pure OOP languages are more traditional and harder to use due to conceptual principle: "Everything is an Object". In contrast, FP has this concept: "Everything is a Function". Modern languages have Objects and Functions. So you are free to choose what to use and when.
SmallTalk
Java
Ruby
JavaScript
Traditional languages are hybrid:
Objective-C
C++
Python
Where do I learn these languages?
All these languages can be learned for free on my website. I stream every Saturday and I record tutorials on YouTube. You can visit my website and start learning. There is no subscription and no ads. You don't have to make any donation and you do not have to log-in. Visit and start learning.
Should I learn something else?
Yes, OOP is not all you need to know. You must learn Software Engineering. Our course will teach you the fundamental concepts but you need a little bit more. After you finish our course you are going to be ready for specialization. You will need to practice.
Have fun. Learn and prosper ๐๐ผ