My approach. The core is the engine. - page 104

 
Реter Konow:

Well, maybe you can. I can't argue with that. I haven't studied it very well. But why when you can use drawing functions directly?

You have pulled functions out of the class for yourself. You have done a completely unnecessary and useless job. You could have created as many instances of the class as you want and used them independently.

And each of them would draw exactly where it should draw. Independently of the others. And you wouldn't have to remember anything - just each of your panels would have a pointer to its own instance of the class. And not just one - and then you could make any number of CCanvas independent of each other in one panel. Just store them in CArrayObj, get a reference to the one you need and do whatever you want with it.

You're not just underestimating OOP, you're missing your own horizons extensions :) If you've been expanding your horizons for years, yet having studied OOP, I'm afraid you're bursting with expansion in a day :)

 
Artyom Trishkin:

You have pulled functions out of the class for yourself. You have done a completely unnecessary and empty job. You could simply create as many instances of the class as you want and use them independently of each other.

And each of them would draw exactly where it should draw. Independently of the others. And you wouldn't have to remember anything - just each of your panels would have a pointer to its own instance of the class. And not just one - and then you could make any number of CCanvas independent of each other in one panel. Just store them in CArrayObj, get a reference to the one you need and do whatever you want with it.

It's not that you're underestimating OOP, you're missing your own horizon broadening :) If you've been expanding your horizons for years, yet once you learn OOP, I'm afraid you're bursting with expansion in 24 hours :)

If it were like that, you'd amaze the public with incredible things, which I'd be trying in vain to reach with my cheesy approach.

Only, for some reason, it's not like that...)

 
Реter Konow:

If it were like that, then you would amaze the public with incredible things that I would vainly try to reach with my cheesy approach.

Only, for some reason, it's not like that...))

Oh yes! The PLO won't let it fly.

 
Реter Konow:

I took the 14 functions out of the class. Now, I access them directly and draw what I want.

And it's much easier to draw than if it were all in a class.

So, in THIS CASE, the possibilities increased when I gave up OOP, not when I used it.

There, Peter, you're a fan of declarative statements!
Where is it simpler? What kind of possibilities increased?
On the contrary!
At a minimum:
if I use a class object, I put a dot after the name and get the whole list of functions and variables relevant in a given place. And I don't have to keep all the names in my head.
And you've got some kind of Mega Inconvenient Frankenstein.
 
Реter Konow:

If it were like that, then you would amaze the public with incredible things that I would vainly try to reach with my cheesy approach.

Only, for some reason, it's not like that...)

Let's put it this way: I'm busy enough with my own business that I don't have time to be amazed at you. But here, if you - with your potential - studied OOP, the resource would be enriched with many incredible and amazing things. But you, alas, are stubborn in your beliefs.

 

Guys, with all due respect, program as you please. I will program in my own way.

OOP is needed for a team of programmers working on a project that is beyond the capabilities of one person.

Simple animation does not require OOP. Also, when hunting a hare, you don't need to take a bazooka with you.)

 
Artyom Trishkin:

Let's put it another way: I am busy enough with my own business, and I have no time to be surprised by you. But if you - with your potential - studied OOP, the resource would be enriched with many incredible and surprising things. But you, alas, are stubborn in your beliefs.

As soon as I feel that my approach does not provide enough development opportunities, I will immediately take up OOP.

 
Реter Konow:

Guys, with all due respect, program as you please. I will program in my own way.

OOP is needed for a team of programmers working on a project that is beyond the capabilities of one person.

Simple animation does not require OOP. Also, when hunting a hare, you do not need to carry a bazooka)).

A misconception about OOP

 
Реter Konow:

I think Nikolai can tell you exactly how handy the CCanvas class is for animation. He's an expert in it.

I tend to use my own class, which is a descendant of CCanvas. For animation, there's nothing more convenient than the OOP mechanism.
 
Реter Konow:

I took the 14 functions out of the class. Now, I access them directly and draw what I want.

And it's much easier to draw than if it were all in a class.

So, in THIS CASE, the possibilities have increased by doing away with OOP, not by using it.

That said. Suppose there is a situation where there are functions, but the user of the program has decided not to use this functionality at startup.
When using classes, it is quite convenient to use their dynamic connection/disconnection. This in turn gives a small speed boost in some situations.
Static is good, of course, but you have to use everything in place.