Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are "Tony Tables"?

Tags:

c++

The following sentence is excerpted from the GitHub page:

C++20 features described in Before/After tables ("Tony Tables")

  1. What are Tony Tables in the C++ culture?

  2. Why are they used to indicate Before/After tables?

like image 529
xmllmx Avatar asked May 21 '20 13:05

xmllmx


1 Answers

Tony Tables are, to a certain extent, 'just' before/after tables. Show what code would look like without a certain function or feature, and show what it would look like with the feature.

They were originally used in this C++ proposal: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0032r3.pdf (see the appendix) to make it more clear what changes the paper was proposing. (Compare the R2 version of the proposal to the R3 version in terms of clarity.)

With a bit of prodding and patience, it became apparent to the committee that using tables could improve the understanding of proposals and speed up the committee process.

The goal of the tables is not just to show before/after. True "Tony Tables" should also:

  • show motivation: the example code shouldn't just show syntax, it should show motivational code, realistic code that makes it clear that the feature is worth doing
  • show ALL important syntax: the table should have enough examples to cover approximately all syntax of the feature (not really all - it can skip anything obvious, like a copy ctor - if it is obvious in this case - but should cover anything worth looking at)
  • align the lines: any lines that are the same before and after should line up - add blank lines as necessary. It should look somewhat like a diff.

The real goal is to be a "one stop shop", vs the multitude of sections in a traditional committee paper (see http://open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3370.html#Organization for how a traditional paper is organized).

In the past, the Motivation section was too wordy, and the Technical Specification section too dense. We still need these sections, but most of a paper should be grokkable from the table (which is why the table has moved from the Appendix to the front of most papers).

The goal of almost every committee paper is to change how C++ code is written, so showing how actual code would change can impart a ton of clarity to the process.

And beyond the committee, the tables have been used to describe new features (see https://github.com/tvaneerd/cpp17_in_TTs for C++17 over C++14, and make PRs for https://github.com/tvaneerd/cpp20_in_TTs because C++20 is huge!).

There is no real reason to call them "Tony Tables" (I think David Sankel was the first to call them that). They are Before/After tables. The only "value add" that the term "Tony Table" has is to capture the full concept of what is expected from the table, besides the narrower definition of "Before/After".

P.S. for C++23 they are begin replaced by Pony Stables. https://isocpp.org/files/papers/D2349R0.html

like image 160
tony Avatar answered Oct 17 '22 17:10

tony