eliminate writeln et comp?

Bill Baxter wbaxter at gmail.com
Tue Mar 17 20:40:28 PDT 2009


On Wed, Mar 18, 2009 at 12:24 PM, Jason House
<jason.james.house at gmail.com> wrote:
> Andrei Alexandrescu Wrote:
>
>> Hey all y'all,
>>
>>
>> Here's another nice bicycle shed discussion. During the recent
>> discussion about globals being harmful, Walter told me something that
>> made me think. I said, hey, there are things that are global - look at
>> stdout. He said, well, that's a bad thing. He then argued that it would
>> be better and cleaner to write:
>>
>> stdout.writeln("Hello, world");
>>
>> instead of the current:
>>
>> writeln("Hello, world");
>>
>> On one hand, I agree with Walter. On the other, I want to avoid the
>> phenomenon of the all-too-long "Hello, world" example.
>>
>> What do you think?
>>
>>
>> Andrei
>
> A lot of people have enjoyed the simplicity of using Phobos and it'd be a shame to ruin that.  writeln is extremely common, especially with gdb support broken ;)

I think if you're going to change it at all it should be made shorter,
not longer.
And for heaven's sake, don't remove the version of the function that
automatically appends a newline!  I always forget to put the dang \n
at the end of all my printfs in C, so from the very beginning I though
writefln was a godsend for that one thing alone.

--bb



More information about the Digitalmars-d mailing list