[Python-Dev] Status regarding Old vs. Advanced String Formating

Eli Bendersky eliben at gmail.com
Sun Feb 26 09:40:03 CET 2012


On Sat, Feb 25, 2012 at 12:20, "Martin v. Löwis" <martin at v.loewis.de> wrote:

> > I find that strange, especially for an expert Python dev. I, a newbie,
> > find it far friendlier (and easier for a new programmer to grasp).
> > Maybe it's because I use it all the time, and you don't?
>
> That is most likely the case. You learn by practice. For that very
> reason, the claim "and easier for a new programmer to grasp" is
> difficult to prove. It was easier for *you*, since you started using
> it, and then kept using it. I don't recall any particular obstacles
> learning % formatting (even though I did for C, not for C++).
> Generalizing that it is *easier* is invalid: you just didn't try
> learning that instead first, and now you can't go back in a state
> where either are new to you.
>
> C++ is very similar here: they also introduced a new way of output
> (iostreams, and << overloading). I used that for a couple of years,
> primarily because people said that printf is "bad" and "not object-
> oriented". I then recognized that there is nothing wrong with printf
> per so, and would avoid std::cout in C++ these days, in favor of
> std::printf (yes, I know that it does have an issue with type safety).
>

Not to mention that the performance of iostreams is pretty bad, to the
extent that some projects actively discourage using them in favor of either
C-style IO (fgets, printf, etc.) or custom IO implementations. This is
marginally off-topic, although it does show that an initial thought of
deprecating an existing functionality for new one doesn't always work out
in the long run, even for super-popular languages like C++.

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120226/b2f86b7a/attachment.html>


More information about the Python-Dev mailing list