Questions from a "dummy" - page 129

 
MetaDriver:

And pointers to structures would be very useful, and they don't have to be dynamic - the main thing is that an index array can be sorted instead of the structures themselves.

// In many cases, it is undesirable to replace structures with classes. They are economical (no virtual method table) and contain "solid" data.

In general, this is why we are going to introduce inheritance, you can always get a handle for a reversible class.
 
Urain:

Those we started with the set from which the cell is inherited, those converged into one class, then diverged again into organs and converged again into a class of people, and diverged again into professions.

I don't know about you, but normal people do not diverge into organs. Multiple inheritance is a very disputable thing, and it is not for nothing that in the most advanced C# language it was decided to refuse this mechanism in favor of interfaces. Do you think C# developers did not know what they were doing?
 
C-4:
I do not know about you, but normal people do not don ate organs. Multiple inheritance is a very controversial thing, and it's not for nothing that in the most advanced C# language it was decided to refuse this mechanism in favor of interfaces. Do you think C# developers did not know what they were doing?

What about organ donation? :)

The question is debatable and not fully closed, the fact is that C++ has multiple inheritance, MQL is positioned as C++-like language, why not.

 
C-4:
I don't know about you, but normal people do not get into organs. Multiple inheritance is a very controversial thing, and it was not for nothing that in the most advanced C# language it was decided to refuse this mechanism in favor of interfaces. Do you think C# developers did not know what they were doing?

Bazinga :)

First of all, why the hell did C# suddenly become the most advanced language?

Secondly, in C# they decided to deny multiple inheritance of classes in favor of multiple inheritance of interfaces. ))) It's easier to implement.

Go learn the subject.

TheXpert:

Not at first sight, but I've used it more than once. And practically without any variants.

I take it back. I only used virtual inheritance to eliminate the problem of ambiguous superclass choice.
 
mql5:
In general, that's why we're going to introduce inheritance, you can always get a handle for a reversible class...

...and a table of virtual methods as a burden, which is exactly what we wanted to avoid :) Otherwise the question wouldn't have arisen.

Okay, it's not fatal. I'll use an additional index array.
Документация по MQL5: Основы языка / Переменные
Документация по MQL5: Основы языка / Переменные
  • www.mql5.com
Основы языка / Переменные - Документация по MQL5
 
TheXpert:

Bazinga :)

1. First of all, why the hell would C# be the most advanced language all of a sudden?

(2) Secondly, in C# it was decided to drop multiple inheritance of classes in favor of multiple inheritance of interfaces. ))) It is easier to implement.

1) What exactly are your objections? :)

2) Let's ask for interfaces with multiple inheritance. :)

 
TheXpert:

Bazinga :)

First of all, why the hell did C# suddenly become the most advanced language?

Secondly, in C# it was decided to abandon multiple inheritance of classes in favor of multiple inheritance of interfaces. ))) It is easier to implement.

Go learn the subject.

I take that back. virtual inheritance was only used to remove the problem of ambiguity of superclass selection.

I'm not going to give arguments in favor of aggregation, I think you know them yourself. Similarly, I know the arguments in favour of multiple inheritance. And there are plenty of justifications underneath them, both on one side and the other. I guess it's a question of who is closer to what. In the case of our particular firm aggregation is much preferable, as it is easier to develop and maintain by our team.

Urain:

Those we started with a set from which a cell is inherited, those converged to one class,then diverged again to organs and converged again to a human class, then diverged again to professions.

The profession you have, it turns out, is the heir to the cage, which is somewhat (unexpectedly) true :). To determine what's best to use in this particular case, you need to determine the relationship between the two objects:

  1. Object A is object B - inheritance
  2. Object A consists of (has, contains) object B - composition

 
MetaDriver:

1. what exactly are the objections? :)

2. let's ask for interfaces. with multiple inheritance. then I'll support. :)

2. I support
 
MetaDriver:

1. what exactly are the objections? :)

Each language has its own sphere of application. Saying that a language is "the most advanced" in general is absurd.

2. let's ask for interfaces. with multiple inheritance. then I'll support. :)

Oh, come on! What difference does it make what it's called? The point hardly changes.
 

C# is definitely the most advanced language. Everything else is either too outdated or too specialised.

Multiple inheritance of interfaces is not the same as multiple inheritance of classes. The latter has a top-down hierarchy, and because of this the descendant branches can greatly intertwine with each other, causing considerable confusion and mess in the project architecture. However, interfaces inheritance is much simpler: you have unified methods, e.g. search or sorting, and if you want to hook your own class to them, write a corresponding interaction interface. This is not a crutch. This is C++ one big crutch written for the C language.

Reason: