3 ms·
Format strings are a technique that I think largely should be left behind anyway. String interpolation is in my experience usually shorter, easier to read and w
by norir 2y ago
Format strings are a technique that I think largely should be left behind anyway. String interpolation is in my experience usually shorter, easier to read and will always be checked by the compiler.
- jonhohle 2y agoIt’s shorter until you need any type of formatting. It’s hard to get more terse than `%8.2f`.
- gizmo686 2y agoYou can do that with string interpolation too. In python it would be: print(f"{foo:8.2f}") compared with C-style printf: printf("%8.2f", foo)
- rowanG077 2y agoAlso hard to be more cryptic. The amount of times I regoogle that syntax, or what exactly those numbers mean is basically uncountable.