You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: building/tracks/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ Tracks have two types of exercises:
20
20
- Concept exercises: they are designed to teach one or more concepts to a student. Check the [documentation](/docs/building/tracks/concept-exercises) for more information.
21
21
- Practice exercises: they are designed to practice learned concepts. Check the [documentation](/docs/building/tracks/practice-exercises) for more information.
22
22
23
+
Exercises can have approaches associated with them, which describe the different ways in which an exercise can be solved.
24
+
Check the [documentation](/docs/building/tracks/approaches) for more information.
25
+
23
26
## Shared files
24
27
25
28
Some files are not specific to individual exercises, but are instead applicable to _all_ exercises. Check the [documentation](/docs/building/tracks/shared-files) for more information.
Each exercise can have approaches associated with them, which describe the different ways in which an exercise can be solved.
4
+
5
+
## Approach
6
+
7
+
An approach should explore how an exercise can be solved a certain way.
8
+
9
+
- Its contents should either:
10
+
- Explore an idiomatic approach
11
+
- Explore a non-idiomatic, but interesting approach
12
+
- Contain a meta discussion (e.g. comparing the performance of approaches)
13
+
- Include code samples
14
+
- Feel free to dig deep into the topic
15
+
- Link to useful resources (e.g. documentation)
16
+
17
+
## Approach overview
18
+
19
+
- Give context to the problem
20
+
- Describe important points (e.g. gotchas) that apply to _all_ approaches
21
+
- Discuss the most idiomatic approaches
22
+
- Each approach should show a snippet illustrating the approach
23
+
- Keep the content fairly high-level
24
+
- Link to the idiomatic approach for more information
25
+
- Discuss how to choose between the approaches
26
+
- What are the trade-offs?
27
+
- Are some approaches better suited for specific use cases?
28
+
29
+
## What exercises to write approaches for?
30
+
31
+
In general, [Practice Exercises](/docs/building/tracks/practice-exercises) are more suitable to write approaches for, as they usually can be solved in multiple ways.
32
+
33
+
For [Concept Exercises](/docs/building/tracks/concept-exercises), discussing the exemplar approach might be interesting. For example, you could show how the concept being taught makes certain code easier to write.
Copy file name to clipboardExpand all lines: building/tracks/concept-exercises.md
+147-1Lines changed: 147 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Concept Exercise metadata is defined in the `exercises.concept` key in the [conf
30
30
31
31
Each Concept Exercise has its own directory within the track's `exercises/concept` directory. The name of the Concept Exercise directory must match the `slug` property of the Concept Exercise, as defined in the [config.json file](/docs/building/tracks/config-json#concept-exercises).
32
32
33
-
A Concept Exercise has three types of files:
33
+
A Concept Exercise has four types of files:
34
34
35
35
### Documentation files
36
36
@@ -47,6 +47,15 @@ These files are _not_ presented to the student, but used to define metadata of t
47
47
-`.meta/config.json`: contains meta information on the exercise (required)
48
48
-`.meta/design.md`: describe the design of the exercise (required)
49
49
50
+
### Approach files
51
+
52
+
These files describe approaches for the exercise.
53
+
54
+
-`.approaches/introduction.md`: introduction to the most common approaches for the exercise (optional)
55
+
-`.approaches/config.json`: metadata for the approaches (optional)
56
+
-`.approaches/<approach-slug>/content.md`: description of the approach (optional)
57
+
-`.approaches/<approach-slug>/snippet.txt`: snippet showcasing the approach (optional)
58
+
50
59
### Exercise files
51
60
52
61
The language-specific files, like the implementation and test files. The names of these files are track-specific.
@@ -62,6 +71,12 @@ The language-specific files, like the implementation and test files. The names o
62
71
exercises
63
72
└── concept
64
73
└── cars-assemble
74
+
├── .approaches
75
+
| ├── performance (approach)
76
+
| | ├── content.md
77
+
| | └── snippet.txt
78
+
| ├── config.json
79
+
| └── introduction.md
65
80
├── .docs
66
81
| ├── introduction.md
67
82
| ├── instructions.md
@@ -347,6 +362,137 @@ Note that:
347
362
348
363
---
349
364
365
+
### File: `.approaches/introduction.md`
366
+
367
+
**Purpose:** Introduction to the most common approaches for the exercise
368
+
369
+
**Presence:** Optional
370
+
371
+
This file describes the most common approaches for the exercise.
372
+
Check the [documentation](/docs/building/tracks/approaches) for more information on what should go in this file.
373
+
374
+
#### Example
375
+
376
+
````markdown
377
+
# Introduction
378
+
379
+
The key to this exercise is to deal with C# strings being immutable, which means that a `string`'s value cannot be changed.
380
+
Therefore, to reverse a string you'll need to create a _new_ `string`.
381
+
382
+
## Using LINQ
383
+
384
+
```csharp
385
+
public static string Reverse(string input)
386
+
{
387
+
return new string(input.Reverse().ToArray());
388
+
}
389
+
```
390
+
391
+
For more information, check the [LINQ approach][approach-linq].
392
+
393
+
## Which approach to use?
394
+
395
+
If readability is your primary concern (and it usually should be), the LINQ-based approach is hard to beat.
396
+
````
397
+
398
+
---
399
+
400
+
### File: `.approaches/config.json`
401
+
402
+
**Purpose:** Metadata for the approaches
403
+
404
+
**Presence:** Optional (required when an approach introduction or approach exists)
405
+
406
+
This file contains meta information on the exercise:
407
+
408
+
-`introduction`: The GitHub username(s) of the exercise approach introduction's author(s) (optional)
409
+
410
+
-`authors`: The GitHub username(s) of the exercise approach introduction's author(s) (required)
411
+
- Including reviewers if their reviews substantially change the exercise approach introduction (to the extent where it feels like "you got there together")
412
+
-`contributors`: The GitHub username(s) of the exercise approach introduction's contributor(s) (optional)
413
+
- Including reviewers if their reviews are meaningful/actionable/actioned.
414
+
415
+
-`approaches`: An array listing the detailed approaches (optional)
416
+
-`uuid`: a V4 UUID that uniquely identifies the approach. The UUID must be unique both within the track as well as across all tracks, and must never change
417
+
-`slug`: the approach's slug, which is a lowercased, kebab-case string. The slug must be unique across all approach slugs within the track. Its length must be <= 255.
418
+
-`title`: the approach's title. Its length must be <= 255.
419
+
-`blurb`: A short description of this approach. Its length must be <= 350. Markdown is _not_ supported (required)
420
+
-`authors`: The GitHub username(s) of the exercise approach's author(s) (required)
421
+
- Including reviewers if their reviews substantially change the exercise approach (to the extent where it feels like "you got there together")
422
+
-`contributors`: The GitHub username(s) of the exercise approach's contributor(s) (optional)
423
+
- Including reviewers if their reviews are meaningful/actionable/actioned.
424
+
425
+
#### Example
426
+
427
+
```json
428
+
{
429
+
"introduction": {
430
+
"authors": ["erikschierboom"]
431
+
},
432
+
"approaches": [
433
+
{
434
+
"uuid": "448fb2b4-18ab-4e55-aa54-ad4ed6d5f7f6",
435
+
"slug": "performance",
436
+
"title": "Optimizing performance",
437
+
"blurb": "Explore how to most efficiently reverse a string and what the trade-offs are.",
0 commit comments