Multi-line text output via printf() et al.
Tim Daneliuk
tundra at tundraware.com
Thu May 14 20:44:38 UTC 2020
On 5/14/20 3:09 PM, Polytropon wrote:
> What is the _proper_ way of printing multiple lines?
>
> My research basically did bring up the following methods:
<Threadjack>
Warning - Pet Peeve follows, ignore me if you think it's stupid ...
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?
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.
You haven't lived until you've had to scour thousands of lines of code
looking for literal strings or having those strings embedded symbolically,
deep down in the guts of the code.
If factoring code is a good practice, so too is factoring string literals.
</Threadjack>
--
----------------------------------------------------------------------------
Tim Daneliuk tundra at tundraware.com
PGP Key: http://www.tundraware.com/PGP/
More information about the freebsd-questions
mailing list