[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Re: string formatting notation



brianlheim wrote
>> syntax highlighting would help, but shouldn't highlighting be an optional
>> aid? If we need highlighting just to read the durned thing, there's
>> something wrong
> 
> OK, yes, if you write intentionally obtuse code, your code will be hard to
> read. This is not an issue with the specific notation at hand, it is a
> general code quality concern. Replace any of your complex f"" examples
> with
> the equivalent code in .format and it is still bad code.

OK, yes, it is bad code, but it is *readable* bad code -- you can see at a
glance how bad it is, instead of getting lost in braces and quotes.

f"abc = {{abc ++ f"nested string {{xyz}}"}}".postln;

->

"abc = %".format(abc ++ "nested string %".format(xyz)).postln;

Sorry, but the latter is visually easier to parse.

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/