[TUHS] python

Ed Bradford egbegb2 at gmail.com
Sat Aug 5 15:40:29 AEST 2023


Thanks Larry. I've found printf a jump in usability among the
languages I've used (FORTRAN, Visual Basic, Java, PHP and a few more).
Python3's
f-strings are a major readability/suportability advance over printf. There
is nothing I know of as usable, readable, and supportable.
I have yet to find anything I can't do
with f-strings than I could with printf.

There must be some one who has pros and cons of f-strings on this list?
I would like to hear thoughts.

Ed





On Fri, Aug 4, 2023 at 2:47 PM Larry McVoy <lm at mcvoy.com> wrote:

> We did something sort of like that in Little, all double quoted strings
> look for ${anything} in the string and evaluates it and prints.  Like
> fstrings, you can do puts("Print 5 + 7 = ${5 + 7}");
>
> We used single quoted strings as pure strings.
>
> It's handy and sometimes more readable than printf.
>
> http://www.little-lang.org/little.html#String_interpolation
>
> On Fri, Aug 04, 2023 at 02:20:06PM -0500, Ed Bradford wrote:
> > To all:
> >
> > Python 3's fstrings
> >   https://realpython.com/python-f-strings/
> > seem to me to be a huge improvement over printf
> > and its close relatives.
> >
> > What are people's views about the pro's and con's and
> > how do print and strings compare in usability?
> >
> > Ed
> >
> >
> > On Wed, Aug 2, 2023 at 9:07???PM Clem Cole <clemc at ccc.com> wrote:
> >
> > > IMO (Like Larry) no printf stinks.  But the real killer for my sustain
> for
> > > Python is the use white space and being typeless.   My daughter loves
> it
> > > for her cloud development and we argue a bit.  But it was the first
> > > language she really mastered in college and she never took a
> competitive
> > > languages course so I???m not so sure really had experienced much
> beyond it
> > > for real programs.   Maybe I???m just an old fart but between C, Go
> and Rust
> > > I???m pretty good.  I do write scripts in Bourne shell and or awk
> truth be
> > > known.
> > >
> > > On Wed, Aug 2, 2023 at 8:51 PM Larry McVoy <lm at mcvoy.com> wrote:
> > >
> > >> On Wed, Aug 02, 2023 at 07:49:18PM -0400, Rich Salz wrote:
> > >> > > [Python is] meant for mainly functional programming as I
> understand it
> > >> >
> > >> > Not true. It has some neat functional features (list
> comprehensions) but
> > >> > that's not really its intent.
> > >>
> > >> I've really tried to like python but any language that doesn't has
> printf
> > >> as builtin is not for me.  Yes, I know about their library printf but
> it
> > >> is weird.
> > >> --
> > >> ---
> > >> Larry McVoy           Retired to fishing
> > >> http://www.mcvoy.com/lm/boat
> > >>
> > > --
> > > Sent from a handheld expect more typos than usual
> > >
> >
> >
> > --
> > Advice is judged by results, not by intentions.
> >   Cicero
>
> --
> ---
> Larry McVoy           Retired to fishing
> http://www.mcvoy.com/lm/boat
>


-- 
Advice is judged by results, not by intentions.
  Cicero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20230805/85cec0c9/attachment.htm>


More information about the TUHS mailing list