Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
fb1701
1 year ago

An illustrative example from the field of embedded programming:

I need a digital filter. I need the following features:

  • Transfer new samples to the filter.
  • It can recognize whether the filter has provided a new result.
  • Read the delivered result of the filter. After reading the result, the flag “there is a new result” should be reset.
  • Parameterize filter.
  • Reset filter.

If I want to realize this with structured programming (usually in embedded systems in C), I need many functions or Procedures (i.e. in C functions with void result) and global variables and/or “degree on struct” constructs to connect and make use of the functions/procedures (other solutions are also conceivable, but are typically also complicated).

With OOP this can be realized more easily.

W00dp3ckr
1 year ago

In the right life are objects and what you can do with them always together. A lego stone has the upper and lower sides as “interface”, so what you can do with it. There’s something to grow.

In a procedural program, data (i.e. the “objects” of programming) and procedures (what can be done with the objects). This is unnatural and therefore mentally difficult to handle. Object-oriented programming brings this back together.

rechner36
1 year ago

Object-oriented programming allows to disassemble complex problems into smaller, reusable modules (objects). As a result, the code is better structured/organized, facilitates cooperation and you can better wait, expand or update the program.