Namespaces
Variants
Actions

Talk:cpp/io/ios base/width

From cppreference.com
< Talk:cpp‎ | io

[edit] Example code

The code sample on this entry, while a bit off-topic for the purpose of simply demonstrating std::ios_base::width, is nevertheless a nice bit of recognition for some of the prominent figures to whom every programmer owes a debt.

It's also significantly wider than the site template, which sort of diminishes the effect.

Because of that, I'd propose that we:

  1. Eliminate the completely unnecessary day-of-the-week names, in the dates shown
  2. Drop Dennis Ritchie's middle name, which he never really used professionally
  3. Narrow the first three columns from a width of 30 characters each to 20, 20, and 18

All in all those changes would result in this output, which easily fits the width of its container:

--------------------------------------------------------------------------------
| Name | Birthdate | Death date | Language Created |
--------------------------------------------------------------------------------
| Dennis Ritchie | September 09, 1941 | October 12, 2011 | C |
| Bjarne Stroustrup | December 30, 1950 | | C++ |
| Anders Hejlsberg | December 02, 1960 | | C# |
| Guido van Rossum | January 31, 1956 | | Python |
| Brendan Eich | July 04, 1961 | | Javascript |
--------------------------------------------------------------------------------

Any objections? Or should I just Be Bold™? -- FeRDNYC (talk) 06:06, 6 January 2021 (PST)

Done.
I think reducing the name of (great) Dennis Ritchie's would be enough. His middle name does not fit well in the table. From the other side, the weekdays formula although not being quite relevant for this example is still has its own value. Thanks for suggestions. --Space Mission (talk) 13:31, 7 January 2021 (PST)
close