-
Notifications
You must be signed in to change notification settings - Fork 1k
Suggestions on the Scala 3 book (part 5) #2088
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
Suggestions on the Scala 3 book (part 5) #2088
Conversation
df9483d
to
f523c9a
Compare
> While an actor may live forever, a future is intended to be run only once. | ||
> While an actor may live forever, a future eventually contains the result | ||
> of a computation that ran only once. |
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 think it is important to not say things like “we run a Future
” because that maintains a confusion on the purpose of Future
(which only holds a future result, unlike a “task”, which is a computation that we can run, cancel, etc.)
Create a file named _build.properties_ in the directory `project`, with | ||
the following content: | ||
|
||
```text | ||
sbt.version=1.5.4 |
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 think it’s important to teach people to set the version of sbt, otherwise loading the build is undeterministic.
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.
Yes, good point!
@@ -49,6 +49,7 @@ Also at a high level, the differences between Java and Scala are: | |||
- Scala has a full suite of immutable collections, including `List`, `Vector`, and immutable `Map` and `Set` implementations | |||
- Everything in Scala is an _expression_: constructs like `if` statements, `for` loops, `match` expressions, and even `try`/`catch` expressions all have return values | |||
- Scala idioms favor immutability by default: you’re encouraged to use immutable (`final`) variables and immutable collections | |||
- Idiomatic Scala code does not use `null`, and thus does not suffer from `NullPointerException` |
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.
Maybe the comma is not necessary
Thanks @julienrf your changes look good to me. Maybe we can find a good solution to the |
``` | ||
|
||
|
||
### Creating the build.sbt file | ||
### Creating the build.properties and build.sbt files |
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 think I may need to look at this file when my brain is a little fresher, but at the moment it seems like I created a lot of ###
headers under the ## Building Scala projects with sbt
header, and today I find that confusing. I have another project I need to work on now, but if you’d like, I can look at this file again next week and see if it makes sense then, or reorganize it a little.
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.
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.
Okay, thanks. I just created a reminder to look at it next Wednesday.
bb1cf1e
to
6241968
Compare
e18da8b
to
923bb72
Compare
@julienrf This looks much better to me this week. :) One question: What do you think about numbering the steps, like steps in a recipe? With that, the headers will look like this:
Personally I prefer this approach whenever there is a step-by-step process, but either way is fine. |
I agree, that’s a good idea! |
Last batch of suggestions on the Scala 3 book!
@alvinj if you have some time to review, it would be great!