Discussion of article "MQL5 Programming Basics: Lists" - page 9

 
C-4:
Perhaps by "normal implementation" you mean implementation on templates.
What's that? What do you mean on templates? Some special way of pressing the keys with your fingers while programming?
 
Integer:
What's that like? What do you mean by patterns? Some special twisted way of pressing the keys with your fingers while programming?

Templates, as a legacy of the old compile-time macro substitution method, have actually lost their relevance for object-oriented programming long ago.

In modern languages such tasks are solved by runtime tools, for example, generics in C#, dynamic type recognition RTTI and the use of variant types.
There are of course still oldboys who like templates, but IMHO as a programmer it is a sign that it is time to retire.

 
revers45:

Templates, as a legacy of the antiquated compile-time macro substitution method, have actually long since lost their relevance to object-oriented programming.

In modern languages such tasks are solved by runtime tools, for example, generics in C#, dynamic type recognition RTTI and application of variant types.
Of course, there are still oldboys who like templates, but IMHO as a programmer it is a sign that it is time to retire.

It's funny to read ) templates have long gone far away from macro substitutions and exist quite successfully as a separate paradigm.

Generics in C# are just very reduced templates and actually not runtime but compilation time, due to which their speed is higher ).

But just RTTI and variant types suggest some bad thoughts....

____________________

Okay, all this is cool, of course. But in MQL5 there are only template functions, there are no classes (will there be?). So, lists on templates are not realisable with the current tools.

 
TheXpert:

Funny to read ) templates have long since moved far away from macro substitutions and exist quite successfully as a separate paradigm.

Generics in C# are just very reduced templates, and in general it is not the runtime but the compilation time, due to which the speed of their use is higher ).

But just RTTI and variant types suggest some bad thoughts....

____________________

Okay, all this is cool, of course. But in MQL5 there are only template functions, there are no classes (will there be?). So, lists on templates are not realisable with the current tools.

You are happy because fossil paradigms are your warm memories of the past century and seem to be an exhaustive baggage of knowledge.

But there is no need to eclipse modern approaches because of this, because MQs will assume that their customers are nostalgic for grandfather Macro Assembler and ANSI C and ignore suggestions for improving MQL5.
.

 
revers45, a little bit wrong, I finally figured out what I was talking about. There is such a possibility of universal function writing to ensure overloading. You don't write a function for each type of arguments, you write one function template. The guys above have badly confused something, we only have function templates here. But the conversation started with what kinds of connoisseurs, but the question about templates was asked, so silence came at once. They seem to be clever talkers, that's all.
[Deleted]  

Since there are no templates, you can do it on macros, someone I think even wrote an article on this topic (macros instead of templates) + analogue of algorithms in stl also on macros. But imho all this should be in the standard library on templates, it is wrong somehow to write your own containers (useful only for educational purposes), it is easier to do with an array.

upd: no need for algorithms on macros, function templates are available. I don't like virtual insert/... , it is better to use type-checking asserts in debug mode.

 
Downloaded the attachment many places have compilation errors such as: 'm_head' - member of the constant object cannot be modified CiSingleList.mqh 504 & nbsp; 9
 
Its a good article and I think it was written to every one in Mql5 community because every thing is clearly explained.
 
I must say this article gives a clear insight about OOP I am moved by how after I read this I gained a lot ,I take a bow
 

Hello,

I try to compile test_MQL5_List.mq5 , I got the following errors :

'm_head' - member of the constant object cannot be modified CiSingleList.mqh 504 9
'm_tail' - member of the constant object cannot be modified CiSingleList.mqh 505 9
'm_size' - member of the constant object cannot be modified CiSingleList.mqh 496 9