I think dynamic arrays are really elegant features of Pascal and a strong 
benefit versus C. However, when working with large projects one encounters 
situations where one wants more. control. I would advocate allowing developers 
to optionally use SetLengthNoInit and also allowing user to specify the 
alignment of dynamic arrays - see issue 0034031. In real world large projects, 
one encounters situtations where both features are useful. While one could use 
GetMem for these features, it makes the code less maintainable when some use 
cases are ideal for dynamic arrays and others for GetMem. These tiny changes 
would not impact normal users, but allow power users to use this one elegant 
design for a wide array of use cases. Web searches for "Speed "problem" with 
SetLength” and "Faster way of initializing arrays in Delphi” suggest others 
encounter these issues as well.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to