[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] Re: string formatting notation
> But in the 99% of cases where people are using [interpolation], the
> boundary between code and string literal is very clear, and your original
> complaint was that it's not.
I tend to agree with you here, and I'm not going to press the point further
-- except to note that any properly engineered new feature needs to consider
extreme/boundary cases. I'm not satisfied to present a few simple cases and
say, "This is wonderful." IMO we have to be aware of the point where it
breaks down -- if legibility is the criterion, then, when do the embedded
expressions become unwieldy? I'm guessing that point will be when the
expression reaches about 20-30 characters.
> One clear advantage of string interpolation is that it's harder to screw
> it
> up at runtime. With format, it is easy to write:
>
> "hello world".format(3)
> "hello %".format("world", "pony")
> "%: Error '%' at line %. Saw % flowers, no bugs.".format(name, err, line,
> flowers, bugs)
>
> And you won't even get so much as a warning that you provided too many or
> too few arguments.
*This* is a more compelling argument (though a possible counterargument is
to offer a warning).
hjh
--
Sent from: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/SuperCollider-Users-New-Use-this-f2676391.html
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/