4 ms·
> The first two might be perfectly understandable to the parser, but as a human reader, they make it more complicated and error-prone to work out which quotes d
by its-summertime 4y ago
> The first two might be perfectly understandable to the parser, but as a human reader, they make it more complicated and error-prone to work out which quotes delimit the f-string and which do not.
as also a human reader, the examples are fine?, I'm used to bash having `"$(basename "$val")"`, or XML having `<a><b><a></a></b></a>`, or python having `))))` at the end of an expression due to having a weird hate of standardized public methods
- ssl232 4y agoIf you train yourself to see a { within an f-string to mean that you should enter a new parsing context stacked upon the previous one, then it's entirely clear.
- 8n4vidtmkvmk 4y agoi haven't heard anyone quibble about nesting complex expressions in js template strings. just let it be. people will write ugly code no matter what the language allows, you can't enforce it
- BiteCode_dev 4y agoTo be fair the JS community is not as picky about his because it lived in a stage of spaghetti code since the beginning. It's fair to want to mind easing readability in the design of the language. That's one of the things that has made it so popular since its inception.