In fact, back in the 80s, the format string standard was printf , with format strings such as %d for integers or %s for strings, and obscure format modifiers (e.g. %06d , which draws an integer and pad it left with zeros until it reaches six characters). The reason was that the type C system was very bad and it was impossible for printf to guess what data was received (was it a pointer to a string? A floating-point integer), which made it necessary to indicate the type of arguments inside the format string. This approach has remained.
This format was ported from C (and C ++) to many languages ββ(Java, PHP, OCaml, Scilab ...) and several tools (e.g. Firebug console.log ).
The earliest I saw the format {0} was in C # in the early 2000s. I haven't seen it outside of C # so far.
source share