Computer Science, asked by abha1234, 1 year ago

Explain organizations of data and functionsin oops

Answers

Answered by 9992235895
0
C++ — functions as “methods” or “member functions” are associated with the classes and objects they belong to abstractly. You also have virtual member functions, which are organised as a vtable to the class, which allows you to create polymorphic objects.

Java — similar to C++, except its member functions are always “virtual”.

Python, Ruby — Both interpreted languages that sport dynamic binding of member functions, or methods, to the objects they belong to.

Rust — Is more functional than OOP. So functions are not tied to “objects” per se, but are associated through traits.

Erlang, Elixir — much more of a functional aspect, and uses a mechanism similar to traits.

Perl — a weird and strange beast, mainly meant as a scripting language, with OOP bolted on as an afterthought. The object-function association is achieved by “blessing” your objects.

C — Objects? We don’t need no stinkin’ objects!!!!

Lisp — Everything is a List. You can emulate OOP programming if you like…

Javascript — uses prototypes, and is something you’ll have to get used to. Feels unnatural to me, syntax is hokey and ugly by my standards.

PHP — don’t make me laugh. Another language that has had OOP bolted on as an afterthought. Its syntax is even more ugly than Javascript. Only grew namespaces late into the game, with lots of code that fails to leverage this.

Similar questions