5 ms·
Counterargument: "=" is YAMLization. It prioritizes concision and an abstracted ideal of "readability"[1] at the expense of mental model and ease of use. Ever
by ajross 4y ago
Counterargument: "=" is YAMLization. It prioritizes concision and an abstracted ideal of "readability"[1] at the expense of mental model and ease of use. Every non-obvious feature like this has cost. Every user who sees this for the first time is going to be confused. Every time a language or syntax adds a "shorthand" feature like this it makes itself less accessible.
And in this case I think the value is really pretty low. That particular "=" syntax is really mostly just useful for dumping runtime state at debug time. And the world is filled with tools that can do that for you with even more concision.
[1] Which doesn't really correspond to general comprehension. It means something more like "readability for experts".
- pbourke 4y ago> It prioritizes concision and an abstracted ideal of "readability"[1] at the expense of mental model and ease of use. That statement applies to all format strings, which are by necessity a small internal DSL. For the = syntax, the input is copied directly to the output with the value of the variable appended. Within the realm of language features, sure it's one more chocolate wafer of syntax. Within the realm of format strings, it's certainly more straightforward than the type conversion and padding syntax. > That particular "=" syntax is really mostly just useful for dumping runtime state at debug time. In scientific / ML development that's like 80% of the work.
- deleted 4y ago[deleted]
- pantsforbirds 4y agoIt's an extremely useful pattern for me when logging to be honest.