The state of string interpolation

Atila Neves atila.neves at gmail.com
Mon Dec 10 10:55:05 UTC 2018


On Friday, 7 December 2018 at 19:52:41 UTC, o wrote:
> On Friday, 7 December 2018 at 17:11:35 UTC, Atila Neves wrote:
>> Every language change is a cost, and therefore should justify 
>> its inclusion. I personally don't think that it is in this 
>> case just to make a niche use case slightly easier, and this 
>> coming from someone from that niche!
>
> Think about `foreach`, `foreach_reverse`, UFCS, WYSIWYG 
> strings, and `switch`. These are all just so-called "niche 
> cases". When you strip out all of the syntax "niches" from a 
> language, you are more or less left with assembly. Hell, 
> assembly itself is just sugar over pure machine code! So with 
> this attitude, why not ditch D and program in machine language?
>
> It's the same case for string interpolation. It *is* possible 
> to live without it, but it is just damn nice when you have it.
>

Strawman.

My point isn't that syntax sugar isn't needed, is that in this 
case the problem is easily solved with a library (and has been), 
and doesn't apply to anything except for multiline code 
generation, which is a niche.


More information about the Digitalmars-d mailing list