Discussion Thread: DIP 1036--String Interpolation Tuple Literals--Community Review Round 2
FeepingCreature
feepingcreature at gmail.com
Fri Jan 29 10:06:19 UTC 2021
On Thursday, 28 January 2021 at 06:12:14 UTC, Walter Bright wrote:
> It appears to have abandoned being usable with printf?
I suspect the sorts of people who use printf would probably
continue using explicit format strings.
There is an axis of features from, for lack of better terms,
"austere" to "luxurious". On that axis, printf is on one side and
writefln/format are on the other. Format strings are a
"luxurious" feature - like templates and DSLs, they give up
fine-grained control over the actual function calls that take
place, and in return gain expressivity and convenience. It's not
like format strings break printf; printf remains callable as
always. But if you are the sort of person who used to use a
templated print function like formattedWrite, with its deep
forest of generated code where you don't really care how it goes
from input to output so much as that it just adequately prints
the data you gave it with as little fuss as achievable - in other
words, the sort of person who would welcome and prefer inline
format strings - then you usually don't use printf to start with,
because printf is a function that is *so* unintuitive and
lowlevel that it needs its own *class* of linters.
You use printf when you want to precisely guide how your function
arguments are parsed, down to the level of stack size. I don't
think that is the usecase of format strings, and satisfying it
will probably hurt the proposal.
More information about the Digitalmars-d
mailing list