whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
7.95k stars 2.6k forks source link

"in parallel" in algorithm headers can be confusing #10049

Open domenic opened 7 months ago

domenic commented 7 months ago

What is the issue with the HTML Standard?

Sometimes we have algorithms where the entire algorithm runs in parallel. Often, instead of writing the algorithm as

To do X:

1. Perform the following steps in parallel:
   1. ...
   2. ...
   3. ...
   4. ...

we write

To do X, perform the following steps in parallel:

1. ...
2. ...
3. ...
4. ...

However, this can be confusing. It's easy to visually miss the in-parallelness of the steps.

Should we consider moving to the former style, even though it's a bit ugly?

Cases of this I found in the spec:

/cc @domfarolino

annevk commented 7 months ago

I think this also applies to "switching" and maybe some other things we sometimes inline.

If it makes it harder to read for folks I'm not opposed to inline less. And generally we probably should as we also try to put more in the algorithm header such as types and often return types (although return types don't apply to in parallel of course).