-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Size and style of slides in v2 #1464
Comments
This was related to an issue where the playground text gets reset when you navigate away from a slide. |
Oh, great point! I created #1476 about this. |
The big red rectangle is from the aspect-ratio-helper, enable it in [preprocessor.aspect-ratio-helper]
command = "./aspect-ratio-helper.py" |
@mani-chand do you want to start with a PR for the "Control-Flow Basics" segment? The sub-slides should be embedded under the first slide: diff --git src/SUMMARY.md src/SUMMARY.md
index 43adb7b0..a1644cf7 100644
--- src/SUMMARY.md
+++ src/SUMMARY.md
@@ -27,16 +27,18 @@
- [Arithmetic](types-and-values/arithmetic.md)
- [Strings](types-and-values/strings.md)
- [Type Inference](types-and-values/inference.md)
- [Exercise: Fibonacci](types-and-values/exercise.md)
- [Solution](types-and-values/solution.md)
- [Control Flow Basics](control-flow-basics.md)
- [Conditionals](control-flow-basics/conditionals.md)
- [Loops](control-flow-basics/loops.md)
+ - [`for`](control-flow-basics/loops/for.md)
+ - [`loop`](control-flow-basics/loops/loop.md)
- [`break` and `continue`](control-flow-basics/break-continue.md)
- [Blocks and Scopes](control-flow-basics/blocks-and-scopes.md)
- [Functions](control-flow-basics/functions.md)
- [Macros](control-flow-basics/macros.md)
- [Exercise: Collatz Sequence](control-flow-basics/exercise.md)
- [Solution](control-flow-basics/solution.md)
# Day 1: Afternoon and the content broken up into files in a subdirectory, without the diff --git src/control-flow-basics/loops.md src/control-flow-basics/loops.md
index 352c08af..2085146b 100644
--- src/control-flow-basics/loops.md
+++ src/control-flow-basics/loops.md
@@ -18,46 +18,15 @@ fn main() {
let mut x = 200;
while x >= 10 {
x = x / 2;
}
println!("Final x: {x}");
}
```
-## `for`
-
-The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over
-ranges of values:
-
-```rust,editable
-fn main() {
- for x in 1..5 {
- println!("x: {x}");
- }
-}
-```
-
-## `loop`
-
-The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just
-loops forever, until a `break`.
-
-```rust,editable
-fn main() {
- let mut i = 0;
- loop {
- i += 1;
- println!("{i}");
- if i > 100 {
- break;
- }
- }
-}
-```
-
<details>
- We will discuss iteration later; for now, just stick to range expressions.
- Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for an
inclusive range.
</details>
diff --git src/control-flow-basics/loops/for.md src/control-flow-basics/loops/for.md
new file mode 100644
index 00000000..c9e46b89
--- /dev/null
+++ src/control-flow-basics/loops/for.md
@@ -0,0 +1,12 @@
+# `for`
+
+The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates over
+ranges of values:
+
+```rust,editable
+fn main() {
+ for x in 1..5 {
+ println!("x: {x}");
+ }
+}
+```
diff --git src/control-flow-basics/loops/loop.md src/control-flow-basics/loops/loop.md
new file mode 100644
index 00000000..544897ea
--- /dev/null
+++ src/control-flow-basics/loops/loop.md
@@ -0,0 +1,17 @@
+# `loop`
+
+The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just
+loops forever, until a `break`.
+
+```rust,editable
+fn main() {
+ let mut i = 0;
+ loop {
+ i += 1;
+ println!("{i}");
+ if i > 100 {
+ break;
+ }
+ }
+}
+``` |
(Use your judgement to break the speaker notes up; I didn't do so in the example above, where the note about "for" loops should be on the "for.md" sub-slide) |
At first , I will be starting from |
I don't think that achieves the goal of creating more, smaller slides. |
If we write 3 loops in same function. we can add more content to it because we will save a lot of space in slide trust me. Give me your suggestion too in making them into 1 segment. |
Do you want me to write 3 functions in 1 segment. |
No For this and other slides that do not fit within the red square, the slides should be split into multiple slides, each covering a different part of the content from the first slide. |
You want me to make slide for each type of loop respectively. i.e : am I right? |
Yes, and I gave an example of how to do that above. |
Yes, I got it now. I will be starting in 30mins. |
Updated the content for space issue . #1464 issue.
#1464 issue . Let's limit this section to arrays and tuples. Destructuring in structs explained in [Day-2 Morning]((https://google.github.io/comprehensive-rust/pattern-matching/destructuring.html)).
#1464 issue. --------- Co-authored-by: Martin Geisler <[email protected]>
@mgeisler What do you think about creating automated analysis and / or scoring of each page to have a good understanding on the statistics of the slide size, find violations for a (yet to be defined) policy (using the observations from your first comment in this issue)? This could improve the course material a lot according to your observations in live in-person classes |
To document how I would imagine such an automation, one could use selenium via webdriver with the crate fantoccini that offers methods like Element.rectangle(). Of course there might be other solutions and languages but overall this could be one approach. |
Yes, I would love such a system and I think it would be a very fun task to implement 😄 It should not be a hard check in CI at first... I imagine a command which people can run locally to quickly tell find the tallest slides. That would be a great help here. We can then target those first with a refactoring effort. |
Large Slides
Many slides are now bigger because they include more details.
What is the strange red rectangle? It's the "aspect ratio helper" which you can enable in
book.toml
. From a bit of experimentation in a meeting room, this rectangle shows roughly how much content we can fit on a screen.The existing slides don't always fit! They have gained weight over time, as more and more facts and details have been added. That's very relatable and a comes from a good place: people want to cram in as much great information as possible 🙂
An example from the new course is the pages on structs. It used to have 21 lines of code and it now has 30 lines. It didn't fit super well before, and now it's really too large:
My impression is that less than 10 lines of code is best. 15 lines can work, but then you only have room for 1-2 lines of output!
Combined Slides
Some slides in the new course combine content what was shown on separate slides before. Compare
Funny enough, this style was actually how I wrote the very first version of the course 😄 I thought I could have ~10 long-form pages, each covering a bigger theme. I was then going to scroll down on the page during class.
However, the feedback from the initial review was that this would be hard to follow in class. Later, I've seen people struggle to follow along on the current slides that are too big. Scrolling up and down on a large screen in projected in front of 20 people is bad experience.
The effect of scrolling is likely not visible when teaching a remote class to participants far away — many of whom have their camera turned off. But I've seen it throw people off in a live in-person class.
Existing Style
The style I tend to follow in all my presentations is this:
I find that this gives a nice consistent look. I like that there is a single line of regular text to kick the slide off and give a tiny bit of context. It also feels less jarring than jumping from a heading to a list/images/codeblock (you would never start a section in a paper with a list, you always have a paragraph of body text before jumping into something else).
We should use very short sentences in any body text or lists.
I haven't followed this perfectly, but those are the underlying thoughts.
The text was updated successfully, but these errors were encountered: