OOP vs procedural programming - page 44

 
Alexey Oreshkin:

because the static variable will already be updated. the function will work, but it will no longer say that a new candle has arrived.

By the way, without OOP there is no way to write in java, c#, etc.
By the way, without OOP, it is impossible to write java, c#, etc. 99% of all job offers are closed.
The same way, 99% of all good programmer job offers are closed without OOP.

There are rankings of programming languages by the number of offers from employers.

Not once have I seen any requirements to know OOP.


To me, the reason is obvious.


Any decent, large office has standards for writing code. OOP may or may not be a part of such a standard, since it doesn't solve ANY problem of organizing the work of large teams - OOP is only a part of this problem. If we take into account that in large developments the coding itself doesn't occupy more than 20% of labor input, while OOP solves part of this 20%, what are you writing about?


Here's an example from my practice today.


R compared to ICL has:

  • vector (matrix) arithmetic
  • more diverse cycles
  • loading of all cores
  • ...


So, what? Is this a reason to rewrite code from µl to R? Actually, does it give any advantage to R over µl? Not to me it doesn't. I don't see the point of the discussion at all.


So does your OOP. Some like it, some don't. OOP in itself is NOTHING.

 
Vladimir Perervenko:

Renat, one question:

Are these "amateurs" from Consortium R massively implementing R in their commercial products aware of how "disgusting" it is. You'd better give them some light. Otherwise they would be devastated.

You are good at surprising people.

Sorry for being off-topic, I couldn't get past it.

I'll apologize when you are even a little closer to the level of a professional programmer.

 
Реter Konow:
If the function call is in one file and the function itself is in another, and the two files do not have a common connection, then typing the name in the file with the call, intelligence will not give the name of the function whose definition is in the other, not connected to that file.

This also bothered me, but I came up with a solution. You can use backlinks to the main file.

 
Alexey Oreshkin:

You can take a function that defines a new bar, where there is a static variable inside that stores the time of the bar. And try to call this function more than 1 time during one candle. All times except for the first one will not work.

And in OOP you have to create a new object at each call?

Store the static variable not in the function, but in the place where it is called from.
 
aura:

And with OOP, you have to create a new object when you call from each place?

Store the static variable not in the function, but in the place where it is called from.

There are various patterns such as singleton...
You don't have to create a new object...

 
Ilnur Khasanov:

There are different patterns, like singleton...
You don't have to create a new object...

Ilnur (am I translating the name correctly?), don't scare people with such complicated terms. There are comrades here on a BASIC level )).

 
aura:

And with OOP you have to create a new object when you call from each place?

Store a static variable not in a function but in the place where it is called from.

In both cases, everything depends on the task and current context.

1. Maybe you need to create a new instance of the object each time. Perhaps it is necessary to create an object once and then just use its address. Maybe an object does not need to be created at all, just declare it and that's it (in this case, the object will be automatically created on the stack).

2. Static variables should be avoided if possible. This is not always possible, but it is something you should strive for. If you declare a static variable somewhere, it is difficult to trace all the places where you refer to it and, most importantly, change it. Static variables, as rightly pointed out here, should be stored in a special place - an object of type "signleton". This is a design pattern for objects, which can exist inside the program only in one instance.

 
Alexey Volchanskiy:

Ilnur (am I translating the name correctly?), don't scare people with such complicated terms. There are comrades at BASIC level )).


Hi,


are you talking about me?

hahahahahahahahahahah )))

 
Alexey Volchanskiy:

Ilnur (am I translating the name correctly?), don't scare people with such complicated terms. There are comrades here on a BASIC level ))

Well, for example, I want to be frightened about optimal management, by Pontryagin, about HYAB - there are absolutely no articles here about optimal management in trading...(@Rashid Umarov)
And getting scared of new things is probably the newest thing...
 
Ilnur Khasanov:
Well, for example, I want to be intimidated about optimal management, by Pontryagin, about HYAB - there are absolutely no articles here about optimal management in trading...(@Rashid Umarov)
And being scared of new things is probably the most new thing...

Very funny, I am behind the times
what is "according to pontryagin"

I'm just trying to make money, because I don't get paid)))) and I'm not jumping in theories)))

Reason: