2 ms·
Agreed. There are things that languages must get right at the very beginning or be plagued by inconveniences forever. This is one of them. I got a number of bug
by pmontra 4y ago
Agreed. There are things that languages must get right at the very beginning or be plagued by inconveniences forever. This is one of them. I got a number of bugs and test failures because I forgot an f before a string with interpolated values.
Python is rooted in the 80s. Maybe Guido didn't get the idea because maybe his background was only with languages without interpolation. Example: C has argument replacement with printf("%d", 42) and no interpolation.
- sakjur 4y agoI think I would keep the f-prefix if I were to do a Python dialect from scratch with lessons learned. Making { a special character in any string seems excessive and prone to user injected rogue values that are hard to catch in all places of a large system. Having the slightly safer types of strings be the default seems prudent.
- henrydark 4y agoIt's interesting to note that the creator of C and his well known friend also created m4 in the 70's, and it's very similar to "string interpolation", maybe even taken to the extreme. I was actually program-wise "raised" by The C Programming Language in the early 90's, and I only found out about m4 a month ago.