Phobos vs Tango! What's your opinion?
Alexander Panek
a.panek at brainsware.org
Wed Apr 18 10:18:14 PDT 2007
Deewiant wrote:
> Alexander Panek wrote:
>> Deewiant wrote:
>>> [...] I don't quite agree with this, but I do prefer free functions in
>>> many cases. I
>>> can accept having a File class for "heavy-duty" file handling, but I
>>> still find
>>> myself missing a simple function for just dumping an ubyte[] array of
>>> a file's
>>> contents.
>> http://dsource.org/projects/tango/docs/current/tango.io.File.html
>>
>> auto contentOfAFile = (new File( "filename" )).read;
>>
>> There you go.
>
> Of course. But I feel uneasy with throwaway objects, like I'm fighting the
> library. There's probably no good reason to, but I do.
>
I can understand that. I've got an issue with throw away objects, too,
but given the fact, that you just want a file's content no matter what
format it is... the whole process is a bit hackish, and I'd recommend to
use other, less hackish solutions of tango's IO package. Even if that
would mean two lines of source code more, you won't have throw away, and
a proper, tested way of reading data from a file.
Kind regards,
Alex
More information about the Digitalmars-d
mailing list