D2 port of Tango

Denis Shelomovskij verylonglogin.reg at gmail.com
Thu Nov 3 01:28:42 PDT 2011


03.11.2011 1:29, Damian Ziemba пишет:
>> >        1. Phobos has a better design (Tango is too complicated in some
>> >  places, has a lot of things I (and a regular programmer IMHO) don't use,
>> >  and has bad design decisions sometimes - both internal and user API)
>> >
> I totally disagree:)  Show me example of such bad decision.
>

Tango often asks you a buffer (e.g. at tango.text.Unicode, 
tango.text.convert.Utf) that is not needed in a language with GC. But it 
isn't a main problem. Let's consider the cases:
* if you don't provide a buffer it will manually allocate an array 
instead of using an Appender and than reallocate it etc.
* the worst case, if you provide a large enough buffer, you are (I was) 
completely sure Tango will use it (you whant to do a manual memory 
management by some reason), *but* it will reallocate a new one from GC 
if it just don't like yours (if yourBuffer.length - minimalNeededLength 
< tangoSacredAdditionLength, and addition length it often nonzero, so 
Tango will not like your exactly enough buffer).


More information about the Digitalmars-d-announce mailing list