eliminate writeln et comp?

Denis Koroskin 2korden at gmail.com
Tue Mar 17 14:34:58 PDT 2009


On Tue, 17 Mar 2009 19:46:37 +0300, Nick Sabalausky <a at a.a> wrote:

> "Adam D. Ruppe" <destructionator at gmail.com> wrote in message
> news:mailman.967.1237304767.22690.digitalmars-d at puremagic.com...
>> On Tue, Mar 17, 2009 at 08:35:35AM -0700, Andrei Alexandrescu wrote:
>>> What do you think?
>>
>> Eeek. That's too much typing for a trivial, common operation.
>>
>> I wouldn't mind writefln being implemented as a macro that is turned to
>> fwritefln(stdout, ...)
>>
>> But, I'd be fairly annoyed having to write the extra seven characters  
>> each
>> time if the short version wasn't there.
>>
>
> That's how tango and C# do it.
>
> Stdout.formatln("Hello"); // Tango
> Console.WriteLine("Hello"); // C#
>
> My preference has always been for something shorter, but the current
> tango/C# ways have never really bothered me. You get used to it pretty
> quick.
>
>

That's not a very frequent operation. In most cases you should use Cout("Hello"); instead. An ideal design solution, imo (fast, short and clear).

Back on topic, in most cases I use:

debug writefln("hello");

because I have no console in release version (and it throws when there is no stdout, look in the bugzilla for a bug report). It is already long enough, so I wouldn't like it to be even longer:

debug stdio.writefln("hello");

My 0.02 rubles.




More information about the Digitalmars-d mailing list