4 ms·
I do not have a counter-example, and think that in this case, a monospaced font is necessary for good presentation. However, I'd not format this code in this s
by gkya 13y ago
I do not have a counter-example, and think that in this case, a monospaced font is necessary for good presentation. However, I'd not format this code in this shape in the first place, instead list them linearly with line breaks where due:
atom_symbols ::=
'H' | 'He' ... 'Na' |
'Be' ...;
This way it is easier to edit, automatically wrap (not meaning that the periodic table will change drastically soon, but this might have been a table of sth. else) and read the snippet. This is more of a matter of personal delight though.
- dalke 13y agoNow you're throwing away data in preference of your own beliefs. That's a dangerous path. Of course if this is a table of something else then it might be okay to use a different formatting. But that I could easily give a counter-example, suggests that there are plenty of counter-examples. You argue that a linear list, without spacing, has advantages. My assertion is that you don't have the experience to make that judgement. Anyone using this layout will have chemistry experience, and often decades of practice of looking at the periodic table in standard form. When I consider at your suggested layout, I find it a bit jarring. For one, the symbols you wrote are out-of-order, which means it's hard to infer some information from the table. For example, what is the age of the this instance of the table? A chemist knows, from experience with the standard periodic table layout, and my use of that layout, that Rg is the newest element on the list. This immediately places it as a pre-2009 table, which means I should update it. Here's an example from Python heapq.py implementation, rewritten slightly to work in HN (I switched from triple-quoted strings to '#' comments): # The strange invariant above is meant to be an efficient memory # representation for a tournament. The numbers below are `k', not a[k]: # # 0 # # 1 2 # # 3 4 5 6 # # 7 8 9 10 11 12 13 14 # # 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 # # # In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'. This is a tree structure layout in ASCII. It's useful information, and it can't easily be structured or represented in a proportional font.