Can we get rid of non-raw write?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Thu Mar 21 16:36:09 PDT 2013


On Thu, 21 Mar 2013 23:37:06 +0100
torhu <no at spam.invalid> wrote:
> 
> You're mixing binary and text mode functions.  read() is binary, 
> stdout.write() is text mode.  And yes, you are asking for newlines to
> be messed with, as File.write is documented to write in text mode.
> 
> But I agree that the docs need improvement.  And maybe the API.

You're missing the point. The point is that the "text mode" is
bug-prone, grossly obsolete, and completely useless and therefore should
absolutely not be the default, *if* it has any reason to even exist at
all.

We could toss a function "output" into Phobos and document it as
being "fubar mode, which converts every third word into 'DERP'", but
obviously just because its behavior matches the description doesn't
justify its existence or its usage of such a generic name. The current
"write" function is every bit as useless as this hypothetical "output"
function, but it's more dangerous because it's harder to notice
you're getting the wrong result.



More information about the Digitalmars-d mailing list