-
-
Notifications
You must be signed in to change notification settings - Fork 719
feat: add streams concept #2983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @navaneedan07, @jagdish-15 has commented in #2982 to create a forum post for this one. Assuming the streams concept is added, we should also add a concept exercise to give students the chance to practice using it.
@@ -0,0 +1,13 @@ | |||
# Introduction | |||
|
|||
Imagine you’re at an airport, watching suitcases glide past on a conveyor belt. You don’t grab every bag—you scan for yours, maybe sort by color or tag, and pick only what you need. That’s how Java Streams work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the use of the analogy! Just one thing - each sentence should be on a new line (see our paragraph specification).
Imagine you’re at an airport, watching suitcases glide past on a conveyor belt. You don’t grab every bag—you scan for yours, maybe sort by color or tag, and pick only what you need. That’s how Java Streams work. | |
Imagine you’re at an airport, watching suitcases glide past on a conveyor belt. | |
You don’t grab every bag—you scan for yours, maybe sort by color or tag, and pick only what you need. | |
That’s how Java Streams work. |
Streams are part of Java’s functional programming toolkit. They help you write code that’s: | ||
- **Declarative** – Focused on intent, not mechanics. | ||
- **Composable** – Easy to chain operations. | ||
- **Lazy** – Efficient by computing only when needed. | ||
|
||
Once you start using streams, you’ll find yourself writing fewer loops and more elegant pipelines. It’s not just cleaner—it’s fun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid promoting streams over for loops here. Generally, the introduction should focus on how to use streams (see introducton.md docs), not what they offer. I'd recommend having a look at existing concept introductions like lists, datetime or randomness.
@@ -0,0 +1,25 @@ | |||
# About |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, the about.md follows the introduction.md, although it can also have more information. See the about.md documentation or the lists, datetime or randomness for examples.
@@ -0,0 +1,18 @@ | |||
[ | |||
{ | |||
"url": "https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The track targets Java 21 and older, but these links are specifically for Java 8. Have there been any significant changes to this package since 8?
pull request
Closes #2982
Reviewer Resources:
Track Policies