[Rust Syllabus] Which Exercises/PRs cover only concepts from chapter 3?

bird-watcher

I need to be taught:

  • instantiating an array
  • indexing into an array
  • looping over an array

Plus a couple of things that are part of other exercises. (We haven’t really discussed dependencies among the exercises yet)

assembly-line I’m unsure about, both in terms of analysing the “I need to be taught part” and adjusting it. The example file uses match, which is inappropriate at that stage. cars-assemble has an almost identical task. I think these two should be merged / the PR for cars-assemble should update assembly-line instead of introducing a new, almost identical exercise.

I’ll give it a shot to update lucians-luscious-lasagna.

2 Likes

I will try to make the necessary updates based on the feedback here to my PRs. This is a long thread to read :sweat_smile:.


I posted this somewhere else but I’ll clarify again, The reason there are exercises like cars-assemble identical in story to existing exercise assembly-line is because when I first started working on concept exercises, these did not provide me with enough resources and introduction to solve it as per their exemplar.rs.

Most of them were lacking in documentation and exemplar almost always used concepts never/sparsely introduced before. They felt more like a practice exercise to me.

Now, I didn’t know at the time how concept exercises are supposed to be structured, over time I got the feel for it.

Learning what existing material is and trying to figure out how to make it better would have taken far more efforts than just jumpstarting from scratch. For instance, to learn how & where to split existing concept exercises to smaller consumables, I’d have to understand their dependencies, what they claim to teach, what they actually include in introduction.md & about.md, what kind of hints.md are available, etc. and most importantly know just enough Rust (which I didn’t).


Regarding what to do with identical stories, precedence shows identical stories can be used to cover different concepts, e.g. wizards-and-warriors and wizards-and-warriors-2 in csharp track. However, I don’t know if this is a result of a rushed syllabus or an acceptable standard. :person_shrugging:

I don’t think it matters why there are two basically identical exercises, it just needs to be fixed. The csharp examples use the same / similar story to teach different concepts. (It seems to me one introduces inheritance, the other builds on that with advanced features of inheritance.)

The two exercises in question here use the same story, to teach the same concept with the same task. The learning objectives are identical: integer and floating point literals and type casting.

As a side note, the as keyword (used in the two assembly exercises) is never really explained in the book. Certainly not in chapter 3. The first place I can find it is in chapter 13, which is an advanced section dealing with the performance of iterators. The as keyword is just part of an example and not at all explained. It also apppears in the appendix, but only its purpose is explained, not how it works. The first actual explanation I’ve found of how the as keyword works in the context of float to integer conversion is in the reference (read: not suited for beginners).

I’m personally of the opinion that using type casting with as for conversions is bad practice anyway. There are readily available footguns (playground), which I’m guessing is the reason the book doesn’t teach it in the first place. There are also safe, footgun-less conversions between integer types and from ints to floats via the From and TryFrom traits. Casting from floats to ints is asking for trouble and we shouldn’t push that on students at this stage in my opinion.

@iHiD maybe you consider this off-topic? I’d like to avoid Dinesh having to put in a lot of time polishing an exercise that we later find out has to be largely redone or even thrown out because it doesn’t fit the plan of following the book.

Luckily, I think cars-assemble can be adjusted to not need type casting at all with just a small change. I’ve left a suggestion on the PR.

PR for luscians-luscious-lasagna is here.

I had some time today, tried to address most of the feedback here. I’ve updated the following PRs

  • bird-watcher I believe the introduction.md already addresses aforementioned points.

@isDineshHere @remise Thanks! I’m absolutely overloaded this week, so won’t have chance to look immediately, but I’ll get to it. If others want to leave comments in the meantime that’d be great.


@iHiD maybe you consider this off-topic? I’d like to avoid Dinesh having to put in a lot of time polishing an exercise that we later find out has to be largely redone or even thrown out because it doesn’t fit the plan of following the book.

Thanks for this. @ErikSchierboom Do you have judgement/opinion on assembly-line vs cars-assemble pls? Dinesh has updated cars-assemble, but what should we be doing here in your opinion?

Looking at the C# and Ruby exercises, those two exercises look virtually identical, so I’m fine with either.

assembly-line/.meta/exemplar.rs uses (a bit advanced) match, panic!, and (avoidable) casts.

cars-assemble/.meta/exemplar.rs on the other hand uses the familiar/simple if and explicit conversion, and could avoid casts. It is also longer.

Based on just these exemplars, I prefer Cars Assemble.

@ErikSchierboom

Can this PR be reopened please?

I’ve reviewed annalyns-infiltration and cars-assemble . I’ll wait for all the exercises to be updated based on this round of feedback to not repeat the same comments on every PR.

@isDineshHere Can we get a status update? You opened a lot of PRs, promising you would respond to feedback quickly.

@iHiD Would you object if I take over the work on the Booleans concept and the corresponding Annalyn’s Infiltration exercise?

I’d like to finish that one alongside @senekor & @safwansamsudeen, and afterwards evaluate how that went before continuing with the other concepts.

2 Likes