|
|
|
|
|
by AnthonyMouse
2079 days ago
|
|
A ToC doesn't actually work like an API. A ToC cares what order it's in. You can't move Chapter 4 to before Chapter 2 or the implementation has to change. By contrast, the order of functions within a class, or classes within a package, isn't really part of the API -- they're most often in alphabetical order, which is totally mechanistic, and changing the order doesn't change the API. A ToC is also not a rigid formal specification (like a recipe), but that's the core of what an API is. |
|
> A ToC cares what order it's in. You can't move Chapter 4 to before Chapter 2 or the implementation has to change.
This isn't true.
Compare: Note that real-world tables of contents behave in the second way. It's not at all uncommon to see chapters listed in order, followed by other materials (commonly illustrations) which are listed last in the table of contents while being physically interspersed among the chapters.