Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2020 22:13:11 +0100
From:      Steve O'Hara-Smith <steve@sohara.org>
To:        Tim Daneliuk <tundra@tundraware.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Multi-line text output via printf() et al.
Message-ID:  <20200514221311.9c53c472269a0ba771cffcc6@sohara.org>
In-Reply-To: <c9d3f4cd-a405-c404-8f82-cf2de5a0c9db@tundraware.com>
References:  <20200514220904.7a4c1e28.freebsd@edvax.de> <c9d3f4cd-a405-c404-8f82-cf2de5a0c9db@tundraware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 May 2020 15:44:18 -0500
Tim Daneliuk <tundra@tundraware.com> wrote:

> However you decide to do it, can we _please_ stop embedding literal
> strings in printf(), python print(), and so forth?  Strings should be
> pulled out as variables into one centrally maintained location in the
> code.  Why?

	That's a good start.

> Because, someday, you may actually want to have your code run
> with output in something other than your native language.  Because
> strings are often reused in several places in the code.  Because you may
> someday actually want to use unicode characters.

	Right, but then you'll probably want to compose strings with
embedded variable content and discover that the order is not fixed across
languages and so you need a more sophisticated interpolation markup than
printf. Then you'll bump into the nightmare that is plural and singular
forms, sometimes with multiple variants of plural. If you display lists you
will find all the fun of sorting (just look at the French rules on sorting
by accent).

	Do not get me started on truncation!

-- 
Steve O'Hara-Smith <steve@sohara.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200514221311.9c53c472269a0ba771cffcc6>