Thoughts on hiding challenge sections with expandable details tags
I've recently started experimenting with hiding some of the sections in a challenge, using an expandable <details>
tag. This seems to have some advantages, but I'm interested to hear how people find this - any good and bad points and general advice on how and where to use this.
I'm asking this in the context of challenges specifically, not general Q&A.
I'm not expecting this to lead to rules, just guidance on what people find easiest to use. I'm interested in hearing from people who write answers and people who browse answers, and people who do both. I'm interested in what you find useful on a first reading of a new challenge, and also what you find useful when revisiting a challenge you have already read, to see new answers.
How does this vary on different types of device - small or large screens, landscape or portrait, touchscreen or mouse and keyboard. I don't want to disadvantage one device type.
For example, I initially just hid a terminology section, but more recently I'm considering also hiding the input, output, and test cases sections, so only the introductory overview is visible.
Partially hidden example
A brief introductory overview of what the challenge is about.
Terminology
The terms used in a particular field; nomenclature.Input
- The data provided to your code
- Specific details
Output
- The data produced by your code
- Specific details
Test cases
Test cases are in the format input : output
A : apple
B : banana
C : citron
Fully hidden example
A brief introductory overview of what the challenge is about.
Terminology
The terms used in a particular field; nomenclature.Input
- The data provided to your code
- Specific details
Output
- The data produced by your code
- Specific details
Test cases
Test cases are in the formatinput : output
A : apple
B : banana
C : citrus
I think everything strictly ne …
2y ago
I don't like the partially or …
2y ago
Since the examples I've given …
2y ago
3 answers
I don't like the partially or fully hidden examples. Those require more work to see the details, instead of just scrolling on.
Anyone curious enough about a challenge from the title will want to read what it's about. Making that difficult is just annoying without any upside.
Short challenges don't need to do anything special. Long challenges can use headings to reduce visual clutter, as in your partially hidden example.
I think everything strictly needed to write or judge a solution should never be hidden. If you feel it is too large, think about how to shorten it.
Information that is not strictly necessary can be hidden if large. This includes background information that, while in principle necessary for the challenge, is likely to be known by many readers and would likely be just covered by an external link or omitted completely otherwise.
In short, the principle is:
If you can't solve the challenge without reading it, it should not be hidden.
0 comment threads
Since the examples I've given in the question are deliberately brief, they don't demonstrate the benefit of hiding a large block of text. I'm giving an example in this answer of one of my own challenges where I have used expandable <details>
sections to hide parts of the challenge wording that might be seen as optional. I'd be interested to hear where you would draw the line between what is worth hiding and what is not (or that you would hide everything/nothing).
The challenge is Balanced quinary quasiquine and I treated the sections as follows:
Hidden sections
I have hidden two subsections in the Terminology section. My reasoning was that these are both established terms ("Quinary" and "Balanced Quinary") independent of this challenge, so for anyone already familiar with a term, that subsection does not need to be read.
I also hid a later subsection called "Detailed justification" that explains why I chose the threshold I did for what counts as a trivial case. The statement of what counts as a trivial case is displayed, but the explanation of why is hidden. My reasoning was that everyone needs to know what is excluded as too trivial, but anyone who is happy to simply accept that decision doesn't need to see the reason why. The section is there for anyone who needs to know that the decision wasn't arbitrary.
Displayed sections
I have left visible the sections "Input", "Output", and "Test cases" because these are challenge specific, unlike the established terms in the terminology section. Everyone taking part in this challenge will have to read all of these sections to know what counts as a valid answer.
Reasons I considered hiding more
More recently I have tried to think about who I'm optimising for. For a person reading the challenge for the first time ready to write an answer, the decisions described above are what made sense to me personally at the time. For a person who has already posted an answer and just wants to check one specific thing (perhaps whether an alternative input format is permitted) maybe it would be easier to just expand the relevant section rather than be presented with the entire text of the challenge. There is also the perspective of someone who has already read the text of the challenge and is regularly revisiting it to see new answers. Perhaps it would be easier for them to have everything hidden so they don't have to scroll down to the answers section.
However, as Olin Lathrop's answer points out, the section headings are already there. These serve the purpose of making specific information easier to find without needing to hide their content, and scrolling is easy.
Perhaps part of my incentive for making expandable sections is that I tend to write quite long input and output specifications. I try to reduce these as much as possible before posting, but I still usually feel like the challenge wording is too long. Maybe instead of making a challenge artificially shorter by hiding some sections, I should try to get better at spec golfing.
0 comment threads