11

I recently answered the question Which football matches had the highest combined number of goals?. In my answer I exposed some relevant results using the code block format so I could emphasize the drama of the scores:

Micronesia  0 - 30 Tahiti       3 July 2015
Micronesia  0 - 38 Fiji         5 July 2015
Vanuatu    46 -  0 Micronesia   7 July 2015

However, it was edited later on to leave it like this:

  • Micronesia 0 - 30 Tahiti 3 July 2015
  • Micronesia 0 - 38 Fiji 5 July 2015
  • Vanuatu 46 - 0 Micronesia 7 July 2015

Then this discussion followed:

Please do not use codeblock for anything that is not actual code. – Nij

@Nij there are cases where it helps showing the info better. This was one. – fedorqui

Codeblock does not present information more clearly than either a quoteblock, a list, emphasis, or some combination of them. It actively harms presentation for people with screenreaders and those who cannot differentiate black from the grey as well as they can differentiate the colours they have preset, both of which the codeblock can interfere with. – Nij

@Nij I agree in general, but not in this case. Your revision made the post look worse than better in my opinion. Once I am back in a desktop computer I'll try to fix the format. – fedorqui

@Nij see for example classifications in the IAAF page: iaaf.org/competitions/iaaf-world-championships/… They tend to use this kind of format. Since Stack Exchange does not allow tables, codeblock is the most similar format to show such pieces of info. Let's see if Sports Meta can get us to some kind of consensus. – fedorqui

I don't think you get it. This is not about individual cases of things that might make content look a little better when they are already usable, it is about an entire class of things that actively prevent content being used at all. Codeblock is for code - and nothing else. – Nij

Since we are apparently far from agreeing, I am bringing this debate to Meta so we can get some consensus.


While I agree with Nij on his statement that code blocks are to be used for code, I do not think we should ban it so firmly.

It actively harms presentation for people with screenreaders and those who cannot differentiate black from the grey as well as they can differentiate the colours they have preset, both of which the codeblock can interfere with.

I don't think this is specially relevant and we would need some statistics on people that may see this differently, to make it a statement worth taking into consideration. I have not experience with screenreaders myself, so we should know how many people are using those to access the site (not many I guess).

Codeblock does not present information more clearly than either a quoteblock, a list, emphasis, or some combination of them.

To me, in this case nothing but a code block could emphasize better the results. Let's see other options:

  • Micronesia 0 - 30 Tahiti (3 July 2015)
  • Micronesia 0 - 38 Fiji (5 July 2015)
  • Vanuatu 46 - 0 Micronesia (7 July 2015)

It does not show very badly, but it still misses the nice fixed display that codeblock offers.

I did some research on how code format and code blocks are used among other non-coding sites from Stack Exchange:

Across most of the Stack Exchange network, inline code formatting (like this) is often misused for emphasis, but it's really intended to mean something you can type in at a computer that will have a special effect — a filename, a command at a prompt, program source code, or something similar. Since we very seldom need to refer to any of those things on ELL, it should be very rarely used. Similarly, there's little reason to use preformatted/code blocks, except for things like types of poetry that rely on line spacing.

It can be useful, for instance, when you are quoting poems which may use special indentations, using several spaces. In the simple HTML this editor allows, "several spaces" are not easily done.

I am against. For one thing, I really need code formatting sometimes, as in Proto-Indo-European roots, where Markup (or what is it called?—asterisks and such) messes up my words. Then there are other uses. There is no serious problem (just looks) and removing any kind of functionality will not only mess up older questions but also limit what we can do, in both foreseen and unforeseen ways, as above.

This gives us the idea to get Nij's formatting right:

  • Micronesia  0 - 30 Tahiti       3 July 2015
  • Micronesia  0 - 38 Fiji         5 July 2015
  • Vanuatu    46 -  0 Micronesia   7 July 2015

Which needs some terrible formatting-fu:

* Micronesia  0 - 30 Tahiti       3 July 2015
* Micronesia  0 - 38 Fiji         5 July 2015
* Vanuatu    46 -  0 Micronesia   7 July 2015

Also, following the example on IAAF's results I mention in the exposed comments, in my answer to Did an athlete lap the rest of the runners after an illness that left him in bed for a long time before the competition? I used the same formatting and cannot think in any that serves the purpose better:

Oslo 1946 - 10,000 metres. Difference of 39 seconds.

1st, Viljo Heino   Finland    29:52.0 CR
2nd, Helge Perälä  Finland    30:31.4 

Brussels 1950, 10,000 metres. Difference of 1 min 9 seconds.

1st, Emil Zátopek  Czechoslovakia 29:12.0 CR
2nd, Alain Mimoun  France         30:21.0 

Also interesting the 5,000 metres, with a difference of 23 seconds:

1st, Emil Zátopek  Czechoslovakia 14:03.0 CR NR
2nd, Alain Mimoun  France         14:26.0
3rd, Gaston Reiff  Belgium        14:26.2
4  Väinö Mäkelä    Finland        14:30.8

All together, it boils down to formatting and showing data properly, which is something just code blocks guarantee.

Since tables are not available in Markdown, how should we format results? I vote for using code when necessary.

6

I think the network consensus (old, but still pretty much valid as far as I know) can be summed up as:

  • A lot of people would like a better way of doing tables.
  • Until there is, preformatted text is the best of a bad bunch of options.

Given that preformatted text is pretty ugly (and comes with its own set of accessibility drawbacks), I'd try hard to avoid it where possible. Sometimes it really is necessary to convey the information, but I don't think that it's required for three football scores so I'd personally just leave that one as normal text.

  • 2
    +1. I used codeblock/preformatted on this answer because it was the best way I could think of to represent a table, but I try to avoid it in answers when I can find another way. – Ben Miller Jul 24 '17 at 14:02
4

Until SE introduces table formatting, codeblocks are the best of the available tools to mimic tables or results that better to be demonstrated as tables. Just because codeblocks were initially meant for code blocks doesn't mean that we cannot use them as well. Similarly, back in the days, this network was meant for developers, but then it grew and opened its doors for experts in many other areas as well.

That being said, I completely disagree with @Nij's answer, because:

  • Images are neither searchable nor editable and nonsearchability is actually the primary reason why we can't have YouTube videos embedded in our posts. I have used this approach when answering to this question, but editing my answer after Real Madrid won the Champions League was one of my worst experiences on this site (it took me more than an hour to add a single line).

  • Also, I don't think that we are abusing format tool, because it's just there! If that considered as an abuse, the SE developers would probably remove the codeblock formatting button from the text box for communities like ours.

Finally, Sports SE is about sports that involve competition in them. Nearly every competition needs tables for statistical purposes. Now, as a community which is desperate for tables but doesn't have them due to technical reasons, I think for now it's our essential right to use codeblocks in order to decently mimic tables.

  • 2
    This is a great insight, thanks for expanding so well on my argument that codeblocks are not just for code. – fedorqui Aug 7 '17 at 13:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .