Module 1 : Basic Concepts of Ruby OOP (Object Oriented Programming)

RachelGultom
2 min readJul 12, 2021

Rachel Gultom — GBE01116

  1. How do you feel about this week’s learning?

In the first week, we have learned about OOP Concepts using Ruby and really enjoy it. I think Ruby same with Java language from OOP Concepts but in Ruby, OOP designed very simple to understand it and we know that Ruby is smart programming language.Ruby knows how to make that syntax more than the programmer thinks, if the programmer forgets about the syntax, Ruby will immediately adjust what the programmer meant.It’s really magical isn’t it?

2. What’s the most important thing you learned today? Why do you think so?

This week, we learned about 4 concepts that OOP embraces, namely Abstraction, Polymorphism, Inheritance,Encapsulation and Composition.

  • Abstraction : is a way to see an object in a simpler form.
  • Polymorphism : is a concept that allows the use of the same interface to command an object to perform an action that may be in principle the same but in a different process.
  • Inheritance : is the concept of inheriting the attributes and methods of a class to its derived classes.
  • Encapsulation : is a mechanism to hide or protect a process from possible interference or misuse from outside the system and at the same time simplify the use of the system.
  • Composition : is defined as a HAS-A relationship. This relationship is between two or more classes where the use of an instance variable is a reference to another object.

Example of Inheritance OOP Concepts :

Inheritance OOP Concepts

One thing I learned in detail, it turns out that removing 1 component from OOP rules makes our code messy. For example, in OOP, 2 components must be needed, namely state and behavior. If one of them is not implemented, then it is not OOP, because good OOP is designed in more detail and is easily understood by the reader.

3. What are the things you’re still confused about?

All concepts and materials provided are very easy to understand, but one thing that is difficult for me in thinking is the speed of time in honing logic when solving the problem statements given. I admit it is not easy to learn Ruby considering that this is the first time I know Ruby further and before that I still did not understand the basic syntax used by ruby. This is one of my obstacles in pouring logic according to the given problem statement. But the solution, I have to keep exploring it from the basics to more advanced concepts because Ruby is also the same as other programming languages.

--

--