I am taking a C++ class in my school. Since I’ve programmed in Ruby I know some OOP stuff.
But in C++ there are member functions, member variables, and static functions. In Ruby we have instance methods, instance variables, and class variables. And there are more…
Any reason they’re different? Are they quite different levels of OOP? Or just some differences in tradition these ecosystems have?
Instance in Ruby and member in C++ are effectively the same thing, so instance variables and member variables are the same, as are instance methods and member functions.
However, static members are somewhat different from class variables in Ruby since the the Ruby object model is quite different to C++. In Ruby, classes are objects, so class variables are instance variables of a class object.
They are just different names for the same thing. You see the same thing with inheritance: base vs. parent vs. super classes. School teachers and people who only know one language will sometimes be very pedantic about the terms. In industry you’ll find people mixing and matching more often.
The concepts – or as you call them, levels – of OOP are similar or the same across OO languages and a lot of the differences in terminology come out of the history and tradition of the languages and their ecosystems. That’s why you’re seeing different terms used to describe very similar concepts when you’re comparing the two languages.