Replies: 0 comments 8 replies
-
FWIW my understanding is that TypedArray is not a subclass in the spec, though it may be under the hood used as such. It's a convenient name to reference a whole bunch of things that just happen to have the same kinds of behaviours. You make a good point that there is a lot of duplication. IFF we can verify that all the included types should always have exactly the same description then we could link from each of the sub-array types to the parent. |
Beta Was this translation helpful? Give feedback.
-
This is worth discussing, but I don't think we should act on this too early. This has so many implications (for maintenance, for authors, for readers, …) that we should be careful. Also, we have so many moving parts that I think we should wait a bit (read: end of the year, maybe? Surely not in Q3 2022): it is difficult to cope with all the fundamental discussions and updates of MDN. Let's finish some of the Demix events, the page type, the JS modernization, the ESLint/Prettier automation (and there are several more!) projects before moving to this. We still have some dictionaries to remove, to finish fixing sidebars and header banners, … Sorry to slow this down, but we need to avoid starting everything and finishing nothing 😃 MDN was born 17 years ago and will still be there in a few months: we have tackled so many problems/opportunities since its inception. |
Beta Was this translation helpful? Give feedback.
-
I consider these two pages to be exemplary cases of what I would like to suggest redoing:
They have one thing in common: they both have a lot of subclasses that no nothing different, or very little different, from their bases.
Currently, keeping their subclass' pages in sync with each other seems error-prone and tedious, because they should be near exactly the same, save for the name of the subclass used in place of the original, and specialized examples (particularly for the TypedArrays).
For example, I was about to add the error cases for the TypedArray constructor. There are about 4 or 5 error causes, 2 of which are located at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#examples. Now, I was going to add them to each subclass' constructor page, under parameters in an "Exceptions" section... but if the errors are all the same, why should this be duplicated? The parameters are already duplicated, but these two errors in
#examples
already gives us a mismatch between how most other pages are handled.Could something be done to improve these cases?
There are 11 TypedArray constructors, and 11 Error subclasses. Of these subclasses, the only one to have any real divergence from the general behaviour would be
AggregateError
, for which I would say that it deserves its own page.Beta Was this translation helpful? Give feedback.
All reactions