OOP vs procedural programming - page 13

 
Alexey Navoykov:

What do you mean by solution efficiency?

By solution efficiency, I mean the quality of the solution in which the mechanism - and the software is undoubtedly a mechanism - will work in the most stable way. The mechanism should be clear, coherent and productive. The functionality of the engine should implement all tasks assigned to it. The mechanism does not accept anything superfluous and in the development of this mechanism, anything superfluous should be cut off.

Otherwise, there will either be no development or no efficiency.

This is just my opinion and I am not imposing it on anyone.

 
Комбинатор:

I'm not a fan of OOP.

But in terms of maintainability, scalability and ease of use by third parties, what TC (Peter, not Karputov) is pushing is just stone age.

I have a strong opinion that every programmer should work in a team, ideally more than 4 people, just to understand that efficiency and universality of code does not mean that this code is good.

Why do we need "good" but not necessarily efficient code? Programming is not "poetry" and the value of "art" is zero. Mechanisms are estimated not by their beauty but by their efficiency. The code is a mechanism.
 
Реter Konow:

I don't want to create a chorus here, but I wonder if supporters of OOP can submit some code solving a problem, where it is clearly visible that this solution is more efficient than a solution without OOP?


I am a master of solving problems without OOP and would like to fight a master of solving problems with OOP.


I will try to explain you, let's say you are a doer and you have a customer who always gives you some work to do. And then after 5-6 orders you notice that all his tasks are similar in some way... And that you can combine them into a pattern... And the customer also likes to combine these templates with each other in large quantities... And when the client again asks a difficult job, you just have to create the necessary number of instances (say, 10) of this template (class) and to each of them to set those properties (in the constructor) which occurred to the client... In the end, the decision to open an order will simply be based on a loop that will see the result in each of 10 instances, and that's it... You can rivet such orders in 5 minutes...

But you won't be able to make an instance without OOP and you will have to redo almost everything, hoping that changes won't break what you have... As a result, you will spend much more time...


Conclusion: a programmer who knows OOP will be able to solve problems (which are suitable for OOP) much faster and with fewer mistakes...

 
Nikolay Ivanov:


Let me try to explain, let's say you are a performer and you have a customer who is always giving you work... And then after five or six orders you notice that all his tasks are in some sense the same... And that you can combine them into a pattern... And the customer also likes to combine these templates with each other in large quantities... And when the client again asks a difficult job, you just have to create the necessary number of instances (say, 10) of this template (class) and to each of them to set those properties (in the constructor) which came to the client's mind... In the end, the decision to open an order will simply be based on a loop that will view result in each of 10 instances, and that's it... You can rivet such orders in 5 minutes...

But you won't be able to make an instance without OOP and you will have to redo almost everything, hoping that changes won't break what you have... As a result, you will spend much more time...


Conclusion: A programmer who is proficient in OOP will be able to solve problems (which are suitable for OOP) much faster and with fewer mistakes...

You may be right. I've never done orders and I don't know what customers want. What you are describing looks more like routine work, while it is development I'm talking about here. Probably for the routine work (which is also done by a team), OOP is irreplaceable. I have no such experience and simply do not know.

And you can give a specific example of these single-type tasks, which is better not to do without OOP?

 
Комбинатор:

I'm not a fan of OOP.

But in terms of maintainability, scalability and ease of use by third parties, what TC (Peter, not Karputov) is pushing is just stone age.

I firmly believe that every programmer must work in a team, ideally more than 4 people, just to understand that the efficiency and generality of the code does not mean that the code is good.


Oh, working in a team is a separate song! And leading a team of programmers is a song to an extent equal to the number of participants.

I'll tell you a story on a Saturday night. About the times when our firm used to dip in and out of iron. If it's repeated, I apologize, I may have already trawled through the story some time ago.

My boss summoned me and asked, 'Are you too busy at work? I said, "Not really.

-What do you do now, anyway? The chief never knew what I do, because I made myself a personal schedule, which included constant absenteeism)).

I said, "Yeah, I'm just writing a test package for our equipment. The chief was so pleased: "Great, just in time to try it in Siberia". Alexey, we have to fly over, the guys are stuck there, they can't figure it out. I loved business trips, I had complete freedom.

I fly to Krasnoyarsk, my guys meet me and look at me, they all look guilty. We went to a cafe, had a drink, got to talking. I asked him what was wrong with you? The chief was perplexed, you had been on a business trip for three months and were stuck at one point. He only has time to send you money by transfer.

Well, they're out in the open. They drove to a Siberian village, stayed at a lodging house, and there were two young sisters there. So love spun and friends got involved, so that no one would be offended.

I told them I wouldn't turn you in, I'm the same way. But we've got to keep up the pace. Let's just adjust the entire wreath, just a few miles left, 500 kilometres, then I'll give you a bonus, I'll wring the boss's money and you and these friends celebrate the New Year, okay?

Now women will be outraged, but Lekha was the first to agree, saying that my wife should give birth, I'd rather stay here for a while! Everyone was married and for some reason none of them wanted to return home.)

On the other hand, I understood in my gut how hard the guys could work when young, beautiful Siberian girls were waiting for them.)

 

This is not an argument at all.
Any task can be solved with or without OOP. Without OOP you can also easily create unified functions, which will be used many times and the whole program will not break because of changes you introduce into it. There is a bit more code with OOP. Does readability get better due to the use of O OP? I don't know.
I have each class stored in a separate file and each function also in a separate file. Just a matter of habit and convenience.

 

Another simplest example, which is on the very surface... EA generator in MetaEditor... Anyone, even if he doesn't know how to program can cobble together an EA containing a huge number of indicators and conditions in 10 seconds )))) And all this is OOP ))


 
Alexey Oreshkin:

There is nothing to argue about at all.
Any task can be solved with or without OOP. You can also easily create unified functions without OOP that will be used many times and the whole program will not break because of changes you introduce into it. There is a bit more code with OOP. Does readability get better due to the use of O OP? I don't know.
I have each class stored in a separate file and each function also in a separate file. Just a matter of habit and convenience.


Here in this thread there was an example of a problem that can be solved without OOP, but in a very irrational way.

 
Alexey Oreshkin:

This is not an argument at all.
Any task can be solved with or without OOP. Without OOP you can also easily create unified functions, which will be used many times and the whole program will not break because of changes you introduce into it. There is a bit more code with OOP. Does readability get better due to the use of O OP? I don't know.
I have each class stored in a separate file and each function also in a separate file. Just a matter of habit and convenience.

I can say for sure that I don't need OOP in my personal development, but I'm not so sure about teamwork on a big project. Developing and linking code created by different programmers has never occurred to me and I don't know how I would implement it in my own way. This is the only argument for OOP in development that I currently accept.
 
Реter Konow:
I can say for sure that I don't need OOP in personal development, but I am not sure about teamwork on a large project. The development and communication of code created by different programmers has never occurred to me and I don't know how I would implement it in my own way. This is the only argument for OOP in development that I currently accept.

This is not the main argument.

There is no equivalent of polymorphism in procedural programming.

Reason: