Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Format strings are very useful, so I'd suggest fixing the language to let you use them. You don't have to live with it interpreting them too early!

Even better, you should be interpreting them at time of reading the log, not when writing it. Makes them a lot smaller.



> you should be interpreting them at time of reading the log

This reminds me of a fun interaction in browser devtools: you can log a complex struct to the console. The browser does not copy the entire nested structure when you do so immediately, meaning that if someone mutates that struct after it was logged, the value you see depends on when you expanded the nested struct.


The thing is, the logging calls already accept variable arguments that do pretty much what people use f-string in logging calls for already, except better. People see f-string, they like f-string, and they end up in logs, that's really all there is to it.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: