string interpolation fun

David Gileadi gileadisNOSPM at gmail.com
Thu Dec 13 21:27:02 UTC 2018


On 12/13/18 1:19 PM, Paul Backus wrote:
> On Thursday, 13 December 2018 at 16:58:35 UTC, Steven Schveighoffer wrote:
>> So I have a beef with the assertion from Andrei that since nobody is 
>> using the current interpolation possibilities using mixins, it 
>> translates to people not wanting to do string interpolation. And my 
>> reasoning is: if it's super-ugly and complicated, people *aren't* 
>> going to use it. The beauty of it is one of the most important parts 
>> of adding it to the compiler!
> 
> I think another big part of it is that currently, using string 
> interpolation requires pulling in a dub package as a dependency. 
> Especially in small projects, the difference between "zero dependencies" 
> and ">=1 dependencies" is pretty huge. If `interp` were in the standard 
> library (std.string, maybe?) it would probably see more use than it does 
> now (at least, I'd use it in my projects).

Having recently been doing some typescript programming, I can say that 
string interpolation is the kind of thing that grows on you. I could 
live without it, but code with it is much nicer. And more likely 
correct, as has been demonstrated in this thread.

I can say, however, that the barrier to entry of a library version, both 
in imports and in heavy syntax, are enough that I'd never use one.


More information about the Digitalmars-d mailing list