<p>Am 05.12.2016 12:01 schrieb "denisgolovan" <<a href="mailto:denisgolovan@yandex.ru">denisgolovan@yandex.ru</a>>:<br>
><br>
>  <br>
> 05.12.2016, 13:35, "Sven Barth" <<a href="mailto:pascaldragon@googlemail.com">pascaldragon@googlemail.com</a>>:<br>
>><br>
>> I really don't get why some people think of generics as complex -.-<br>
><br>
>  <br>
> Exactly for the cited reason. See below.<br>
>  <br>
> > Using plain old arrays, requires reinventing the wheel because you end up<br>
> > writing duplicate functions for each array type (array of string) instead<br>
> > of a general purpose algorithm for many types..<br>
>  <br>
> It's not possible to get uniform interfaces that would play nice with algorithms.<br>
><br>
> Try writing a _single_ function for sorting static arrays, dynamic arrays,open arrays, generic containers(T*List * all value types).<br>
> The standard recipe is re-implement everything from scratch over and over again.<br>
> Even now, when we have generic functions - I am forced to specialize them by hand! Even C# got it right...<br>
> Another issue is that some special functions are considered "special" - you cannot overload them (SetLength, Copy, ...).<br>
> Yet another thing is that arrays are nice value-pretending types (refcouting), but most generics are classes!<br>
> We desperately need <a href="http://bugs.freepascal.org/view.php?id=30687">http://bugs.freepascal.org/view.php?id=30687</a> to get record based generics value types back to the language.<br>
>  <br>
> Basically it's all about combinatorics when combining functions.<br>
> Either compiler does it for you, or you are forced to do it manually instead.<br>
>  <br>
> To sum up, generics in current implementation add too little while exploding combinatorial variety of algorithms.<br>
>  </p>
<p>Again: I don't see why anyone thinks of generics as complex. Your mail did not answer that in any way.</p>
<p>Regards,<br>
Sven</p>