2

Should examples cover an broad idea exhaustively with many snippets of code, or cover a specific idea with one or a few?

For example, in the broad Java topic Streams, an example "Creating a stream" shows many snippets of creating streams from many different kinds of input. And it is likely to grow over time, because there are still more ways to create streams.

The breadth of the title would make it a good chapter in a book. But finding a snippet for one particular way of creating a stream may require reading through the entire example.

It really looks like multiple examples rolled into one. It has examples for creating a stream from a collection, creating a stream from an array, creating a stream from an iterator, etc.

Question 1: Would this be better presented as individual examples, named appropriately?

Question 2: Should the whole concept of "Creating a stream" be a separate topic?

1

1 Answer 1

1

Question 1: Would this be better presented as individual examples, named appropriately?

Question 2: Should the whole concept of "Creating a stream" be a separate topic?

I think it will vary a lot by tag and topic.

In this case, I'd say yes to both Question 1 and Question 2. Just put the "typical" approach under "Streams" with a link to "Creating a stream" where they can be voted on separately. The Remarks on "Creating a stream" could then link back to the "Streams" topic.

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