From c59a04a69f8e9d698462ca250fcfea8674cb645a Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Tue, 14 Jan 2020 14:02:12 +0000 Subject: [PATCH] Giant reshuffle (#28) * Rearrange * Set theme jekyll-theme-architect * Add nav * Move layout to the correct place * Change theme * Add docsify generated site * Rename link * Add extra sidebar * Fix sidebars * Fix C readme link * Rearrange repo * Add some basic docs * Fixing broken links * Update docs/concept-exercises.md Co-Authored-By: Erik Schierboom * Update docs/concept-exercises.md Co-Authored-By: Erik Schierboom * Update docs/concept-exercises.md Co-Authored-By: Erik Schierboom * Fix sidebars * Updated links * Add maintainers info * Add tooling sidebar * Fix more broken links * Add extra start to get started * Additional link-fixes * Additional link-fixes * Rename content to reference * Update repository structure * Move exercise-shared files to separate section * csharp: update to new structure (#1) * csharp: create docs, reference and exercises directory * csharp: make README and index * csharp: renamed concept-exercises to reference * csharp: move cli.md and debug.md to exercise/.docs directory * csharp: add how to implement document * csharp: update links * csharp: add concept-exercises document * csharp: add concept exercises * csharp: fix invalid escaping * csharp: fix link * csharp: add todo for converting to Fact-based tests * csharp: add shared file * csharp: add new concept exercise template * csharp: add reference to how to implement * csharp: fix grammar * csharp: replace duplicate information * Fix broken links * Add link to C# reference * csharp: add example for new concept exercise * csharp: example of reference * csharp: add contributing * csharp: add link * csharp: update links * csharp: add sidebar * csharp: update sidebar * csharp: more work * Tweak README * csharp: update README * csharp: add contributing information for reference documents * Add license * Add GitHub information to repository structure * Add subdivision for exercises directory in repository structure * Update language contributing text * Update languages/README.md Co-Authored-By: Jeremy Walker * Update languages/README.md Co-Authored-By: Jeremy Walker * csharp: add document for contributing to exercise-shared documents * templates: make implement new concept exercise template generic * Fix about * csharp: add suggest new exercise template * Add new concept exercise info * templates: add placeholder brackets * Add ask a question template * Update ask question template * Update markdown * Update contributing * csharp: update name * Update documents * Add links to all reference documents * Add links to implemented files * Add link to reference docs contributing * Improve links * Update links * csharp: remove dependencies * csharp: add more contributing * csharp: add readme for docs * Add links to analyzer/representer/test-runner * csharp: update strings * csharp: bitwise operations to fact-base * csharp: add defaults * csharp: convert tests to fact-based * csharp: add sidebars * csharp: add link * Change V3 to v3 * Consistent casing * csharp: change order * Update README * Update README.md * Tweak things further * More tweaks * Fix links * Fix typos * Change * csharp: rework readme * csharp: updates * csharp: update readme * csharp: update word * csharp: update * csharp: move concepts * Add reference doc * Fix template links * csharp: more work * Simplify * csharp: remove unused link * csharp: remove empty row * csharp: removing contributing * csharp: explain * Update README.md * Update README.md * Update README.md * Add maintainers docs * Add links * Update C# readme * Fix link * Fix link * Tweak repo structure document * Small improvements * csharp: fixes * csharp: more * Fix typo * Add converting details * structure: make it more clear * Add new README and docs * Split out readiness steps further * Split out online editor settings further * Tweak the repo structure docs a little * Tweak the README for clarity * Add new language docs * csharp: link directly to analyzer and representer * csharp: move concept interpretation to reference doc * csharp: small update * csharp: add online editor settings * csharp: add config.json example * csharp: more data * Use consistent example * Add online editor config changes * Update README.md Co-Authored-By: Erik Schierboom * Update README.md Co-Authored-By: Erik Schierboom * Update docs/_sidebar.md Co-Authored-By: Erik Schierboom * Update docs/_sidebar.md Co-Authored-By: Erik Schierboom * Update docs/concept-exercises.md Co-Authored-By: Erik Schierboom * Update docs/concept-exercises.md * Update docs/maintainers/README.md Co-Authored-By: Erik Schierboom * Apply suggestions from code review Co-Authored-By: Erik Schierboom * Apply suggestions from code review Co-Authored-By: Erik Schierboom * Update languages/csharp/docs/examples/new-concept-exercise-arrays.md Co-Authored-By: Jeremy Walker * Update languages/csharp/docs/examples/new-concept-exercise-arrays.md Co-Authored-By: Jeremy Walker * Move migrating config json file to separate file * Add more details * Add introduction for what maintainers actually need to do * Update README.md * Move things around for clarity * Fix tons of issues * Fix links * Fix links * More fixes * Fix things more * Revert link * Rephrase * Add maintainers * update * casing Co-authored-by: Charles Care Co-authored-by: Erik Schierboom --- .github/ISSUE_TEMPLATE/ask-question.md | 19 ++ .../implement-concept-exercise.md | 104 +++++++ .github/ISSUE_TEMPLATE/new-reference-doc.md | 41 +++ .github/ISSUE_TEMPLATE/suggest-exercise.md | 23 ++ .nojekyll | 0 CONTRIBUTING.md | 11 +- LICENSE.md | 22 ++ README.md | 118 ++------ _sidebar.md | 8 + concepts/README.md | 13 - docs/_sidebar.md | 12 + docs/concept-exercises.md | 92 ++++++ docs/features-of-v3.md | 32 ++ docs/maintainers/README.md | 52 ++++ docs/maintainers/_sidebar.md | 13 + docs/maintainers/determining-concepts.md | 11 + ...ric-how-to-implement-a-concept-exercise.md | 101 +++++++ .../migrating-your-config-json-files.md | 36 +++ docs/maintainers/repository-structure.md | 65 +++++ ...writing-a-concept-exercise-github-issue.md | 13 + docs/rationale-for-v3.md | 68 +++++ index.html | 30 ++ languages/README.md | 40 ++- languages/_sidebar.md | 23 ++ languages/coffeescript/keywords/while.md | 6 +- .../coffeescript/operators/logical-not.md | 4 +- languages/csharp/README.md | 274 +++--------------- languages/csharp/_sidebar.md | 12 + .../bitwise-operations/.docs/cli.md | 16 - .../BitwiseOperationsTest.cs | 63 ---- .../concept-exercises/dates/.docs/cli.md | 16 - .../concept-exercises/dates/.docs/debug.md | 10 - .../csharp/concept-exercises/dates/Dates.cs | 24 -- .../concept-exercises/dates/DatesTest.cs | 116 -------- .../concept-exercises/enums/.docs/cli.md | 16 - .../concept-exercises/enums/.docs/debug.md | 10 - .../concept-exercises/enums/EnumsTest.cs | 38 --- .../numbers-floating-point/.docs/cli.md | 16 - .../numbers-floating-point/.docs/debug.md | 10 - .../NumbersFloatingPoint.cs | 17 -- .../NumbersFloatingPointTest.cs | 75 ----- .../concept-exercises/numbers/.docs/cli.md | 16 - .../concept-exercises/numbers/.docs/debug.md | 10 - .../concept-exercises/numbers/Numbers.cs | 12 - .../concept-exercises/numbers/NumbersTest.cs | 34 --- .../concept-exercises/strings/.docs/cli.md | 16 - .../concept-exercises/strings/.docs/debug.md | 10 - .../concept-exercises/strings/Strings.cs | 17 -- .../concept-exercises/strings/StringsTest.cs | 43 --- languages/csharp/config.json | 4 + languages/csharp/docs/README.md | 8 + .../examples/new-concept-exercise-arrays.md | 181 ++++++++++++ .../new-reference-doc-readonly-vs-const.md | 41 +++ .../docs/implementing-a-concept-exercise.md | 69 +++++ languages/csharp/exercises/.docs/README.md | 15 + languages/csharp/exercises/.docs/cli.md | 14 + .../.docs/debug.md | 0 languages/csharp/exercises/README.md | 9 + languages/csharp/exercises/_sidebar.md | 14 + languages/csharp/exercises/concept/README.md | 38 +++ .../csharp/exercises/concept/_sidebar.md | 13 + .../bitwise-operations/.docs/after.md | 0 .../bitwise-operations/.docs/hints.md | 0 .../bitwise-operations/.docs/instructions.md | 0 .../bitwise-operations/.docs/introduction.md | 0 .../bitwise-operations/.meta/Example.cs | 0 .../bitwise-operations/.meta/config.json | 94 ++++++ .../bitwise-operations/BitwiseOperations.cs | 8 +- .../BitwiseOperations.csproj | 0 .../BitwiseOperationsTest.cs | 92 ++++++ .../concept}/dates/.docs/after.md | 0 .../concept}/dates/.docs/hints.md | 0 .../concept}/dates/.docs/instructions.md | 0 .../concept}/dates/.docs/introduction.md | 0 .../concept}/dates/.meta/Example.cs | 0 .../exercises/concept/dates/.meta/config.json | 102 +++++++ .../csharp/exercises/concept/dates/Dates.cs | 24 ++ .../concept}/dates/Dates.csproj | 0 .../exercises/concept/dates/DatesTest.cs | 145 +++++++++ .../concept}/enums/.docs/hints.md | 0 .../concept}/enums/.docs/instructions.md | 0 .../concept}/enums/.docs/introduction.md | 0 .../concept}/enums/.meta/Example.cs | 0 .../exercises/concept/enums/.meta/config.json | 38 +++ .../concept}/enums/Enums.cs | 4 +- .../concept}/enums/Enums.csproj | 0 .../exercises/concept/enums/EnumsTest.cs | 36 +++ .../numbers-floating-point/.docs/after.md | 0 .../numbers-floating-point/.docs/hints.md | 0 .../.docs/instructions.md | 0 .../.docs/introduction.md | 0 .../numbers-floating-point/.meta/Example.cs | 0 .../numbers-floating-point/.meta/config.json | 102 +++++++ .../NumbersFloatingPoint.cs | 19 ++ .../NumbersFloatingPoint.csproj | 0 .../NumbersFloatingPointTest.cs | 100 +++++++ .../concept}/numbers/.docs/hints.md | 0 .../concept}/numbers/.docs/instructions.md | 0 .../concept}/numbers/.docs/introduction.md | 0 .../concept}/numbers/.meta/Example.cs | 0 .../concept/numbers/.meta/config.json | 46 +++ .../exercises/concept/numbers/Numbers.cs | 14 + .../concept}/numbers/Numbers.csproj | 0 .../exercises/concept/numbers/NumbersTest.cs | 44 +++ .../concept}/strings/.docs/after.md | 0 .../concept}/strings/.docs/hints.md | 0 .../concept}/strings/.docs/instructions.md | 0 .../concept}/strings/.docs/introduction.md | 0 .../concept}/strings/.meta/Example.cs | 2 - .../concept/strings/.meta/config.json | 50 ++++ .../exercises/concept/strings/Strings.cs | 19 ++ .../concept}/strings/Strings.csproj | 0 .../exercises/concept/strings/StringsTest.cs | 48 +++ languages/csharp/exercises/practice/README.md | 9 + .../csharp/info/floating_point_numbers.md | 13 - languages/csharp/info/namespaces.md | 23 -- languages/csharp/info/ref_struct.md | 12 - languages/csharp/info/reference_types.md | 9 - languages/csharp/info/type_aliases.md | 36 --- languages/csharp/info/value_types.md | 9 - languages/csharp/keywords/stackalloc.md | 5 - languages/csharp/keywords/using.md | 20 -- languages/csharp/maintainers.md | 12 + languages/csharp/reference/README.md | 159 ++++++++++ languages/csharp/reference/_sidebar.md | 14 + .../csharp/{info => reference}/code_style.md | 13 + .../{info => reference}/memory_allocation.md | 4 +- languages/csharp/types/array.md | 7 - languages/csharp/types/biginteger.md | 7 - languages/csharp/types/bool.md | 7 - languages/csharp/types/char.md | 8 - languages/csharp/types/class.md | 7 - languages/csharp/types/datetime.md | 7 - languages/csharp/types/enum.md | 3 - languages/csharp/types/string.md | 7 - languages/csharp/types/struct.md | 14 - languages/csharp/types/timespan.md | 5 - languages/dart/README.md | 78 ++--- languages/dart/keywords/async.md | 2 +- languages/dart/keywords/await.md | 2 +- languages/dart/keywords/function.md | 5 +- languages/dart/types/bool.md | 2 +- languages/dart/types/error.md | 2 +- languages/dart/types/function.md | 2 +- languages/dart/types/map.md | 2 +- languages/dart/types/number.md | 4 +- languages/dart/types/regexp.md | 2 +- languages/dart/types/set.md | 2 +- languages/dart/types/string.md | 2 +- languages/dart/types/symbol.md | 2 +- languages/fsharp/README.md | 40 +-- languages/go/README.md | 22 +- languages/go/info/structs.md | 2 +- languages/javascript/README.md | 88 +++--- languages/javascript/info/falsy.md | 14 +- languages/javascript/info/global_objects.md | 4 +- .../javascript/info/prototype_inheritance.md | 12 +- languages/javascript/info/sameness.md | 4 +- languages/javascript/info/truthy.md | 4 +- languages/javascript/info/undefined.md | 6 +- languages/javascript/keywords/async.md | 2 +- languages/javascript/keywords/await.md | 2 +- languages/javascript/keywords/function.md | 6 +- languages/javascript/keywords/typeof.md | 22 +- languages/javascript/objects/array.md | 2 +- languages/javascript/objects/bigint.md | 2 +- languages/javascript/objects/boolean.md | 2 +- languages/javascript/objects/date.md | 2 +- languages/javascript/objects/error.md | 2 +- languages/javascript/objects/function.md | 2 +- languages/javascript/objects/map.md | 2 +- languages/javascript/objects/number.md | 4 +- languages/javascript/objects/object.md | 22 +- languages/javascript/objects/promise.md | 2 +- languages/javascript/objects/regexp.md | 2 +- languages/javascript/objects/set.md | 2 +- languages/javascript/objects/string.md | 2 +- languages/javascript/objects/symbol.md | 2 +- .../transitions/from_coffeescript.md | 12 +- languages/julia/README.md | 24 +- languages/python/README.md | 94 +++--- reference/README.md | 19 ++ reference/_sidebar.md | 14 + reference/concepts/README.md | 86 ++++++ reference/concepts/_sidebar.md | 72 +++++ .../concepts}/anonymous_functions.md | 0 .../concepts}/arithmetic.md | 0 {concepts => reference/concepts}/ascii.md | 0 .../concepts}/assignment.md | 0 .../concepts}/bitwise_manipulation.md | 6 + .../concepts}/boolean_logic.md | 0 .../concepts}/character_encoding.md | 0 {concepts => reference/concepts}/classes.md | 0 {concepts => reference/concepts}/comments.md | 0 .../concepts}/comparisons.md | 0 .../concepts}/composition.md | 0 .../concepts}/concurrency.md | 2 +- .../concepts}/conditionals.md | 0 {concepts => reference/concepts}/constants.md | 0 .../concepts}/destructuring.md | 0 .../concepts}/destructuring_assignment.md | 0 .../concepts}/duck_typing.md | 0 .../concepts}/encapsulation.md | 0 .../concepts}/enumeration.md | 0 .../concepts}/evaluation.md | 0 .../concepts}/expression_oriented.md | 0 .../concepts}/expressions.md | 0 .../concepts}/function_composition.md | 0 {concepts => reference/concepts}/functions.md | 0 {concepts => reference/concepts}/generics.md | 0 {concepts => reference/concepts}/hashing.md | 0 .../concepts}/higher_order_functions.md | 0 .../concepts}/immutability.md | 0 .../concepts}/inheritance.md | 0 .../concepts}/interfaces.md | 0 .../concepts}/list_comprehension.md | 0 {concepts => reference/concepts}/locking.md | 0 {concepts => reference/concepts}/loops.md | 0 {concepts => reference/concepts}/macros.md | 0 .../concepts}/metaprogramming.md | 0 {concepts => reference/concepts}/methods.md | 0 .../concepts}/multiple-dispatch.md | 2 +- {concepts => reference/concepts}/mutation.md | 0 .../concepts}/nested_functions.md | 0 {concepts => reference/concepts}/objects.md | 0 {concepts => reference/concepts}/operators.md | 0 .../concepts}/partial_application.md | 0 .../concepts}/pattern_matching.md | 0 {concepts => reference/concepts}/pipelines.md | 0 .../concepts}/polymorphism.md | 0 .../concepts}/prototype_based-programming.md | 0 .../concepts}/pure_functions.md | 0 {concepts => reference/concepts}/recursion.md | 0 {concepts => reference/concepts}/repl.md | 0 .../concepts}/rest_parameters.md | 0 .../concepts}/return_values.md | 0 {concepts => reference/concepts}/sameness.md | 0 {concepts => reference/concepts}/scope.md | 0 .../concepts}/signedness.md | 0 {concepts => reference/concepts}/state.md | 0 .../concepts}/truthy_and_falsy.md | 0 .../concepts}/type_casting.md | 0 .../concepts}/type_inference.md | 0 {concepts => reference/concepts}/undefined.md | 0 {concepts => reference/concepts}/unicode.md | 0 {concepts => reference/concepts}/utf7.md | 0 {concepts => reference/concepts}/utf8.md | 0 .../concepts}/variable_shadowing.md | 6 +- {concepts => reference/concepts}/variables.md | 0 reference/paradigms/README.md | 18 ++ reference/paradigms/_sidebar.md | 14 + .../paradigms}/declarative.md | 0 .../paradigms}/functional.md | 0 .../paradigms}/imperative.md | 0 {paradigms => reference/paradigms}/logic.md | 0 .../paradigms}/object-oriented.md | 18 +- .../paradigms}/procedural.md | 0 reference/tooling/README.md | 15 + reference/tooling/_sidebar.md | 11 + {tooling => reference/tooling}/babel.md | 2 +- .../tooling}/dotnet-assemblies.md | 0 {tooling => reference/tooling}/jsdoc.md | 4 +- reference/types/README.md | 66 +++++ reference/types/_sidebar.md | 62 ++++ {types => reference/types}/array.md | 0 {types => reference/types}/big_integer.md | 0 {types => reference/types}/bit.md | 0 {types => reference/types}/boolean.md | 0 {types => reference/types}/byte.md | 0 {types => reference/types}/bytes.md | 0 {types => reference/types}/char.md | 0 {types => reference/types}/class.md | 0 {types => reference/types}/collection.md | 0 {types => reference/types}/date.md | 5 + {types => reference/types}/datetime.md | 5 + {types => reference/types}/decimal_number.md | 0 {types => reference/types}/deque.md | 0 {types => reference/types}/dictionary.md | 0 {types => reference/types}/double.md | 5 + {types => reference/types}/duration.md | 0 {types => reference/types}/error.md | 0 .../types}/floating_point_number.md | 7 + {types => reference/types}/function.md | 0 {types => reference/types}/future.md | 0 {types => reference/types}/half.md | 0 {types => reference/types}/hash_map.md | 0 {types => reference/types}/integer.md | 5 + {types => reference/types}/list.md | 0 {types => reference/types}/long.md | 0 {types => reference/types}/map.md | 0 {types => reference/types}/null.md | 0 {types => reference/types}/nullable.md | 0 {types => reference/types}/number.md | 9 +- {types => reference/types}/object.md | 0 {types => reference/types}/pair.md | 0 {types => reference/types}/pattern.md | 0 {types => reference/types}/pointer.md | 0 {types => reference/types}/product_type.md | 0 {types => reference/types}/promise.md | 0 {types => reference/types}/range.md | 0 {types => reference/types}/record.md | 0 .../types}/regular_expression.md | 0 {types => reference/types}/set.md | 0 {types => reference/types}/short.md | 0 {types => reference/types}/signed.md | 0 {types => reference/types}/single.md | 0 {types => reference/types}/stack.md | 0 {types => reference/types}/string.md | 2 +- {types => reference/types}/struct.md | 0 {types => reference/types}/sum_type.md | 0 {types => reference/types}/symbol.md | 0 {types => reference/types}/time.md | 5 + {types => reference/types}/timestamp.md | 0 {types => reference/types}/triple.md | 0 {types => reference/types}/tuple.md | 0 {types => reference/types}/undefined.md | 0 {types => reference/types}/unsigned.md | 0 {types => reference/types}/word.md | 0 tooling/README.md | 4 - types/README.md | 4 - 320 files changed, 3170 insertions(+), 1444 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/ask-question.md create mode 100644 .github/ISSUE_TEMPLATE/implement-concept-exercise.md create mode 100644 .github/ISSUE_TEMPLATE/new-reference-doc.md create mode 100644 .github/ISSUE_TEMPLATE/suggest-exercise.md create mode 100644 .nojekyll create mode 100644 LICENSE.md create mode 100644 _sidebar.md delete mode 100644 concepts/README.md create mode 100644 docs/_sidebar.md create mode 100644 docs/concept-exercises.md create mode 100644 docs/features-of-v3.md create mode 100644 docs/maintainers/README.md create mode 100644 docs/maintainers/_sidebar.md create mode 100644 docs/maintainers/determining-concepts.md create mode 100644 docs/maintainers/generic-how-to-implement-a-concept-exercise.md create mode 100644 docs/maintainers/migrating-your-config-json-files.md create mode 100644 docs/maintainers/repository-structure.md create mode 100644 docs/maintainers/writing-a-concept-exercise-github-issue.md create mode 100644 docs/rationale-for-v3.md create mode 100644 index.html create mode 100644 languages/_sidebar.md create mode 100644 languages/csharp/_sidebar.md delete mode 100644 languages/csharp/concept-exercises/bitwise-operations/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/bitwise-operations/BitwiseOperationsTest.cs delete mode 100644 languages/csharp/concept-exercises/dates/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/dates/.docs/debug.md delete mode 100644 languages/csharp/concept-exercises/dates/Dates.cs delete mode 100644 languages/csharp/concept-exercises/dates/DatesTest.cs delete mode 100644 languages/csharp/concept-exercises/enums/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/enums/.docs/debug.md delete mode 100644 languages/csharp/concept-exercises/enums/EnumsTest.cs delete mode 100644 languages/csharp/concept-exercises/numbers-floating-point/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/numbers-floating-point/.docs/debug.md delete mode 100644 languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.cs delete mode 100644 languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPointTest.cs delete mode 100644 languages/csharp/concept-exercises/numbers/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/numbers/.docs/debug.md delete mode 100644 languages/csharp/concept-exercises/numbers/Numbers.cs delete mode 100644 languages/csharp/concept-exercises/numbers/NumbersTest.cs delete mode 100644 languages/csharp/concept-exercises/strings/.docs/cli.md delete mode 100644 languages/csharp/concept-exercises/strings/.docs/debug.md delete mode 100644 languages/csharp/concept-exercises/strings/Strings.cs delete mode 100644 languages/csharp/concept-exercises/strings/StringsTest.cs create mode 100644 languages/csharp/docs/README.md create mode 100644 languages/csharp/docs/examples/new-concept-exercise-arrays.md create mode 100644 languages/csharp/docs/examples/new-reference-doc-readonly-vs-const.md create mode 100644 languages/csharp/docs/implementing-a-concept-exercise.md create mode 100644 languages/csharp/exercises/.docs/README.md create mode 100644 languages/csharp/exercises/.docs/cli.md rename languages/csharp/{concept-exercises/bitwise-operations => exercises}/.docs/debug.md (100%) create mode 100644 languages/csharp/exercises/README.md create mode 100644 languages/csharp/exercises/_sidebar.md create mode 100644 languages/csharp/exercises/concept/README.md create mode 100644 languages/csharp/exercises/concept/_sidebar.md rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/.docs/after.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/.meta/Example.cs (100%) create mode 100644 languages/csharp/exercises/concept/bitwise-operations/.meta/config.json rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/BitwiseOperations.cs (52%) rename languages/csharp/{concept-exercises => exercises/concept}/bitwise-operations/BitwiseOperations.csproj (100%) create mode 100644 languages/csharp/exercises/concept/bitwise-operations/BitwiseOperationsTest.cs rename languages/csharp/{concept-exercises => exercises/concept}/dates/.docs/after.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/dates/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/dates/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/dates/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/dates/.meta/Example.cs (100%) create mode 100644 languages/csharp/exercises/concept/dates/.meta/config.json create mode 100644 languages/csharp/exercises/concept/dates/Dates.cs rename languages/csharp/{concept-exercises => exercises/concept}/dates/Dates.csproj (100%) create mode 100644 languages/csharp/exercises/concept/dates/DatesTest.cs rename languages/csharp/{concept-exercises => exercises/concept}/enums/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/enums/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/enums/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/enums/.meta/Example.cs (100%) create mode 100644 languages/csharp/exercises/concept/enums/.meta/config.json rename languages/csharp/{concept-exercises => exercises/concept}/enums/Enums.cs (53%) rename languages/csharp/{concept-exercises => exercises/concept}/enums/Enums.csproj (100%) create mode 100644 languages/csharp/exercises/concept/enums/EnumsTest.cs rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/.docs/after.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/.meta/Example.cs (100%) create mode 100644 languages/csharp/exercises/concept/numbers-floating-point/.meta/config.json create mode 100644 languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.cs rename languages/csharp/{concept-exercises => exercises/concept}/numbers-floating-point/NumbersFloatingPoint.csproj (100%) create mode 100644 languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPointTest.cs rename languages/csharp/{concept-exercises => exercises/concept}/numbers/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/numbers/.meta/Example.cs (100%) create mode 100644 languages/csharp/exercises/concept/numbers/.meta/config.json create mode 100644 languages/csharp/exercises/concept/numbers/Numbers.cs rename languages/csharp/{concept-exercises => exercises/concept}/numbers/Numbers.csproj (100%) create mode 100644 languages/csharp/exercises/concept/numbers/NumbersTest.cs rename languages/csharp/{concept-exercises => exercises/concept}/strings/.docs/after.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/strings/.docs/hints.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/strings/.docs/instructions.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/strings/.docs/introduction.md (100%) rename languages/csharp/{concept-exercises => exercises/concept}/strings/.meta/Example.cs (96%) create mode 100644 languages/csharp/exercises/concept/strings/.meta/config.json create mode 100644 languages/csharp/exercises/concept/strings/Strings.cs rename languages/csharp/{concept-exercises => exercises/concept}/strings/Strings.csproj (100%) create mode 100644 languages/csharp/exercises/concept/strings/StringsTest.cs create mode 100644 languages/csharp/exercises/practice/README.md delete mode 100644 languages/csharp/info/floating_point_numbers.md delete mode 100644 languages/csharp/info/namespaces.md delete mode 100644 languages/csharp/info/ref_struct.md delete mode 100644 languages/csharp/info/reference_types.md delete mode 100644 languages/csharp/info/type_aliases.md delete mode 100644 languages/csharp/info/value_types.md delete mode 100644 languages/csharp/keywords/stackalloc.md delete mode 100644 languages/csharp/keywords/using.md create mode 100644 languages/csharp/maintainers.md create mode 100644 languages/csharp/reference/README.md create mode 100644 languages/csharp/reference/_sidebar.md rename languages/csharp/{info => reference}/code_style.md (78%) rename languages/csharp/{info => reference}/memory_allocation.md (85%) delete mode 100644 languages/csharp/types/array.md delete mode 100644 languages/csharp/types/biginteger.md delete mode 100644 languages/csharp/types/bool.md delete mode 100644 languages/csharp/types/char.md delete mode 100644 languages/csharp/types/class.md delete mode 100644 languages/csharp/types/datetime.md delete mode 100644 languages/csharp/types/enum.md delete mode 100644 languages/csharp/types/string.md delete mode 100644 languages/csharp/types/struct.md delete mode 100644 languages/csharp/types/timespan.md create mode 100644 reference/README.md create mode 100644 reference/_sidebar.md create mode 100644 reference/concepts/README.md create mode 100644 reference/concepts/_sidebar.md rename {concepts => reference/concepts}/anonymous_functions.md (100%) rename {concepts => reference/concepts}/arithmetic.md (100%) rename {concepts => reference/concepts}/ascii.md (100%) rename {concepts => reference/concepts}/assignment.md (100%) rename {concepts => reference/concepts}/bitwise_manipulation.md (75%) rename {concepts => reference/concepts}/boolean_logic.md (100%) rename {concepts => reference/concepts}/character_encoding.md (100%) rename {concepts => reference/concepts}/classes.md (100%) rename {concepts => reference/concepts}/comments.md (100%) rename {concepts => reference/concepts}/comparisons.md (100%) rename {concepts => reference/concepts}/composition.md (100%) rename {concepts => reference/concepts}/concurrency.md (86%) rename {concepts => reference/concepts}/conditionals.md (100%) rename {concepts => reference/concepts}/constants.md (100%) rename {concepts => reference/concepts}/destructuring.md (100%) rename {concepts => reference/concepts}/destructuring_assignment.md (100%) rename {concepts => reference/concepts}/duck_typing.md (100%) rename {concepts => reference/concepts}/encapsulation.md (100%) rename {concepts => reference/concepts}/enumeration.md (100%) rename {concepts => reference/concepts}/evaluation.md (100%) rename {concepts => reference/concepts}/expression_oriented.md (100%) rename {concepts => reference/concepts}/expressions.md (100%) rename {concepts => reference/concepts}/function_composition.md (100%) rename {concepts => reference/concepts}/functions.md (100%) rename {concepts => reference/concepts}/generics.md (100%) rename {concepts => reference/concepts}/hashing.md (100%) rename {concepts => reference/concepts}/higher_order_functions.md (100%) rename {concepts => reference/concepts}/immutability.md (100%) rename {concepts => reference/concepts}/inheritance.md (100%) rename {concepts => reference/concepts}/interfaces.md (100%) rename {concepts => reference/concepts}/list_comprehension.md (100%) rename {concepts => reference/concepts}/locking.md (100%) rename {concepts => reference/concepts}/loops.md (100%) rename {concepts => reference/concepts}/macros.md (100%) rename {concepts => reference/concepts}/metaprogramming.md (100%) rename {concepts => reference/concepts}/methods.md (100%) rename {concepts => reference/concepts}/multiple-dispatch.md (88%) rename {concepts => reference/concepts}/mutation.md (100%) rename {concepts => reference/concepts}/nested_functions.md (100%) rename {concepts => reference/concepts}/objects.md (100%) rename {concepts => reference/concepts}/operators.md (100%) rename {concepts => reference/concepts}/partial_application.md (100%) rename {concepts => reference/concepts}/pattern_matching.md (100%) rename {concepts => reference/concepts}/pipelines.md (100%) rename {concepts => reference/concepts}/polymorphism.md (100%) rename {concepts => reference/concepts}/prototype_based-programming.md (100%) rename {concepts => reference/concepts}/pure_functions.md (100%) rename {concepts => reference/concepts}/recursion.md (100%) rename {concepts => reference/concepts}/repl.md (100%) rename {concepts => reference/concepts}/rest_parameters.md (100%) rename {concepts => reference/concepts}/return_values.md (100%) rename {concepts => reference/concepts}/sameness.md (100%) rename {concepts => reference/concepts}/scope.md (100%) rename {concepts => reference/concepts}/signedness.md (100%) rename {concepts => reference/concepts}/state.md (100%) rename {concepts => reference/concepts}/truthy_and_falsy.md (100%) rename {concepts => reference/concepts}/type_casting.md (100%) rename {concepts => reference/concepts}/type_inference.md (100%) rename {concepts => reference/concepts}/undefined.md (100%) rename {concepts => reference/concepts}/unicode.md (100%) rename {concepts => reference/concepts}/utf7.md (100%) rename {concepts => reference/concepts}/utf8.md (100%) rename {concepts => reference/concepts}/variable_shadowing.md (88%) rename {concepts => reference/concepts}/variables.md (100%) create mode 100644 reference/paradigms/README.md create mode 100644 reference/paradigms/_sidebar.md rename {paradigms => reference/paradigms}/declarative.md (100%) rename {paradigms => reference/paradigms}/functional.md (100%) rename {paradigms => reference/paradigms}/imperative.md (100%) rename {paradigms => reference/paradigms}/logic.md (100%) rename {paradigms => reference/paradigms}/object-oriented.md (66%) rename {paradigms => reference/paradigms}/procedural.md (100%) create mode 100644 reference/tooling/README.md create mode 100644 reference/tooling/_sidebar.md rename {tooling => reference/tooling}/babel.md (84%) rename {tooling => reference/tooling}/dotnet-assemblies.md (100%) rename {tooling => reference/tooling}/jsdoc.md (92%) create mode 100644 reference/types/README.md create mode 100644 reference/types/_sidebar.md rename {types => reference/types}/array.md (100%) rename {types => reference/types}/big_integer.md (100%) rename {types => reference/types}/bit.md (100%) rename {types => reference/types}/boolean.md (100%) rename {types => reference/types}/byte.md (100%) rename {types => reference/types}/bytes.md (100%) rename {types => reference/types}/char.md (100%) rename {types => reference/types}/class.md (100%) rename {types => reference/types}/collection.md (100%) rename {types => reference/types}/date.md (79%) rename {types => reference/types}/datetime.md (67%) rename {types => reference/types}/decimal_number.md (100%) rename {types => reference/types}/deque.md (100%) rename {types => reference/types}/dictionary.md (100%) rename {types => reference/types}/double.md (68%) rename {types => reference/types}/duration.md (100%) rename {types => reference/types}/error.md (100%) rename {types => reference/types}/floating_point_number.md (68%) rename {types => reference/types}/function.md (100%) rename {types => reference/types}/future.md (100%) rename {types => reference/types}/half.md (100%) rename {types => reference/types}/hash_map.md (100%) rename {types => reference/types}/integer.md (82%) rename {types => reference/types}/list.md (100%) rename {types => reference/types}/long.md (100%) rename {types => reference/types}/map.md (100%) rename {types => reference/types}/null.md (100%) rename {types => reference/types}/nullable.md (100%) rename {types => reference/types}/number.md (78%) rename {types => reference/types}/object.md (100%) rename {types => reference/types}/pair.md (100%) rename {types => reference/types}/pattern.md (100%) rename {types => reference/types}/pointer.md (100%) rename {types => reference/types}/product_type.md (100%) rename {types => reference/types}/promise.md (100%) rename {types => reference/types}/range.md (100%) rename {types => reference/types}/record.md (100%) rename {types => reference/types}/regular_expression.md (100%) rename {types => reference/types}/set.md (100%) rename {types => reference/types}/short.md (100%) rename {types => reference/types}/signed.md (100%) rename {types => reference/types}/single.md (100%) rename {types => reference/types}/stack.md (100%) rename {types => reference/types}/string.md (75%) rename {types => reference/types}/struct.md (100%) rename {types => reference/types}/sum_type.md (100%) rename {types => reference/types}/symbol.md (100%) rename {types => reference/types}/time.md (75%) rename {types => reference/types}/timestamp.md (100%) rename {types => reference/types}/triple.md (100%) rename {types => reference/types}/tuple.md (100%) rename {types => reference/types}/undefined.md (100%) rename {types => reference/types}/unsigned.md (100%) rename {types => reference/types}/word.md (100%) delete mode 100644 tooling/README.md delete mode 100644 types/README.md diff --git a/.github/ISSUE_TEMPLATE/ask-question.md b/.github/ISSUE_TEMPLATE/ask-question.md new file mode 100644 index 0000000000..9ea46e6595 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ask-question.md @@ -0,0 +1,19 @@ +--- +name: "[ALL] Ask a question" +about: Ask a question +title: "[] Ask a question: " +labels: status/help-wanted +assignees: "" +--- + +[Use this issue template to ask a question. Before you do though, please check the [open][issues-open] and [closed][issues-closed] issues to see if this question has already been asked or answered. If this is a new question, please fill in the issue template, and remove any sections wrapped in square brackets (such as this section!).] + +[Please give as much context as possible, such as: + +- The language this question applies to (e.g. Ruby). +- The exercise this question applies to (e.g. two-fer). +- If this relates to another issue, please link to that issue. +- Etc.] + +[issues-open]: ./ +[issues-closed]: ./?q=is%3Aissue+is%3Aclosed diff --git a/.github/ISSUE_TEMPLATE/implement-concept-exercise.md b/.github/ISSUE_TEMPLATE/implement-concept-exercise.md new file mode 100644 index 0000000000..2bdaaefc2a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/implement-concept-exercise.md @@ -0,0 +1,104 @@ +--- +name: "[MAINTAINERS] Implement new Concept Exercise" +about: FOR MAINTAINERS ONLY - Use this template to create an issue to implement a Concept Exercise +title: "[] Implement new Concept Exercise: " +labels: type/new-exercise, status/help-wanted +assignees: "" +--- + +[Use this issue template to describe how to implement a new concept exercises. Please fill in the issue template, and remove any sections wrapped in square brackets (such as this section!).] + +This issue describes how to implement the `` concept exercise for the track. + +## Goal + +[A clear description of which concepts this exercise aims to teach. + +For example: + +The goal of this exercise is to teach the student how concept X is implemented in . We will teach X through 's Y type.] + +## Things to teach + +[A list of things the exercise aims to teach the student. + +For example: + +- Know of the existence of type `Y`. +- Know of some basic functions that work on `Y`. +- Know where `Y` is documented, or at least how to search for it. +- ...] + +## Things not to teach + +[A list of things that are outside the scope of this exercise and that the exercise should thus not teach. + +For example: + +- Memory and performance characteristics of `Y`. +- Advanced usage of `Y`. +- ...] + +## Concepts + +[List the concepts this exercise teaches. These concepts can be more fine-grained than their overarching concepts. + +For example: + +- `basic-strings` +- ...] + +## Prequisites + +[List the prerequisite concepts that this exercise expects the student to already be familiar with. + +For example: + +- `basic-numbers` +- ...] + +## Resources to refer to + +[List suggestions to use as resources in the exercise's documentation file(s). + +For example: + +### Hints + +- [How to use `Y` when doing `A`][http://test.com] +- ... + +### After + +- [Performance characteristics of using `Y`][http://test.com] +- ...] + +## Representer + +[If this exercise requires any modifications to the track's representer, list these changes here and the reason for these changes. + +For example: + +- Normalize ternary expressions to if statements, as we are not interested in the type of conditional that is used. +- ... + +To help the implementer get started, add a link to the language's representer document.] + +## Analyzer + +[If this exercise requires an analyzer to be added for it, list the patterns the analyzer should detect here. + +For example: + +- If feature `K` is used, suggest using feature `L`. +- ... + +To help the implementer get started, add a link to the language's analyzer document] + +## Implementing + +[Please insert your track-specific implementation details here.] + +## Help + +If you have any questions while implementing the exercise, please post the questions as comments in this issue. diff --git a/.github/ISSUE_TEMPLATE/new-reference-doc.md b/.github/ISSUE_TEMPLATE/new-reference-doc.md new file mode 100644 index 0000000000..6f9b3e403c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-reference-doc.md @@ -0,0 +1,41 @@ +--- +name: "[MAINTAINERS] Add new reference document" +about: FOR MAINTAINERS ONLY - Use this template to create an issue to add a new reference document +title: "[] Add new reference document: " +labels: type/new-reference, status/help-wanted +assignees: "" +--- + +[Use this issue template to describe how to add a new reference doc. Only suggest adding a new reference doc when no appropriate online resource can be found. Please fill in the issue template, and remove any sections wrapped in square brackets (such as this section!).] + +This issue describes how to add a new reference document: . + +## Description + +[A clear description of what information the reference document aims to teach. It should be clear how this document can help a student. + +For example: + +There are multiple uses of feature `X` in language `Y`. While...] + +## Resources to refer to + +[List additional rescources to link to from the document. + +For example: + +- [Other in-depth resource exploring `X`][http://test.com] +- ...] + +### Contributing + +[Describe the exact steps the contributor has to take to add the document. + +For example: + +- Create the document using ../new/master?filename=languages/<lang>/reference/<doc>.md. +- Add a link to the reference document in the reference README at ../tree/master/languages/<lang>/reference/readme.md. + +## Help + +If you have any questions while adding the reference document, please post the questions as comments in this issue. diff --git a/.github/ISSUE_TEMPLATE/suggest-exercise.md b/.github/ISSUE_TEMPLATE/suggest-exercise.md new file mode 100644 index 0000000000..765fc7c545 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/suggest-exercise.md @@ -0,0 +1,23 @@ +--- +name: "[ALL] Suggest new exercise" +about: Suggest a new exercise +title: "[] Suggest new exercise: " +labels: type/suggested-exercise, status/help-wanted +assignees: "" +--- + +[Use this issue template to suggest new concept exercises. Please note that we are not accepting currently suggestions for practice exercises. Please fill in the issue template, and remove any sections wrapped in square brackets (such as this section!).] + +In this issue, a new concept exercise for the track is suggested. The exercise's name is ``. + +## Rationale + +[Describe why you think this new exercise would make a good addition to the track.] + +## Concepts + +[A clear description of which concepts this exercise aims to teach. + +For example: + +The goal of this exercise is to teach the student how concept X is implemented in . We will teach X through 's Y type.] diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97f79a0ac6..8b3fe93b6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,12 @@ # Contributing -Know an amazing reference that explains a concept in a straight-forward way and that isn't language-heavy? Please PR it! :) +Thanks for wanting to contribute Exercism v3! Contributions are very welcome! -Seen something that we've missed or got wrong. PR a suggestion! :) +There are two ways in which to contribute: -Have we missed an extra general programming concept or paradigm? Open an issue and tell us more about where it's used. +- Contribute to a language: please first read the general [README.md][readme] and then [select the language you'd like to contribute to][languages-readme]. +- Contribute to the reference documents: please read the [reference documents README][reference-readme]. -Want to write a concept exercise. Please PR one! +[readme]: ./README.md +[languages-readme]: ./languages/README.md +[reference-readme]: ./reference/README.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..988059dffd --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2020 Exercism + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +© 2020 GitHub, Inc. diff --git a/README.md b/README.md index 83ccca78e4..6a99572d8f 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,33 @@ -# Exercism - V3 +_Note: This file, and the other docs in this repository, can be viewed on [GitHub](https://github.com/exercism/v3) or as [a website with easier navigation](https://exercism.github.io/v3)._ -## An Introduction +# Exercism - v3 -This repository is the work-in-progress space for Exercism v3, and beyond that will be a permanent home for information about languages on Exercism, and a space for maintainers to discuss changes that need to occur across tracks. +Welcome to the workspace for Exercism v3! -Maintainers can consider this the new "home of maintainers", replacing `problem-specifications` in that role. +Exercism v3 is the third major iteration of Exercism, which we are aiming to launch around June 2020. It aims to both add exciting new features and to fix some of the issues present in v2, especially those around being blocked while waiting for a mentor. Its main features include: -In the early "work-in-progress" phase, this repository also holds new exercises that are being created across tracks, in order to elicit a wider set of voices for discussion on these new types of exercises. Once a track is no longer a "work-in-progress," its exercises will be moved to the track's repository. +- **Restructured tracks:** We are restructuring tracks to build new pathways containing Concept Exercises. These exercises will teach the key concepts that someone needs to know when learning a language. Completing a Concept Exercise will unlock other Concept and Practice Exercises. Concept Exercises will have automated feedback and approval, with no delays waiting for a mentor. +- **Approaches:** We will be automatically grouping similar solutions to Practice Exercises into Approaches. These will be supported with community-sourced articles expounding each approach, discussing its pros, cons, and potential usages. +- **In-browser coding:** We will be adding the ability to solve exercises within the browser. The CLI will remain as a first-class citizen, but v3 will allow people to work their way through a track without having to install anything. +- **Improved profiles:** Profiles will be getting an upgrade - with contributions throughout the site reflected in them. Mentoring, writing exercises, contributing to tracks, and maintaining parts of Exercism will all feature on profiles. Over time, contributing more will also have tangible improvements to your experience, with bumps up mentor queues and access to early testing features. -## Concepts +We are busy working away on the product and development work to add all this functionality, but **we need contributors to help get our language tracks into the necessary state for v3**. Our biggest need right now is for the implementation of Concept Exercises, but there are also lots of other tasks that we will need help with too. Throughout the development of v3, track maintainers will be creating issues tagged with `status/help-wanted`. You can choose any issue and comment saying you want to work on it, and it will then be "assigned" to you. -The key part of the content in this repository is the idea of "Concepts" - things that a programmer would need to understand to be fluent in a language. We care specifically about how languages are **different**. What do I need to learn differently about numbers in Haskell to numbers in Ruby to be able to work with numbers in those languages. Two questions that we have felt useful to ask to establish this are: +**To get started please explore the issues in the language you wish to contribute to:** -- If someone learnt Ruby, and someone learnt Haskell, what are the things that the two people learnt that are different? -- If a Ruby programmer learnt Haskell, what new concepts would they have to learn, what knowledge would they have to disregard, and what syntax would they have to remap? +- [C#](https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Astatus%2Fhelp-wanted+label%3Atrack%2Fcsharp) +- [Go](https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Astatus%2Fhelp-wanted+label%3Atrack%2Fgo) +- [F#](https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Astatus%2Fhelp-wanted+label%3Atrack%2Ffsharp) +- ... -### What do we mean by "fluency?" +**If you are a Track Maintainer, please [start here](./docs/maintainers/README.md).** -By "Fluency", we mean: Do you **get** that language? Can you reason in that language? Do you write that language like a "native" programmer writes in it? Fluency is the ability to express oneself articulately in a particular language. +## More information -"Fluency" is different to "Proficiency", where we use proficiency to mean: Can you write programs in the language (e.g. can you nav stdlib, docs, compose complex code structures). +- [The features of v3](./docs/features-of-v3.md): A deeper dive into the changes we're making to v3. +- [Rationale for v3](./docs/rationale-for-v3.md). An explanation about the rationale behind some of our our design decisions for v3. -Exercism focuses on teaching Fluency not Proficiency. We aim to teach people to understand what a makes a language unique and how experienced programmers in that language would reason about - and solve - problems. +### FAQs -## Concept Exercises - -Concept Exercises must have the following characteristics: - -- Each one has a clear learning goal. -- They are language-specific, not generic. -- Stubs/boilerplate are used to avoid the student having to learn/write unnecessary code on exercises. - -Concept Exercises are **not** mentored. When a user submits a submission that gets the tests passing for a Concept Exercise, we check for an Analyzer or Representer to give feedback. If none is found, then the solution is approved. This shifts the burden of teaching to the exercise, which must provide a clear pathway to learning the concept that needs learning. - -Exercises are unlocked based on concepts taught and learnt. Each Concept Exercise must teach one or more concepts. It may also have prerequisites on Concepts, which means it will not be unlocked until Concept Exercises teaching those prerequisite concepts have been completed. - -Concept Exercises do not share a common base like Practice Exercises do in the `problem-specifications` repository. Instead they "share" concepts that they are teaching with other languages. This repository aims to list all of those concepts and provide information about the concept that maintainers can use as the basis for their own languages. Each concept should also link to the implementations in different languages. Maintainers are free to copy and paste from each others repositories, and then edit to make things specific to their tracks, but such copy-and-pastes should be considered hard-forks. - -For example, we might define a concept of "Classes" and provide a short introduction that explains what a class is, how it fits with objects, state, etc. We might include a link to a good article introducing OOP and classes. Individual tracks implementing an exercise on Classes can then include this introductory text, making any additions that explain their language-specific semantics and syntax. - -### Exercise Structure - -An exercise has the following files. In the browser they will show at the relevant times. When used via the CLI, the introduction and instructions will be concatenated along with the track's CLI instructions into a README.md, which will sit alongside a HINTS.md. - -#### `.docs/introduction.md` - -This file provides an introduction to the concept. It should be explicit about what the exercise teaches and maybe provide a brief introduction to the concepts, but not give away so much that the user doesn't have to do any work to solve the exercise. - -See the C# floating-point-numbers exercise's [introduction.md file](./languages/csharp/concept-exercises/numbers-floating-point/.docs/introduction.md) for an example. - -#### `.docs/instructions.md` - -This file provides instructions for the exercise. It should explicitly explain what the user needs to do (define a function with the signature `X.y(...)` that takes an A and returns a Z), and provide at least one example usage of that function. If there are multiple tasks within the exercise, it should provide an example of each. - -See the C# floating-point-numbers exercise's [instructions.md file](./languages/csharp/concept-exercises/numbers-floating-point/.docs/instructions.md) for an example. - -#### `.docs/hints.md` - -If the user gets stuck, we will allow them to click a button requesting a hint, which shows this file. We will softly discourage them using it. - -The file should contain both general and task-specific "hints". These hints should be enough to unblock almost any user. They might link to the docs of the functions that need to be used. - -See the C# floating-point-numbers exercise's [hints.md file](./languages/csharp/concept-exercises/numbers-floating-point/.docs/hints.md) for an example. - -#### `.docs/after.md` - -Once the user completes the exercise they will be shown this file, which gives them any bonus information or further reading about the concept taught. - -See the C# floating-point-numbers exercise's [after.md file](./languages/csharp/concept-exercises/numbers-floating-point/.docs/after.md) for an example. - -#### `.docs/debug.md` - -This file explains how a user that is coding in the browser can still do "debugging." - -See the C# floating-point-numbers exercise's [debug.md file](./languages/csharp/concept-exercises/numbers-floating-point/.docs/debug.md) for an example. - -## Repository structure - -Things are grouped into several subdirectories: - -- **concepts:** This directory contains files discussing **programming** concepts. These documents should provide guidance, limitations, and links for maintainers who need to expound those ideas on their tracks. -- **languages:** A directory for each language containing a README.md that outlines the concepts that are necessary to learn to become fluent in those languages. Each language has a config.json and the following subdirectories: - - - **transitions:** Contains a file for each pair of languages, where someone with a background in X learns new language Y. These should explain the concepts that needed to be remapped/learnt. The files in this directory initially aim to help inform us about both the language-agnostic and language-specific files, but will hopefully also in the long-run provide custom pathways for people learning languages. - - **info:** Files containing information that the implementer might find useful. These may be files on language-specific elements of programming concepts or notes on the idiomatic way to use tooling. For now, maintainers are encouraged to organise this directory however they feel best, and we may formalise a structure later. - - **concept-exercises:** The WIP concept exercises for that language. - - **config.json** The WIP config.json for a track, with the practice exercises removed to avoid noise. - -- **tooling** This directory contains documents on tooling that is common across languages (either due to a shared ecosystem - such as JS/TS/Clojurescript - or a shared platform - such as .net or JVM). -- **types:** This directory contains files discussing programming types. These documents should provide guidance, limitations, and links for maintainers who need to expound those ideas on their tracks. - -## How to get started - -### Filling out concepts for your language - -To know which Concept Exercises should exist, a list of the language's concepts should first be compiled. There are various resources to use when compiling this list: books, (official) documentation, your own experiences and the concepts listed in this repository. - -As many languages have the same concepts (but possibly implemented differently), it can greatly help to look at what other languages have already done in this regard. See the [C# README.md](./languages/csharp/README.md) for an example. - -It can also be helpful to group related concepts. For example, the Classes, Polymorphism and Inheritance concepts are all object-oriented concepts, which can then be grouped as "Object-oriented concepts". - -Filling out the concepts will be iterative, it is hard to get this right immediately. While creating concepts exercises, you'll probably find missing concepts or perhaps want to split out concepts. - -### Writing your first concept exercise - -Once a list of concepts has been compiled, these then need to be translated into Concept Exercises. Writing your first concept exercise begins with choosing a concept to write an exercise for. Good first concept candidates are concepts that involve working with basic types, like strings and numbers. - -Having chosen a concept, look for the concept's description in this repository. This file should have references to all tracks that have implemented the exercise. You can use these existing implementations as a starting point for your first concept exercise, which you can then tailor to your specific language. +- [What are concept exercise and how they are structured?](./docs/concept-exercises.md) +- [How is this repository structured?](./docs/maintainers/repository-structure.md) diff --git a/_sidebar.md b/_sidebar.md new file mode 100644 index 0000000000..93aedcf1fc --- /dev/null +++ b/_sidebar.md @@ -0,0 +1,8 @@ +- [Start here](/) +- Docs + - [Concept Exercises](/docs/concept-exercises.md) + - [The features of v3](/docs/features-of-v3.md) + - [Rationale for v3](/docs/rationale-for-v3.md) + - [Docs for Maintainers](/docs/maintainers/README.md) +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) diff --git a/concepts/README.md b/concepts/README.md deleted file mode 100644 index 598ec43639..0000000000 --- a/concepts/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Concepts - -This section aims to outline all concepts that are taught within Exercism, providing a canonical description / resource that can be provided by tracks. Within exercise READMEs, tracks should link to the generic description and then go on to outline details of their own language-specific implementations. - -For example, we might have one or many exercises on "enumeration" in Ruby. The exercise README would start by taking the generic description of looping and enumeration from here and then add its own language-specific information. It might read something like this: - -> Most languages have a concept of looping or enumerating through a data-structure. Depending on your background, you might be familiar with "for loops" or maybe using a method `.each`. In you are unfamiliar with the concepts around looping or enumeration, or would like a reminder, check out `[this article](...)`. -> -> In Ruby we generally use enumeration using.... - -We should not presume a programmer knows these topics, and should ensure that tracks explain them clearly both in the general term and how they are used in a language. - -For example the concept of `null` (or `nil` or `None`) does not exist in some languages, and is extremely esoteric the first time it is encountered. We should therefore ensure that we explain its purpose in the language, and provide good documentation for learning more, as well as providing an exercise that demonstrates its language-implementation. diff --git a/docs/_sidebar.md b/docs/_sidebar.md new file mode 100644 index 0000000000..abcf60d235 --- /dev/null +++ b/docs/_sidebar.md @@ -0,0 +1,12 @@ +- [Start here](/) +- Docs + - [Concept Exercises](/docs/concept-exercises.md) + - [The features of v3](/docs/features-of-v3.md) + - [Rationale for v3](/docs/rationale-for-v3.md) + - [Docs for Maintainers](/docs/maintainers/README.md) +- [Languages](/languages/README.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/docs/concept-exercises.md b/docs/concept-exercises.md new file mode 100644 index 0000000000..ab27c23a55 --- /dev/null +++ b/docs/concept-exercises.md @@ -0,0 +1,92 @@ +# Concept Exercises + +Concept Exercises replace V2's Core Exercises. They are exercises designed to teach specific (programming) concepts. + +## What do we mean by concepts? + +By concepts we mean things that a programmer would need to understand to be fluent in a language. We care specifically about how languages are **different**. What do I need to learn differently about numbers in Haskell to numbers in Ruby to be able to work with numbers in those languages. Two questions that we have felt useful to ask to establish this are: + +- If someone learnt Ruby, and someone learnt Haskell, what are the things that the two people learnt that are different? +- If a Ruby programmer learnt Haskell, what new concepts would they have to learn, what knowledge would they have to disregard, and what syntax would they have to remap? + +By teaching concepts we aim to teach fluency. + +## What do we mean by "fluency?" + +By "Fluency", we mean: Do you **get** that language? Can you reason in that language? Do you write that language like a "native" programmer writes in it? Fluency is the ability to express oneself articulately in a particular language. + +"Fluency" is different to "Proficiency", where we use proficiency to mean: Can you write programs in the language (e.g. can you nav stdlib, docs, compose complex code structures). + +Exercism focuses on teaching Fluency not Proficiency. We aim to teach people to understand what a makes a language unique and how experienced programmers in that language would reason about - and solve - problems. + +## How are Concept Exercises designed and structured? + +Concept Exercises must have the following characteristics: + +- Each one has a clear learning goal. +- They are language-specific, not generic. +- Stubs/boilerplate are used to avoid the student having to learn/write unnecessary code on exercises. + +Concept Exercises are **not** mentored. When a user submits a submission that gets the tests passing for a Concept Exercise, we check for an Analyzer or Representer to give feedback. If none is found, then the solution is approved. This shifts the burden of teaching to the exercise, which must provide a clear pathway to learning the concept that is being taught. + +Exercises are unlocked based on concepts taught and learnt. Each Concept Exercise must teach one or more concepts. It may also have prerequisites on Concepts, which means it will not be unlocked until Concept Exercises teaching those prerequisite concepts have been completed. + +Concept Exercises do not share a common base like Practice Exercises do in the `problem-specifications` repository. Instead they "share" Concepts that they are teaching with other languages. This repository aims to list all of those Concepts and provide information about the Concept that maintainers can use as the basis for their own languages. Each Concept should also link to the implementations in different languages. Maintainers are free to copy and paste from each others repositories, and then edit to make things specific to their tracks, but such copy-and-pastes should be considered hard-forks. + +For example, we might define a concept of "Classes" and provide a short introduction that explains what a class is, how it fits with objects, state, etc. We might include a link to a good article introducing OOP and classes. Individual tracks implementing an exercise on Classes can then include this introductory text, making any changes or additions that explain their language-specific semantics and syntax. + +## Exercise Structure + +An exercise has the following files. In the browser they will show at the relevant times. When used via the CLI, the introduction and instructions will be concatenated along with the track's CLI instructions into a README.md, which will sit alongside a HINTS.md. + +### `.docs/introduction.md` + +This file provides an introduction to the concept. It should be explicit about what the exercise teaches and maybe provide a brief introduction to the concepts, but not give away so much that the user doesn't have to do any work to solve the exercise. + +See the C# floating-point-numbers exercise's [introduction.md file][csharp-docs-introduction.md] for an example. + +### `.docs/instructions.md` + +This file provides instructions for the exercise. It should explicitly explain what the user needs to do (define a function with the signature `X.y(...)` that takes an A and returns a Z), and provide at least one example usage of that function. If there are multiple tasks within the exercise, it should provide an example of each. + +See the C# floating-point-numbers exercise's [instructions.md file][csharp-docs-instructions.md] for an example. + +### `.docs/hints.md` + +If the user gets stuck, we will allow them to click a button requesting a hint, which shows this file. We will softly discourage them using it. + +The file should contain both general and task-specific "hints". These hints should be enough to unblock almost any user. They might link to the docs of the functions that need to be used. + +See the C# floating-point-numbers exercise's [hints.md file][csharp-docs-hints.md] for an example. + +### `.docs/after.md` + +Once the user completes the exercise they will be shown this file, which gives them any bonus information or further reading about the concept taught. + +See the C# floating-point-numbers exercise's [after.md file][csharp-docs-after.md] for an example. + +### `.meta/config.json` + +See the C# floating-point-numbers exercise's [config.json file][csharp-meta-config.json] for an example. + +## Track Structure + +### `exercises/.docs/cli.md` + +This file contains information on how to work with the exercise when using the CLI to download and submit the exercise. + +See the C# track's [cli.md file][csharp-docs-cli.md] for an example. + +### `exercises/.docs/debug.md` + +This file explains how a user that is coding in the browser can still do "debugging." + +See the C# track's [debug.md file][csharp-docs-debug.md] for an example. + +[csharp-docs-cli.md]: ../languages/csharp/exercises/.docs/cli.md +[csharp-docs-debug.md]: ../languages/csharp/exercises/.docs/debug.md +[csharp-docs-after.md]: ../languages/csharp/exercises/concept/numbers-floating-point/.docs/after.md +[csharp-docs-hints.md]: ../languages/csharp/exercises/concept/numbers-floating-point/.docs/hints.md +[csharp-docs-introduction.md]: ../languages/csharp/exercises/concept/numbers-floating-point/.docs/introduction.md +[csharp-docs-instructions.md]: ../languages/csharp/exercises/concept/numbers-floating-point/.docs/instructions.md +[csharp-meta-config.json]: ../languages/csharp/exercises/concept/numbers-floating-point/.meta/config.json diff --git a/docs/features-of-v3.md b/docs/features-of-v3.md new file mode 100644 index 0000000000..a5bffe72a9 --- /dev/null +++ b/docs/features-of-v3.md @@ -0,0 +1,32 @@ +# V3 Features + +## Restructured tracks + +_Talk about changes to Concept/Practice exercises, pathways, and unlocking_ +We are restructuring tracks to build new pathways containing "Concept Exercises". + +## Concept Exercises + +_Talk about what makes a good concept exercise and why_ + +These exercises teach the key concepts that someone needs to know when learning a langauge, unlocking other Concept and Pracice Exercises as students proress. Concept Exerisies will have automated feedback and approval, with no delays for mentors. + +## Approaches + +_Talk about what approaches look like and how this will work_ + +We will be automatically grouping similar solutions to Practice Exercises into Approaches. These will be supported with community-sourced articles expounding each approach, discussing its pros, cons, and potential usages. + +## Representers + +_Talk about what representers are, how they work, and how they will help_ + +## In-browser coding + +_Talk about what test runners_ + +We will be adding the ability to solve exercises within the browser. The CLI will remain as a first-class citizen, but v3 will allow people to work their way through a track without having to install anything. + +## Improved profiles + +Profiles will be getting an upgrade - with contributions throughout the site reflected in them. Mentoring, writing exercises, contributing to tracks, and maintaining parts of Exercism will all feature on profiles. Over time, contributing more will also have tangible improvements to your experience, with bumps up mentor queues and access to early testing features. diff --git a/docs/maintainers/README.md b/docs/maintainers/README.md new file mode 100644 index 0000000000..eea06e106b --- /dev/null +++ b/docs/maintainers/README.md @@ -0,0 +1,52 @@ +# Maintainers - How to get started + +Firstly, thank you for your willingness to help with Exercism. We believe that v3 will be a huge step forward in our aim to offer a comprehensive, free learning website to anyone wanting to develop their programming skills, and we're really excited to see it play out. + +**Before doing anything else, please create an issue in this repository asking for your track to be bootstrapped. You can then spend some time learning about the v3 process while we set things up for you.** + +## Getting your track into shape + +There are three stages to getting your track ready: +1) Understanding what needs doing +2) Preparing your track to accept contributions +3) Managing incoming contributions + +We have tried to provide comprehensive documentation on what needs doing, starting with this file, and linking out. If anything can be made clearer, we would really appreciate PRs to these docs, so that we can help each other have the most seamless experience. + +Once your track has been "boostrapped" you'll find a `languages/$LANG/README.md` file with a checklist of things to do. We recommend working through each one in turn. If your track has multiple maintainers we recommend scheduling a Slack conversation as a kick-off meeting and dividing up work and responsibilities. All maintainers will have been invited to Slack. If anyone isn't responding on Slack, please reach out to @ErikSchierboom on Slack, who can email them. + +## New track structures + +The key thing to understand about v3 is that we are making a strong distinction between Concept Exercises and Practice Exercises. All existing exercises will become Practice Exericses - exercises where students can practice the ideas they are learning, and discuss them with a mentor. The new Concept Exercises will be written from scratch, each with the aim of teaching one or more programming concepts that are necessary to become fluent in a given language. + +We want to crowd-source the creation of these Concept Exercises, providing clear guidelines and instructions for contributors. We are doing this by asking maintainers to create a GitHub Issue for each Concept Exercise. + +In order to do this maintainers need to understand what they think their tracks are going to look like. We have determined that the best way to do this is to start to list out all of the Concepts that someone needs to cover to learn a given language. Once this is done, you can start to turn each Concept into an issue that someone in the community can pick up and run with. + +The final step to preparing your language to accept contributions is to provide a sample Concept Exercise that you have written. Not only does this act as an example for other contributors, it is also crucial for you understanding the process and getting your teeth into the detail. + +We recommend choosing a Concept that involves working with basic types, like strings and numbers. Having chosen a Concept, look for the Concept's description in this reference part of this repository. This file should have references to all tracks that have implemented the exercise. You can use these existing implementations as a starting point for your first concept exercise, which you can then tailor to your specific language. + +### Read more + +- [More about Concepts and Concept Exercises](../concept-exercises.md) +- [How to determine Concepts for your track](./determining-concepts.md) +- [How to write Concept Exercise GitHub issues](./writing-a-concept-exercise-github-issue.md) +- [How the repository is structured](./repository-structure.md) +- [Migrating your config.json files](./migrating-your-config-json-files.md) + +## Tooling + +As well as building out the Concept Exercises, your track will also need a Test Runner and a Representer. + +The Test Runner is a piece of software that runs the tests. This enables us to have in-browser coding. Test Runners are surprisingly tricky to get right, with lots of weird edge cases and oddities, so we recommend starting on them quite early. You can learn more about Test Runners in the [automated testing repository](https://github.com/exercism/automated-tests). + +Representers are pieces of software that take a solution and provide a normalised representation of it. We can then attach feedback to those representations, and automatically provide the same feedback for future solutions that normalise to the same representation. You may also like to create an Analyzer, which automatically provides feedback based on heursitics provided by AST matching. You can learn more about Representers and Analysers in our [automated analysis repository](https://github.com/exercism/automated-analysis). + +## Getting help + +Each track has a #maintaining-x channel on [Slack](https://exercism-team.slack.com). We recommend using that to chat amongst yourselves. + +If you need help, the best place to use is the [#maintainers](https://exercism-team.slack.com/archives/GC3K95MRR) channel on Slack. This is a private space where maintainers from all tracks can help each other. + +If you need to work through something more complex, please message @ErikSchierboom on Slack and schedule a time to pair with him. diff --git a/docs/maintainers/_sidebar.md b/docs/maintainers/_sidebar.md new file mode 100644 index 0000000000..c051bec414 --- /dev/null +++ b/docs/maintainers/_sidebar.md @@ -0,0 +1,13 @@ +- [Start here](/) +- Docs + - [Concept Exercises](/docs/concept-exercises.md) + - [The features of v3](/docs/features-of-v3.md) + - [Rationale for v3](/docs/rationale-for-v3.md) + - [Docs for Maintainers](/docs/maintainers/README.md) + - [Determining concepts](/docs/maintainers/determining-concepts.md) + - [Migrating your config.json](/docs/maintainers/migrating-your-config-json-files.md) + - [Repository structure](/docs/maintainers/repository-structure.md) + - [Writing a Concept Exercise](/docs/maintainers/writing-a-concept-exercise-github-issue.md) +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + diff --git a/docs/maintainers/determining-concepts.md b/docs/maintainers/determining-concepts.md new file mode 100644 index 0000000000..1343617f63 --- /dev/null +++ b/docs/maintainers/determining-concepts.md @@ -0,0 +1,11 @@ +# Choosing and defining Concepts + +It is worth reading the start of the [Concept Exercises](../concept-exercises.md) file to familiarise yourself with Concept Exercises and why writing out concepts is important. + +To know which Concept Exercises should exist, a list of the language's concepts should first be compiled. There are various resources to use when compiling this list: books, (official) documentation, your own experiences and the [concepts listed in this repository](../../reference/concepts/README.md). + +As many languages use the same concepts (but possibly implemented differently), it can greatly help to look at what other languages have already done in this regard. See the [C# concepts](../../languages/csharp/reference/README.md) for an example. + +It can also be helpful to group related concepts. For example, the Classes, Polymorphism and Inheritance concepts are all object-oriented concepts, which can then be grouped as "Object-oriented concepts". + +Filling out the concepts will be iterative, it is hard to get this right immediately. While creating concepts exercises, you'll probably find missing concepts or perhaps want to split out concepts. diff --git a/docs/maintainers/generic-how-to-implement-a-concept-exercise.md b/docs/maintainers/generic-how-to-implement-a-concept-exercise.md new file mode 100644 index 0000000000..c3dec8fb2c --- /dev/null +++ b/docs/maintainers/generic-how-to-implement-a-concept-exercise.md @@ -0,0 +1,101 @@ +# How to implement a concept exercise + +This document describes the steps required to implement a concept exercise in any v3 track. As this document is generic, the following placeholders are used: + +- ``: the name of the track in kebab-case (e.g. `ruby`). +- ``: the name of the exercise in kebab-case (e.g. `anonymous-methods`). + +Before implementing the exercise, please make sure you have a good understanding of what the exercise should be teaching (and what not). This information can be found in the exercise's GitHub issue. + +Any concept exercise in any v3 track requires the following files to be created: + +
+languages
+└── <LANG>
+    └── exercises
+        └── concept
+            └── <SLUG>
+                ├── .docs
+                |   ├── instructions.md
+                |   ├── introduction.md
+                |   ├── hints.md
+                |   └── after.md (optional)
+                └── .meta
+                    └── config.json
+
+ +## Step 1: add .docs/introduction.md + +This file contains an introduction to the concept. It should be explicit about what the exercise teaches and maybe provide a brief introduction to the concepts, but not give away so much that the user doesn't have to do any work to solve the exercise. + +## Step 2: add .docs/instructions.md + +This file contains instructions for the exercise. It should explicitly explain what the user needs to do (define a method with the signature `X(...)` that takes an A and returns a Z), and provide at least one example usage of that function. If there are multiple tasks within the exercise, it should provide an example of each. + +## Step 3: add .docs/hints.md + +If the user gets stuck, we will allow them to click a button requesting a hint, which shows this file. We will softly discourage them using it. The file should contain both general and task-specific "hints". These hints should be enough to unblock almost any + +## Step 4: add .docs/after.md (optional): + +Once the user completes the exercise they will be shown this file, which gives them any bonus information or further reading about the concept taught. + +These files are also all described in the [concept exercises document][docs-concept-exercises]. + +## Step 5: add .meta/config.json + +This file contains metadata for the exercise. The metadata includes paths to the test file and the solution files, as well as a list of all the tests and the method they are calling. + +## Step 6: update languages//config.json + +An entry should be added to the track's `config.json` file for the new concept exercise: + +```json +{ + ... + "exercises": { + "concept": [ + ... + { + "slug": "", + "uuid": "", + "concepts": [""], + "prerequisites": ["", ""] + } + ] + } +} +``` + +## Step 7: adding track-specific files + +Having added the files that are not specific to the track, now is the time to create the track-specific files. These file will include: + +- A stub implementation file. +- A file containing the test suite. +- An example implementation file that passes all the tests. + +What these files look like depends on your track. Note that some tracks might require more files in addition to the three files just mentioned. + +## Step 8: add analyzer (optional) + +Some exercises could benefit from having an exercise-specific analyzer. If so, please check the track's analyzer document for details on how to do this. + +Skip this step if your track does not have an analyzer. + +## Step 9: custom representation (optional) + +Some exercises could benefit from having an custom representation as generated by the track's representer. If so, please check the track's representer document for details on how to do this. + +Skip this step if your track does not have a representer. + +## Inspiration + +When implementing an exericse, it can be very useful to look at the exercises the track has already implemented. You can also check the exercise's [general concepts documents][reference] to see if other languages that have already an exercise for that concept. + +## Help + +If you have any questions regarding implementing this exercise, please post them as comments in the exercise's GitHub issue. + +[docs-concept-exercises]: ../concept-exercises.md +[reference]: ../../reference/concepts/README.md diff --git a/docs/maintainers/migrating-your-config-json-files.md b/docs/maintainers/migrating-your-config-json-files.md new file mode 100644 index 0000000000..01140d2c86 --- /dev/null +++ b/docs/maintainers/migrating-your-config-json-files.md @@ -0,0 +1,36 @@ +# Migrating your config.json files + +For v3, the existing `config.json` files will need to be updated. You can use the [C# config.json](../../languages/csharp/config.json) for reference. + +1. Add a version property: + +```json +"version": 3 +``` + +2. Add online editor settings: + +```json +"online_editor": { + "indent_style": "space", + "indent_size": 2 +} +``` + +- `indent_style`: set to `"tab"` or `"space"` to use hard tabs or soft tabs respectively. +- `indent_size`: a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). + +3. Convert the `"exercises"` array to an object with two properties: + +```json +"exercises": { + "concept": [], + "practice": [] +} +``` + +4. Added concepts for all Practice Exercises + +The existing exercises are temporarily removed from the `config.json` file. They will return as practice exercises once the concept exercises have been added. + +More details will be added at a later stage. diff --git a/docs/maintainers/repository-structure.md b/docs/maintainers/repository-structure.md new file mode 100644 index 0000000000..d7cb661c62 --- /dev/null +++ b/docs/maintainers/repository-structure.md @@ -0,0 +1,65 @@ +# How is this repository structured? + +This repository can be viewed both via GitHub and via the v3 website. This page describes the repository as found on GitHub. It is roughly equivalent to the website, with filenames being titelized. + +Things are grouped into several subdirectories: + +## [Docs][docs] + +This directory contains files for both the public, and maintainers, explaining what v3 is and how to contribute. + +## [Reference][reference] + +A list of reference documents for the various CS concepts, types, paradigms, etc. + +- **concepts:** This directory contains files discussing **programming** concepts. These documents should provide guidance, limitations, and links for maintainers who need to expound those ideas on their tracks. +- **paradigms** This directory contains files discussing programming paradigms. These documents should link to the concepts typically associated with the paradigms. +- **tooling** This directory contains documents on tooling that is common across languages (either due to a shared ecosystem - such as JS/TS/Clojurescript - or a shared platform - such as .net or JVM). +- **types:** This directory contains files discussing programming types. These documents should provide guidance, limitations, and links for maintainers who need to expound those ideas on their tracks. + +## [Languages][languages] + +Each track has it's own directory containing a README.md that outlines the concepts that are necessary to learn to become fluent in those languages. Each language has a `config.json` file and the following subdirectories: + +- **config.json** The updated config.json for a track, with the practice exercises removed to avoid noise. +- **docs:** This directory contains files for both the public, and maintainers, describing the C# v3 track and how to contribute. It is envisioned that these documents will be linked to from issues and discussions to provide canonical answers or guidance. +- **exercises:** The exercises for that language. + - **.docs:** Exercise documentation shared across all exercises for that language. + - **concept:** The Concept Exercises for that language. + - **practice:** The Practice Exercises for that language. +- **README.md:** The track's README, which should contain a short description of the goal of the repository as well as the status of the track's v3 transition. A template is provided during the bootstrapping process. +- **reference:** Files that help maintainers develop the track. These could be reference documents that help explain track-specific concepts for which no appropriate online document could be found, files on language-specific elements of programming concepts, or something else. Maintainers are free to organise this directory in the way they feel it best contributes to developing their track. +- **transitions:** Contains a file for each pair of languages, where someone with a background in X learns new language Y. These should explain the concepts that needed to be remapped/learnt. The files in this directory initially aim to help inform us about both the language-agnostic and language-specific files, but will hopefully also in the long-run provide custom pathways for people learning languages. + +## GitHub + +The following labels are used to categorize [issues in the v3 repository][github-issues]: + +- [type/new-exercise][github-issues-type-new-exercise]: new exercises. +- [type/improve-exercise][github-issues-type-improve-exercise]: improving exercises. +- [type/new-reference][github-issues-type-new-reference]: new reference documents. +- [type/improve-reference][github-issues-type-improve-reference]: improving reference documents. +- [status/help-wanted][github-issues-status-help-wanted]: help wanted. +- [status/in-progress][github-issues-status-in-progress]: being worked on. + +Each language also has its own label: + +- [track/go][github-issues-track-go]: the Go track. +- [track/ruby][github-issues-track-ruby]: the Ruby track. +- Etc. + +You can combine labels to find the issues you'd like, e.g. to [list all the issues for the C# for which help is wanted][github-issues-csharp-status-help-wanted]. + +[docs]: ./README.md +[languages]: ../../languages/README.md +[reference]: ../../reference/README.md +[github-issues]: https://github.com/exercism/v3/issues +[github-issues-type-new-exercise]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fnew-exercise +[github-issues-type-improve-exercise]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fimprove-exercise +[github-issues-type-new-reference]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fnew-reference +[github-issues-type-improve-reference]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atype%2Fimprove-reference +[github-issues-status-help-wanted]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Astatus%2Fhelp-wanted +[github-issues-status-in-progress]: https://github.com/exercism/v3/issues?q=is%3Aopen+is%3Aissue+label%3Astatus%2Fin-progress +[github-issues-track-go]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atrack%2Fgo +[github-issues-track-ruby]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atrack%2Fruby +[github-issues-csharp-status-help-wanted]: https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Astatus%2Fhelp-wanted+label%3Atrack%2Fcsharp+ diff --git a/docs/maintainers/writing-a-concept-exercise-github-issue.md b/docs/maintainers/writing-a-concept-exercise-github-issue.md new file mode 100644 index 0000000000..4b948f9fa6 --- /dev/null +++ b/docs/maintainers/writing-a-concept-exercise-github-issue.md @@ -0,0 +1,13 @@ +# Writing a Concept Exercise GitHub issue + +The GitHub issues we create for Concept Exercises need to contain quite a lot of information for an implementer to be able to work from. + +We have provided an [Issue Template](https://github.com/iHiD/v3/issues/new?assignees=&labels=type%2Fnew-exercise%2C+status%2Fhelp-wanted&template=implement-concept-exercise.md&title=%5B%3CLANG%3E%5D+Implement+new+concept+exercise%3A+%3CSLUG%3E) that needs to be filled in for each exercise. Part of that template requires an guide on how to implement the Concept Exercise for the specific track. + +To help with that, each track should create a standard "Implementation Guide", which can be copy+pasted into the new issue. That file should be stored in `languages/$SLUG/docs/implementing-a-concept-exercise.md` + +To make this as straightforward as possible for you, we have provided: + +- [A sample C# issue](../../languages/csharp/docs/examples/new-concept-exercise-arrays.md) to give you an idea of how a finished issue should look. +- [The C# implementation file](../../languages/csharp/docs/implementing-a-concept-exercise.md) to be clear on how this specific section should look +- [A base file](./generic-how-to-implement-a-concept-exercise.md) for you to work from. diff --git a/docs/rationale-for-v3.md b/docs/rationale-for-v3.md new file mode 100644 index 0000000000..7afc768b01 --- /dev/null +++ b/docs/rationale-for-v3.md @@ -0,0 +1,68 @@ +# Rationale for v3 + +## Background + +Exercism v1 (the original site) had no concept of progression or structure within a language. A track was a bucket of exercises, which users were free to choose from. + +In designing v2, we added a structured pathway (core exercises) which aimed to take a user through the basis of what they needed to know for that language, then additional (side) exercises that allowed them to explore other related concepts. This worked great in theory, but a year later, despite a lot of work by maintainers, no tracks have core pathways that do a great job of comprehensively teaching the key concepts. + +Why is this? + +Firstly, we believe the key reason is that we have encouraged maintainers to reorder their existing tracks, rather than design their tracks from scratch. The original exercises were never designed to teach language concepts - they were just chosen as fun things to experiment with - so shoehorning these into a "curriculum" is a painful, and probably impossible, task for maintainers. Secondly, in our strategies in trying to achieve this, we have focused too much on what was similar about languages, and not looked enough at the key question of "what makes languages unique?" + +## Problems with v2 + +We've been taking stock of this situation recently and spending time trying to work out what the content of an Exercism track should look like in order to fulfil the design goals of v2. + +At the moment the journey for a student is: + +- Be given an exercise. +- Try something - normally via an incorrect approach grounded from previous language experience. +- Be told what you should have been doing. +- Work out how to redo it that way. + +That sometimes works really well. The mentor gives feedback that neither gives away the answer, nor is frustratingly vague, the student realises a new approach, gets a dopamine hit, and memorizes the new technique. This is similar to how many learning natural-language courses (such as Rosetta Stone) work, where you are given a set of images, and some text, and you have to work out which is which. At the start you have no idea, but as you are corrected you start to work out what the words mean, and the resulting dopamine hit locks the knowledge into your mind. + +However, in reality on Exercism, this is often a frustrating process for students. For more complex exercises (I'm looking at you, Bob), the student will often have no idea of the idiomatic way to approach it, and so writes a very different and unidiomatic implementation, giving a mentor a huge amount of work to take them on a journey to an idiomatic solution. This can be hugely frustrating for the student, who can't see the end goal enough to be able to understand why they're being taken on the journey, and is a huge piece of work for the mentors (indeed, tracks pretty reliably fail as soon as a complex exercise like Bob is introduced). There are also huge waits between submitting an exercise and receiving feedback, and that break of flow reduces a lot of the positive excitement from learning something. Everything also relies on the mentor knowing exactly what the exercise is aiming for and not taking the student down random roads that are not appropriate to the point in the track. We have tried to solve some of these issues with the automatic analyzers, but the large potential amount of solutions submitted to an exercise, makes this a slow and unwieldy development endeavour (analyzers are hard to write!). + +## Moving towards v3 + +In learning programming languages, it is essential to understand a concept, work out how to apply that concept, and then practice using that concept in different examples. + +At the moment I don't feel like we get this right. We let a student experiment and get it wrong, then give some hints, then ask them to work it out from that and maybe receive more hints. I'm not convinced that at the end of an exercise a student really understands what they've learnt, or how to apply it in the future. This is validated by the fact that on later exercises students often make the same "mistakes" they made early on, or don't apply the techniques they've been introduced to. + +I believe the key area where we are failing our students is in not having a clearer separation between explaining a concept and giving the student an opportunity to play. At no point does Exercism actually go about teaching the concepts that someone needs to learn a language - we rely on mentors giving the correct hints when a student makes a mistake. I believe we need to rework core and side exercises to achieve this. I propose renaming "core exercises" to Concept Exercises and structuring them so that they introduce a specific concept in the instructions and then challenge the student to use that concept in producing a solution; and renaming "side exercises" to Practice Exercises, which are designed to allow students to solve an arbitary problem, with the aim of them making use of the concepts they have learnt so far. + +### Concept Exercises + +Concepts Exercises should have the following characteristics: + +- Each one has a clear learning goal. +- They are language-specific, not generic. +- We use stubs/boilerplate to avoid the student having to learn/handle unnecessary code on exercises. + +As Concept Exercises will be smaller and contain boilerplate, they will be much easier to generate auto-analyzers for. By also adding [Representers](https://github.com/exercism/exercism/issues/5079) we believe we can achieve 95% auto-analysis of iterations. We will automatically post feedback both giving students tips when they submit an approvable solution, but also providing guidance where the iteration is not approvable. Furthermore, our analyzers will automatically approve any approvable iteration, removing the tension/frustration that is often caused by that power lying with mentors. For the small percentage of solutions that cannot be automatically analyzed, we will automatically approve the exercise letting the student move on, and then provide feedback later once their solution has had a mentor look at it - feedback that will then be stored to be automatically applied to future similar solutions. + +We will also be changing some of the rules around unlocking. Multiple Concept Exercises will be able to be unlocked at the same time, and Concept Exercises can unlock more complex, related Concept Exercises (e.g. Ruby might have a blocks Concept Exercise, which when completed unlocks exercises on Procs, Lambdas, block_given?, etc). + +We will also change the way unlocking works, so rather than being explicitly stated in track configurations, unlocking will be implicitly worked out by the tagging of "concepts learnt" on Concept Exercises, and "prerequisite concepts" on Practice Exercises. Once enough Concept Exercises have been completed that all the prerequisite concepts for a Practice Exercise has been been fulfilled, that Practice Exercise will be unlocked. + +Concept Exercises will not share a generic base such as problem-specifications. However, we will write language-agnostic introductions to programming concepts, with links to language-generic resources on that topic, which we will ask tracks to use. For example, we might define a concept of "Enumeration" and provide a short introduction that explains how enumeration differs from loops with a link out to a good article (either internal to Exercism or elsewhere on the web). Tracks implementing an exercise on enumeration can then include this common paragraph, before explaining their own language-specific semantics and syntax. + +### Practice Exercises + +Practice Exercises should be story-based than concept-based. They should provide an interesting challenge, which a student can try and solve using the concepts they have been taught. The existing set of Exercism exercises are generally great Practice Exercise candidates. + +There will be no "approval" for Practice Exercises. A student solves the exercise against the tests and submits it. They can then choose to publish, or submit further iterations. + +We will provide automated analysis of Practice Exercises, but only as tips for how things could be made more idiomatic, referring back to the Concepts previously taught. We expect this analysis to take lower priority than on Concept Exercises (as students are not blocked) so it should be seen as a nice bonus feature, not something that the exercise or student should rely on. + +Once submitted, the student will have the option to browse different "Approaches". These will be articles written by our community explaining the various common (or possible) approaches to this exercises, outlining the pros/cons and tradeoffs of the approach. We will link to curated examples of user-submitted solutions that adhere to the various approaches for students to explore further. We will crowd-source these approaches, giving the community the option to become Exercism Authors, but will have a review process to ensure a solid quality-barrier. For exercises that do not yet have "Approaches" written, we will automatically group solutions by AST analysis, for students to browse. + +Finally, students can ask the community a question about their exercise. e.g. "I've read this approach but I don't understand how XYZ works and how I can apply it to my code". Community members can then reply to the student with their thoughts - a little like the community interactions on v1. We will make it explicit to students that when they ask a question they are not getting "mentor-quality" feedback, but tapping into the hive-mind of the community. This will also help us add a fair gatekeeping level for mentors. Community-mentors who answer questions helpfully, and have therefore proven their ability to communicate empathetically and helpfully, will have the option to become mentors. + +We intend for Practice Exercises to be shared across tracks, as they currently are, but we need to put together solutions for some of the challenges the Problem Specifications repository has encountered recently. We will be writing up a separate issue for discussion about that in the next few days. + +### Practice Mode + +We also intend to maintain Practice Mode ([formally Independent Mode](https://exercism.io/blog/independent-mode-becomes-practice-mode)), but encourage it as a space for practicing a language that a student knows, rather than learning a new language. It will contain only Practice Exercises and we will make the prerequisite topics on each exercise clearer for those who want to practice certain concepts. Students will be able to ask questions to the community about their exercises, but not directly to mentors. diff --git a/index.html b/index.html new file mode 100644 index 0000000000..21288cc167 --- /dev/null +++ b/index.html @@ -0,0 +1,30 @@ + + + + + Document + + + + + + +
+ + + + + diff --git a/languages/README.md b/languages/README.md index 5bde4ec509..0f21023c98 100644 --- a/languages/README.md +++ b/languages/README.md @@ -1,7 +1,41 @@ # Languages -A directory for each programming language. +## Contributing -Each containing a README.md listing the concepts used in the programming language, and a `transitions` folder listing transitions from one language to another. +Thanks for wanting to contribute to one of Exercism's language tracks! Contributions are very welcome! -Tracks may include subdirectories for topics that are not covered elsewhere (e.g. keywords) +To contribute, please select the language you'd like to contribute to: + +- [C][c] +- [CoffeeScript][coffeescript] +- [C++][cplusplus] +- [C#][csharp] +- [Dart][dart] +- [F#][fsharp] +- [Go][go] +- [Haskell][haskell] +- [Java][java] +- [JavaScript][javascript] +- [Julia][julia] +- [Kotlin][kotlin] +- [Python][python] +- [Ruby][ruby] +- [Typescript][typescript] + +[c]: ./c/README.md +[coffeescript]: ./coffeescript/README.md +[cplusplus]: ./cplusplus/README.md +[csharp]: ./csharp/README.md +[dart]: ./dart/README.md +[fsharp]: ./fsharp/README.md +[go]: ./go/README.md +[haskell]: ./haskell/README.md +[java]: ./java/README.md +[javascript]: ./javascript/README.md +[julia]: ./julia/README.md +[kotlin]: ./kotlin/README.md +[python]: ./python/README.md +[ruby]: ./ruby/README.md +[typescript]: ./typescript/README.md + +If you would like to create a new language track for v3, please [open an issue here](https://github.com/exercism/request-new-language-track). diff --git a/languages/_sidebar.md b/languages/_sidebar.md new file mode 100644 index 0000000000..2e5f6422f0 --- /dev/null +++ b/languages/_sidebar.md @@ -0,0 +1,23 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) + - [C](/languages/c/README.md) + - [CoffeeScript](/languages/coffeescript/README.md) + - [C++](/languages/cplusplus/README.md) + - [C#](/languages/csharp/README.md) + - [Dart](/languages/dart/README.md) + - [F#](/languages/fsharp/README.md) + - [Go](/languages/go/README.md) + - [Haskell](/languages/haskell/README.md) + - [Java](/languages/java/README.md) + - [JavaScript](/languages/javascript/README.md) + - [Julia](/languages/julia/README.md) + - [Kotlin](/languages/kotlin/README.md) + - [Python](/languages/python/README.md) + - [Ruby](/languages/ruby/README.md) + - [Typescript](/languages/typescript/README.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/languages/coffeescript/keywords/while.md b/languages/coffeescript/keywords/while.md index e9455d5808..4f3a7eb123 100644 --- a/languages/coffeescript/keywords/while.md +++ b/languages/coffeescript/keywords/while.md @@ -2,7 +2,7 @@ The only low-level [loop][concept-loops] that CoffeeScript provides is the while loop. The main difference from [JavaScript][language-javascript] is that the `while` loop can be used as an expression, returning an [array][type-array] containing the result of each [iteration through the loop][concept-enumeration]. -[concept-enumeration]: ../../../concepts/enumeration.md -[concept-loops]: ../../../concepts/loops.md +[concept-enumeration]: ../../../reference/concepts/enumeration.md +[concept-loops]: ../../../reference/concepts/loops.md [language-javascript]: ../../javascript/README.md -[type-array]: ../../../types/array.md +[type-array]: ../../../reference/types/array.md diff --git a/languages/coffeescript/operators/logical-not.md b/languages/coffeescript/operators/logical-not.md index 2cac35e914..2d4f609bc6 100644 --- a/languages/coffeescript/operators/logical-not.md +++ b/languages/coffeescript/operators/logical-not.md @@ -15,5 +15,5 @@ It is possible to use a couple of NOT operators in series to explicitly force th https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators#Logical_NOT -[concept-truthy_and_falsy]: ../../../concepts/truthy_and_falsy.md -[type-boolean]: ../../../types/boolean.md +[concept-truthy_and_falsy]: ../../../reference/concepts/truthy_and_falsy.md +[type-boolean]: ../../../reference/types/boolean.md diff --git a/languages/csharp/README.md b/languages/csharp/README.md index ecea3be1f1..aa81c0dfc0 100644 --- a/languages/csharp/README.md +++ b/languages/csharp/README.md @@ -1,260 +1,52 @@ -_Note: All subconcepts should be split out into separate files under the concepts directory and hyperlinked._ - # C# -C# is an object-oriented language. - -## Concepts - -### Object-oriented - -The core OO features a C# developer should know about are: - -- [Encapsulation](../../concepts/encapsulation.md) -- [Classes](../../concepts/classes.md) -- [Objects](../../concepts/objects.md) -- [State](../../concepts/state.md) -- [Mutation](../../concepts/mutation.md) -- [Composition](../../concepts/composition.md) -- [Inheritance](../../concepts/inheritance.md) -- [Interfaces](../../concepts/interfaces.md) -- [Polymorphism](../../concepts/polymorphism.md) -- [Methods](../../concepts/methods.md) - -### Functional - -While C# is primarily an OO language, lots of functional concepts have been added to the language: - -- [Immutability](../../concepts/immutability.md) -- [Pattern matching](../../concepts/pattern_matching.md) -- [Higher-order functions](../../concepts/higher_order_functions.md) -- [Type inference](../../concepts/type_inference.md) -- [Anonymous methods](../../concepts/anonymous_functions.md) -- [Recursion](../../concepts/recursion.md) -- [Local functions](../../concepts/nested_functions.md) -- [Pipelines (LINQ)](../../concepts/pipelines.md) - -### Platform-specific - -- [Assemblies](../../tooling/dotnet-assemblies.md) - -### Memory management - -- Resource passing -- Resource allocation -- Resource cleanup -- Resource lifetime - -### Arithmetic - -- Arithmetic overflow -- Signed integers -- Unsigned integers -- Floating point numbers - -### Methods - -- Method overloading -- Named arguments -- Optional arguments -- Extension methods (mixin) - -### General - -- [Sameness](../../concepts/sameness.md) -- [Conditionals](../../concepts/conditionals.md) -- [Enumeration](../../concepts/enumeration.md) -- Iterators (yield) -- Namespaces -- [Generics](../../concepts/generics.md) -- Exception handling -- Type casting (includes boxing/unboxing) -- Anonymous types -- Concurrency -- Asynchronous programming -- Expressions vs statements -- Attributes -- Slicing -- Unsafe code -- Implicit/explicit conversion - - Type casting (includes boxing/unboxing) -- Reflection - -## Concept dependencies - -Some of these dependencies will be dependent on how the actual exercise is implemented. For example, if the "Classes" concept is implemented with methods that use strings, than the "Strings" concept will be a dependency. The current list does not include those implementation details, as the concept exercises have not yet been designed. This means that this list is a work in progress. - -The list itself should be read as follows: - -- [concept] - - [concept-prerequisite1] - - [concept-prerequisite2] - - ... - -This also means that some concepts will be listed more than once. - -### Object-oriented - -- [Encapsulation](../../concepts/encapsulation.md) - - [Classes](../../concepts/classes.md) -- [Classes](../../concepts/classes.md) -- [Objects](../../concepts/objects.md) - - [Classes](../../concepts/classes.md) -- [State](../../concepts/state.md) - - [Classes](../../concepts/classes.md) -- [Mutation](../../concepts/mutation.md) -- [Composition](../../concepts/composition.md) - - [Classes](../../concepts/classes.md) - - [Objects](../../concepts/objects.md) -- [Inheritance](../../concepts/inheritance.md) - - [Classes](../../concepts/classes.md) -- [Interfaces](../../concepts/interfaces.md) - - [Classes](../../concepts/classes.md) -- [Polymorphism](../../concepts/polymorphism.md) - - [Inheritance](../../concepts/inheritance.md) -- [Methods](../../concepts/methods.md) - - [Classes](../../concepts/classes.md) - -### Functional - -- [Immutability](../../concepts/immutability.md) - - [Mutation](../../concepts/mutation.md) -- [Pattern matching](../../concepts/pattern_matching.md) - - [Conditionals](../../concepts/conditionals.md) -- [Recursion](../../concepts/recursion.md) -- [Local functions](../../concepts/nested_functions.md) - - [Classes](../../concepts/classes.md) -- [Pipelines (LINQ)](../../concepts/pipelines.md) - - [Higher-order functions](../../concepts/higher_order_functions.md) - - [Type inference](../../concepts/type_inference.md) - - [Anonymous methods](../../concepts/anonymous_functions.md) - - Anonymous types -- [Higher-order functions](../../concepts/higher_order_functions.md) -- [Type inference](../../concepts/type_inference.md) -- [Anonymous methods](../../concepts/anonymous_functions.md) - - [Higher-order functions](../../concepts/higher_order_functions.md) - -### Platform-specific - -- [Assemblies](../../tooling/dotnet-assemblies.md) - -### Memory management - -- Resource passing - - [Objects](../../concepts/objects.md) -- Resource allocation - - [Classes](../../concepts/classes.md) - - [Objects](../../concepts/objects.md) - - Resource lifetime (static/non-static) -- Resource cleanup - - [Objects](../../concepts/objects.md) - - Resource lifetime (static/non-static) -- Resource lifetime (static/non-static) - - [Classes](../../concepts/classes.md) - - [Objects](../../concepts/objects.md) - -### Arithmetic - -- Arithmetic overflow - - Unsigned integers -- Signed integers -- Unsigned integers - - Signed integers -- Floating point numbers - -### Methods +Welcome to the workspace for Exercism v3's C# track! -- Method overloading - - [Classes](../../concepts/classes.md) -- Named arguments -- Optional arguments -- Extension methods (mixin) - - Resource lifetime (static/non-static) +This area will contain everything needed to launch the C# track, including: -### General +- The new exercises and `config.json` file. +- Reference documentation that help explain C# concepts for which no appropriate online document could be found. +- C#-specific documentation for contributors. -- [Sameness](../../concepts/sameness.md) -- [Conditionals](../../concepts/conditionals.md) - - [Sameness](../../concepts/sameness.md) -- [Enumeration](../../concepts/enumeration.md) -- Iterators (yield) - - [Enumeration](../../concepts/enumeration.md) -- Namespaces -- [Generics](../../concepts/generics.md) -- Exception handling -- Type casting (includes boxing/unboxing) -- Anonymous types - - [Classes](../../concepts/classes.md) - - [Anonymous methods](../../concepts/anonymous_functions.md) -- Concurrency (includes locking and concurrent collections) -- Asynchronous programming -- Expressions vs statements -- Attributes -- Slicing -- Locks -- Unsafe code -- Implicit/explicit conversion -- Reflection +## Preparation Status -## Types +Before we publicize requesting contribution for this language, the following steps should be done. -- [bool](../../types/boolean.md) -- [string](../../types/string.md) -- [char](../../types/char.md) -- object -- Enum -- [Null](../../types/null.md) -- [Nullable type](../../types/nullable.md) -- `Span` -- `Memory` -- [Range](../../types/range.md) -- Event -- Delegate +- [ ] Have a kick-off discussion between track maintainers. +- [ ] [Write a Concept Exercise implementation guide](../../docs/maintainers/writing-a-concept-exercise-github-issue.md) +- [ ] [List out key Concepts for your language](../../docs/maintainers/determining-concepts.md) +- [ ] [Add GitHub issues for 20 Concept Exercises](../../docs/maintainers/writing-a-concept-exercise-github-issue.md) -### Numeric +## Readiness for Launch -- [int](../../types/integer.md) -- [uint](../../types/integer.md) -- [byte](../../types/byte.md) -- [sbyte](../../types/byte.md) -- [short](../../types/short.md) -- [ushort](../../types/short.md) -- [long](../../types/long.md) -- [ulong](../../types/long.md) -- [double](../../types/double.md) -- [float](../../types/single.md) -- [decimal](../../types/decimal_number.md) -- [BigInteger](../../types/big_integer.md) +Before launch, we need all of the following parts to be completed: -Note: as can be seen, there are many signed/unsigned data type combinations (e.g. `int`/`uint` and `long`/`ulong`). In practice, the unsigned data types are used far less often then the signed ones, so we should probably start with teaching the signed versions. The unsigned versions can then be taught later on. +### Track Structure -### Collections +- [ ] Implemented 20+ Concept Exercises +- [ ] [Updated `config.json`](../../docs/maintainers/migrating-your-config-json-files.md) + - [ ] Added `version` key + - [ ] Added online editor settings + - [ ] Added `indent_style` + - [ ] Added `indent_size` + - [ ] Added Concept Exercises + - [ ] Added Concepts for all Practice Exercises -- [Array](../../types/array.md) -- [List](../../types/list.md) -- [Dictionary](../../types/map.md) -- [HashSet](../../types/set.md) -- [Stack](../../types/stack.md) -- [Queue](../../types/deque.md) -- Enumerable -- ConcurrentDictionary (and other concurrent ) -- Non-generic collections +### Representer -Note: The non-generic collections (such as `ArrayList`) are a remnant of the C# 1.0 days, and have been superseded by generic variants when generics were introduced in C# 2.0. As nobody uses the non-generic collections anymore, we'll ignore them. +- [x] Build Representer +- [ ] Deploy Representer -### Composite +### Test Runner -- [Class](../../types/class.md) -- [Struct](../../types/struct.md) -- [ValueTuple](../../types/tuple.md) -- [Tuple](../../types/tuple.md) +- [x] Build Test Runner +- [x] Deploy Test Runner -Note: these types are essentially a grouping of one or more other types. As such, it is important to have taught the student several of these other, basic types before teaching these composite types. +## Extra magic -Note: the `Tuple` type has been superseded by the `ValueTuple` type, which is why we should only be teaching the latter. +These extra steps will make your track better, but are optional. -## Resources +### Analyzer -- Official language reference: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/ -- https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/index -- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table +- [x] Build Analyzer +- [x] Deploy Analyzer diff --git a/languages/csharp/_sidebar.md b/languages/csharp/_sidebar.md new file mode 100644 index 0000000000..01a552e4c9 --- /dev/null +++ b/languages/csharp/_sidebar.md @@ -0,0 +1,12 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) + - [C#](/languages/csharp/README.md) + - [Docs](/languages/csharp/docs/README.md) + - [Exercises](/languages/csharp/exercises/README.md) + - [Reference](/languages/csharp/reference/README.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/cli.md b/languages/csharp/concept-exercises/bitwise-operations/.docs/cli.md deleted file mode 100644 index b4454045de..0000000000 --- a/languages/csharp/concept-exercises/bitwise-operations/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit BitwiseOperations.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperationsTest.cs b/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperationsTest.cs deleted file mode 100644 index f815e52870..0000000000 --- a/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperationsTest.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Xunit; - -public class PermissionsTest -{ - [Theory] - [InlineData(AccountType.Guest, Permission.Read)] - [InlineData(AccountType.User, Permission.Read | Permission.Write)] - [InlineData(AccountType.Moderator, Permission.Read | Permission.Write | Permission.Delete)] - public void Default(AccountType accountType, Permission expected) => - Assert.Equal(expected, Permissions.Default(accountType)); - - [Theory] - [InlineData((AccountType)123)] - [InlineData((AccountType)7)] - public void DefaultForUnknownAccountType(AccountType accountType) => - Assert.Equal(Permission.None, Permissions.Default(accountType)); - - [Theory] - [InlineData(Permission.None, Permission.Read, Permission.Read)] - [InlineData(Permission.Read, Permission.Read, Permission.Read)] - [InlineData(Permission.Read, Permission.None, Permission.Read)] - [InlineData(Permission.Write, Permission.Read, Permission.Write | Permission.Read)] - [InlineData(Permission.Delete, Permission.Read, Permission.Delete | Permission.Read)] - [InlineData(Permission.Read | Permission.Write, Permission.Delete, Permission.Read | Permission.Write | Permission.Delete)] - [InlineData(Permission.All, Permission.None, Permission.All)] - [InlineData(Permission.All, Permission.Read, Permission.All)] - public void Grant(Permission permission, Permission permissionToGrant, Permission expected) => - Assert.Equal(expected, Permissions.Grant(permission, permissionToGrant)); - - [Theory] - [InlineData(Permission.None, Permission.Read, Permission.None)] - [InlineData(Permission.Read, Permission.Write, Permission.Read)] - [InlineData(Permission.Read, Permission.All, Permission.None)] - [InlineData(Permission.Write, Permission.None, Permission.Write)] - [InlineData(Permission.Delete, Permission.Delete, Permission.None)] - [InlineData(Permission.Read | Permission.Write, Permission.Write, Permission.Read)] - [InlineData(Permission.All, Permission.Delete, Permission.Read | Permission.Write)] - [InlineData(Permission.All, Permission.Read | Permission.Write, Permission.Delete)] - public void Revoke(Permission permission, Permission permissionToRevoke, Permission expected) => - Assert.Equal(expected, Permissions.Revoke(permission, permissionToRevoke)); - - [Theory] - [InlineData(Permission.None, Permission.Read, false)] - [InlineData(Permission.None, Permission.Write, false)] - [InlineData(Permission.None, Permission.Delete, false)] - [InlineData(Permission.None, Permission.All, false)] - [InlineData(Permission.All, Permission.Read, true)] - [InlineData(Permission.All, Permission.Write, true)] - [InlineData(Permission.All, Permission.Delete, true)] - [InlineData(Permission.All, Permission.All, true)] - [InlineData(Permission.Read, Permission.Read, true)] - [InlineData(Permission.Write, Permission.Write, true)] - [InlineData(Permission.Delete, Permission.Delete, true)] - [InlineData(Permission.Read | Permission.Write, Permission.Read, true)] - [InlineData(Permission.Read | Permission.Write, Permission.Write, true)] - [InlineData(Permission.Read | Permission.Write, Permission.Delete, false)] - [InlineData(Permission.Read | Permission.Write, Permission.All, false)] - [InlineData(Permission.Write | Permission.Delete, Permission.Read, false)] - [InlineData(Permission.Write | Permission.Delete, Permission.Write, true)] - [InlineData(Permission.Delete | Permission.Read, Permission.Delete, true)] - public void Check(Permission owned, Permission desired, bool expected) => - Assert.Equal(expected, Permissions.Check(owned, desired)); -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/dates/.docs/cli.md b/languages/csharp/concept-exercises/dates/.docs/cli.md deleted file mode 100644 index 49e2e1b986..0000000000 --- a/languages/csharp/concept-exercises/dates/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit Dates.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/dates/.docs/debug.md b/languages/csharp/concept-exercises/dates/.docs/debug.md deleted file mode 100644 index 8be437efc1..0000000000 --- a/languages/csharp/concept-exercises/dates/.docs/debug.md +++ /dev/null @@ -1,10 +0,0 @@ -# Debug - -When a test fails, a message is displayed describing what went wrong and for which input. You can also use the fact that any [console output][programiz.com-basic-input-output] will be shown too. You can write to the console using: - -```csharp -Console.WriteLine("Debug message"); -``` - -[docs-string]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/ -[programiz.com-basic-input-output]: https://www.programiz.com/csharp-programming/basic-input-output diff --git a/languages/csharp/concept-exercises/dates/Dates.cs b/languages/csharp/concept-exercises/dates/Dates.cs deleted file mode 100644 index 3e66721a12..0000000000 --- a/languages/csharp/concept-exercises/dates/Dates.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -public static class Appointment -{ - public static DateTime Schedule(string appointmentDateDescription) - { - throw new System.NotImplementedException("Please implement the Appointment.Schedule method"); - } - - public static bool HasPassed(DateTime appointmentDate) - { - throw new System.NotImplementedException("Please implement the Appointment.HasPassed method"); - } - - public static bool IsAfternoonAppointment(DateTime appointmentDate) - { - throw new System.NotImplementedException("Please implement the Appointment.IsAfternoonAppointment method"); - } - - public static string Description(DateTime appointmentDate) - { - throw new System.NotImplementedException("Please implement the Appointment.Description method"); - } -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/dates/DatesTest.cs b/languages/csharp/concept-exercises/dates/DatesTest.cs deleted file mode 100644 index 0b0ae68648..0000000000 --- a/languages/csharp/concept-exercises/dates/DatesTest.cs +++ /dev/null @@ -1,116 +0,0 @@ -using Xunit; -using System; -using System.Globalization; -using System.Reflection; -using System.Threading; -using Xunit.Sdk; - -[UseCulture("en-US")] -public class AppointmentTest -{ - public static TheoryData ScheduleData = new TheoryData - { - { "7/25/2019 13:45:00", new DateTime(2019, 07, 25, 13, 45, 0) }, - { "June 3, 2019 11:30:00", new DateTime(2019, 6, 3, 11, 30, 0) }, - { "Thursday, December 5, 2019 09:00:00", new DateTime(2019, 12, 5, 9, 0, 0) }, - { "December 5, 2019 09:00:00", new DateTime(2019, 12, 5, 9, 0, 0) }, - }; - - [Theory] - [MemberData(nameof(ScheduleData))] - public void Schedule(string appointmentDateDescription, DateTime expected) => - Assert.Equal(expected, Appointment.Schedule(appointmentDateDescription)); - - public static TheoryData HasPassedData = new TheoryData - { - { DateTime.Now.AddYears(-1).AddHours(2), true }, - { DateTime.Now.AddMonths(-8), true }, - { DateTime.Now.AddMonths(-1), true }, - { DateTime.Now.AddDays(-5), true }, - { DateTime.Now.AddDays(-1), true }, - { DateTime.Now.AddHours(-2), true }, - { DateTime.Now.AddMinutes(-1), true }, - { DateTime.Now.AddMinutes(1), false }, - { DateTime.Now.AddDays(1), false }, - { DateTime.Now.AddDays(7), false }, - { DateTime.Now.AddMonths(3), false }, - { DateTime.Now.AddYears(3).AddDays(-5), false }, - }; - - [Theory] - [MemberData(nameof(HasPassedData))] - public void HasPassed(DateTime appointmentDate, bool expected) => - Assert.Equal(expected, Appointment.HasPassed(appointmentDate)); - - public static TheoryData IsAfternoonAppointmentData = new TheoryData - { - { new DateTime(2019, 6, 17, 8, 15, 0), false }, - { new DateTime(2019, 1, 11, 9, 0, 0), false }, - { new DateTime(2019, 2, 23, 11, 59, 59), false }, - { new DateTime(2019, 8, 9, 12, 0, 0), true }, - { new DateTime(2019, 8, 9, 12, 0, 1), true }, - { new DateTime(2019, 9, 7, 15, 45, 0), true }, - { new DateTime(2019, 9, 1, 17, 59, 59), true }, - { new DateTime(2019, 9, 1, 18, 0, 0), false }, - { new DateTime(2019, 9, 1, 23, 59, 59), false }, - }; - - [Theory] - [MemberData(nameof(IsAfternoonAppointmentData))] - public void IsAfternoonAppointment(DateTime appointmentDate, bool expected) => - Assert.Equal(expected, Appointment.IsAfternoonAppointment(appointmentDate)); - - public static TheoryData DescriptionData = new TheoryData - { - { new DateTime(2019, 03, 29, 15, 0, 0), "You have an appointment on Friday 29 March 2019 at 15:00." }, - { new DateTime(2019, 07, 25, 13, 45, 0), "You have an appointment on Thursday 25 July 2019 at 13:45." }, - { new DateTime(2019, 6, 3, 11, 30, 0), "You have an appointment on Monday 3 June 2019 at 11:30." }, - { new DateTime(2019, 12, 5, 9, 0, 1), "You have an appointment on Thursday 5 December 2019 at 09:00." }, - { new DateTime(2020, 2, 29, 15, 15, 20), "You have an appointment on Saturday 29 February 2020 at 15:15." }, - { new DateTime(2020, 9, 9, 9, 9, 9), "You have an appointment on Wednesday 9 September 2020 at 09:09." }, - }; - - [Theory] - [MemberData(nameof(DescriptionData))] - public void Description(DateTime appointmentDate, string expected) => - Assert.Equal(expected, Appointment.Description(appointmentDate)); - - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - private class UseCultureAttribute : BeforeAfterTestAttribute - { - private readonly CultureInfo _culture; - private readonly CultureInfo _uiCulture; - private CultureInfo _originalCulture; - private CultureInfo _originalUiCulture; - - public UseCultureAttribute(string culture) - : this(culture, culture) { } - - public UseCultureAttribute(string culture, string uiCulture) - { - _culture = new CultureInfo(culture, false); - _uiCulture = new CultureInfo(uiCulture, false); - } - - public override void Before(MethodInfo methodUnderTest) - { - _originalCulture = Thread.CurrentThread.CurrentCulture; - _originalUiCulture = Thread.CurrentThread.CurrentUICulture; - - Thread.CurrentThread.CurrentCulture = _culture; - Thread.CurrentThread.CurrentUICulture = _uiCulture; - - CultureInfo.CurrentCulture.ClearCachedData(); - CultureInfo.CurrentUICulture.ClearCachedData(); - } - - public override void After(MethodInfo methodUnderTest) - { - Thread.CurrentThread.CurrentCulture = _originalCulture; - Thread.CurrentThread.CurrentUICulture = _originalUiCulture; - - CultureInfo.CurrentCulture.ClearCachedData(); - CultureInfo.CurrentUICulture.ClearCachedData(); - } - } -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/enums/.docs/cli.md b/languages/csharp/concept-exercises/enums/.docs/cli.md deleted file mode 100644 index 873daf0931..0000000000 --- a/languages/csharp/concept-exercises/enums/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit Enums.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/enums/.docs/debug.md b/languages/csharp/concept-exercises/enums/.docs/debug.md deleted file mode 100644 index 8be437efc1..0000000000 --- a/languages/csharp/concept-exercises/enums/.docs/debug.md +++ /dev/null @@ -1,10 +0,0 @@ -# Debug - -When a test fails, a message is displayed describing what went wrong and for which input. You can also use the fact that any [console output][programiz.com-basic-input-output] will be shown too. You can write to the console using: - -```csharp -Console.WriteLine("Debug message"); -``` - -[docs-string]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/ -[programiz.com-basic-input-output]: https://www.programiz.com/csharp-programming/basic-input-output diff --git a/languages/csharp/concept-exercises/enums/EnumsTest.cs b/languages/csharp/concept-exercises/enums/EnumsTest.cs deleted file mode 100644 index eee0c798a0..0000000000 --- a/languages/csharp/concept-exercises/enums/EnumsTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Xunit; - -public class LogLineTest -{ - [Theory] - [InlineData("[ERROR]: Stack overflow", LogLevel.Error)] - [InlineData("[ERROR]: Disk full", LogLevel.Error)] - [InlineData("[ERROR]: Segmentation fault", LogLevel.Error)] - [InlineData("[ERROR]: File not found", LogLevel.Error)] - [InlineData("[WARNING]: Disk almost full", LogLevel.Warning)] - [InlineData("[WARNING]: Timezone not set", LogLevel.Warning)] - [InlineData("[WARNING]: Unsafe password", LogLevel.Warning)] - [InlineData("[INFO]: File moved", LogLevel.Info)] - [InlineData("[INFO]: Timezone changed", LogLevel.Info)] - public void Parse(string logLine, LogLevel expected) => - Assert.Equal(expected, LogLine.ParseLogLevel(logLine)); - - [Theory] - [InlineData("[UNKNOWN]: Something unknown happened", LogLevel.Unknown)] - [InlineData("[FATAL]: Crash!", LogLevel.Unknown)] - public void ParseUnknown(string logLine, LogLevel expected) => - Assert.Equal(expected, LogLine.ParseLogLevel(logLine)); - - [Theory] - [InlineData(LogLevel.Error, "Stack overflow", "4:Stack overflow")] - [InlineData(LogLevel.Error, "Disk full", "4:Disk full")] - [InlineData(LogLevel.Error, "Segmentation fault", "4:Segmentation fault")] - [InlineData(LogLevel.Error, "File not found", "4:File not found")] - [InlineData(LogLevel.Warning, "Disk almost full", "2:Disk almost full")] - [InlineData(LogLevel.Warning, "Timezone not set", "2:Timezone not set")] - [InlineData(LogLevel.Warning, "Unsafe password", "2:Unsafe password")] - [InlineData(LogLevel.Info, "File moved", "1:File moved")] - [InlineData(LogLevel.Info, "Timezone changed", "1:Timezone changed")] - [InlineData(LogLevel.Unknown, "Something unknown happened", "0:Something unknown happened")] - [InlineData(LogLevel.Unknown, "Crash!", "0:Crash!")] - public void OutputForShortLog(LogLevel logLevel, string message, string expected) => - Assert.Equal(expected, LogLine.OutputForShortLog(logLevel, message)); -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/cli.md b/languages/csharp/concept-exercises/numbers-floating-point/.docs/cli.md deleted file mode 100644 index 72a850564c..0000000000 --- a/languages/csharp/concept-exercises/numbers-floating-point/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit FloatingPointNumbers.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/debug.md b/languages/csharp/concept-exercises/numbers-floating-point/.docs/debug.md deleted file mode 100644 index 8be437efc1..0000000000 --- a/languages/csharp/concept-exercises/numbers-floating-point/.docs/debug.md +++ /dev/null @@ -1,10 +0,0 @@ -# Debug - -When a test fails, a message is displayed describing what went wrong and for which input. You can also use the fact that any [console output][programiz.com-basic-input-output] will be shown too. You can write to the console using: - -```csharp -Console.WriteLine("Debug message"); -``` - -[docs-string]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/ -[programiz.com-basic-input-output]: https://www.programiz.com/csharp-programming/basic-input-output diff --git a/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.cs b/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.cs deleted file mode 100644 index 832491f95f..0000000000 --- a/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.cs +++ /dev/null @@ -1,17 +0,0 @@ -public static class SavingsAccount -{ - public static float AnnualPercentageYield(decimal balance) - { - throw new System.NotImplementedException("Please implement the SavingsAccount.AnnualPercentageYield method"); - } - - public static decimal AnnualBalanceUpdate(decimal balance) - { - throw new System.NotImplementedException("Please implement the SavingsAccount.AnnualBalanceUpdate method"); - } - - public static int YearsBeforeDesiredBalance(decimal balance, decimal targetBalance) - { - throw new System.NotImplementedException("Please implement the SavingsAccount.YearsBeforeDesiredBalance method"); - } -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPointTest.cs b/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPointTest.cs deleted file mode 100644 index 0daccc10ae..0000000000 --- a/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPointTest.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Xunit; - -public class SavingsAccountTest -{ - public static TheoryData AnnualPercentageYieldData = new TheoryData - { - { -152964.231m, -3.213f }, - { -300.0m, -3.213f }, - { -0.123m, -3.213f }, - { 0m, 0.5f }, - { 0.000001m, 0.5f }, - { 0.012345m, 0.5f }, - { 200.75m, 0.5f }, - { 523.75m, 0.5f }, - { 999.9999m, 0.5f }, - { 1_000.0m, 1.621f }, - { 1_000.0001m, 1.621f }, - { 4_999.9990m, 1.621f }, - { 5_000.0000m, 2.475f }, - { 5_000.0001m, 2.475f }, - { 9_999.999999m, 2.475f }, - { 10_000.0m, 2.475f }, - { 10_000.000001m, 2.475f }, - { 5_639_998.742909m, 2.475f } - }; - - [Theory] - [MemberData(nameof(AnnualPercentageYieldData))] - public void AnnualPercentageYield(decimal balance, float expected) => - Assert.Equal(expected, SavingsAccount.AnnualPercentageYield(balance)); - - public static TheoryData AnnualBalanceUpdateData = new TheoryData - { - { -152964.231m, -157878.97174203m }, - { -300.0m, -309.639000m }, - { -0.123m, -0.12695199m }, - { 0.0m, 0.0000m }, - { 0.000001m, 0.000001005m }, - { 0.012345m, 0.012406725m }, - { 200.75m, 201.75375m }, - { 999.9999m, 1004.9998995m }, - { 1_000.0m, 1016.210000m }, - { 1_000.0001m, 1016.210101621m }, - { 5_000.0m, 5123.750000m }, - { 5_000.0001m, 5123.750102475m }, - { 9_999.999999m, 10247.49999897525m }, - { 10_000.0m, 10247.500000m }, - { 10_000.000001m, 10247.50000102475m }, - { 5_639_998.742909m, 5779588.71179599775m }, - { 876_432_317.9568123m, 898124017.826243404425m } - }; - - [Theory] - [MemberData(nameof(AnnualBalanceUpdateData))] - public void AnnualBalanceUpdate(decimal balance, decimal expected) => - Assert.Equal(expected, SavingsAccount.AnnualBalanceUpdate(balance)); - - public static TheoryData YearsBeforeDesiredBalanceData = new TheoryData - { - { 100.0m, 125.80m, 47 }, - { 200.75m, 214.88m, 14 }, - { 1_000.0m, 1_100.0m, 6 }, - { 1_000.0m, 1_200.0m, 12 }, - { 1_000.0m, 1_500.0m, 26 }, - { 2_345.67m, 12_345.6789m, 85 }, - { 8_080.80m, 9_090.90m, 5 }, - { 9_526.75m, 10_176.25m, 3 }, - { 25_000.00m, 27_000.0m, 4 } - }; - - [Theory] - [MemberData(nameof(YearsBeforeDesiredBalanceData))] - public void YearsBeforeDesiredBalance(decimal currentBalance, decimal desiredBalance, int expected) => - Assert.Equal(expected, SavingsAccount.YearsBeforeDesiredBalance(currentBalance, desiredBalance)); -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers/.docs/cli.md b/languages/csharp/concept-exercises/numbers/.docs/cli.md deleted file mode 100644 index 58f4f0df21..0000000000 --- a/languages/csharp/concept-exercises/numbers/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit Numbers.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/numbers/.docs/debug.md b/languages/csharp/concept-exercises/numbers/.docs/debug.md deleted file mode 100644 index 8be437efc1..0000000000 --- a/languages/csharp/concept-exercises/numbers/.docs/debug.md +++ /dev/null @@ -1,10 +0,0 @@ -# Debug - -When a test fails, a message is displayed describing what went wrong and for which input. You can also use the fact that any [console output][programiz.com-basic-input-output] will be shown too. You can write to the console using: - -```csharp -Console.WriteLine("Debug message"); -``` - -[docs-string]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/ -[programiz.com-basic-input-output]: https://www.programiz.com/csharp-programming/basic-input-output diff --git a/languages/csharp/concept-exercises/numbers/Numbers.cs b/languages/csharp/concept-exercises/numbers/Numbers.cs deleted file mode 100644 index 6dfd0d588b..0000000000 --- a/languages/csharp/concept-exercises/numbers/Numbers.cs +++ /dev/null @@ -1,12 +0,0 @@ -public static class AssemblyLine -{ - public static double ProductionRatePerHour(int speed) - { - // TODO: implement this method - } - - public static int WorkingItemsPerMinute(int speed) - { - // TODO: implement this method - } -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers/NumbersTest.cs b/languages/csharp/concept-exercises/numbers/NumbersTest.cs deleted file mode 100644 index 6c19add19b..0000000000 --- a/languages/csharp/concept-exercises/numbers/NumbersTest.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Xunit; - -public class AssemblyLineTest -{ - [Theory] - [InlineData(0, 0.0)] - [InlineData(1, 221.0)] - [InlineData(2, 442.0)] - [InlineData(3, 663.0)] - [InlineData(4, 884.0)] - [InlineData(5, 994.5)] - [InlineData(6, 1193.4)] - [InlineData(7, 1392.3)] - [InlineData(8, 1591.2)] - [InlineData(9, 1531.53)] - [InlineData(10, 1701.7)] - public void ProductionRatePerHour(int speed, double expected) => - Assert.Equal(expected, AssemblyLine.ProductionRatePerHour(speed)); - - [Theory] - [InlineData(0, 0)] - [InlineData(1, 3)] - [InlineData(2, 7)] - [InlineData(3, 11)] - [InlineData(4, 14)] - [InlineData(5, 16)] - [InlineData(6, 19)] - [InlineData(7, 23)] - [InlineData(8, 26)] - [InlineData(9, 25)] - [InlineData(10, 28)] - public void WorkingItemsPerMinute(int speed, int expected) => - Assert.Equal(expected, AssemblyLine.WorkingItemsPerMinute(speed)); -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/strings/.docs/cli.md b/languages/csharp/concept-exercises/strings/.docs/cli.md deleted file mode 100644 index 74c98fa897..0000000000 --- a/languages/csharp/concept-exercises/strings/.docs/cli.md +++ /dev/null @@ -1,16 +0,0 @@ -# CLI - -To run the tests, run the command `dotnet test` from within the exercise directory. - -Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. - -Once none of the tests are skipped and they are all passing, you can submit your solution -using `exercism submit Strings.cs` - -## Links - -- [dotnet test documentation][docs-dotnet-test] -- [exercism CLI documentation][docs-exercism-cli] - -[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 -[docs-exercism-cli]: https://exercism.io/cli diff --git a/languages/csharp/concept-exercises/strings/.docs/debug.md b/languages/csharp/concept-exercises/strings/.docs/debug.md deleted file mode 100644 index 8be437efc1..0000000000 --- a/languages/csharp/concept-exercises/strings/.docs/debug.md +++ /dev/null @@ -1,10 +0,0 @@ -# Debug - -When a test fails, a message is displayed describing what went wrong and for which input. You can also use the fact that any [console output][programiz.com-basic-input-output] will be shown too. You can write to the console using: - -```csharp -Console.WriteLine("Debug message"); -``` - -[docs-string]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/ -[programiz.com-basic-input-output]: https://www.programiz.com/csharp-programming/basic-input-output diff --git a/languages/csharp/concept-exercises/strings/Strings.cs b/languages/csharp/concept-exercises/strings/Strings.cs deleted file mode 100644 index cd0b1bab12..0000000000 --- a/languages/csharp/concept-exercises/strings/Strings.cs +++ /dev/null @@ -1,17 +0,0 @@ -public static class LogLine -{ - public static string Message(string logLine) - { - throw new System.NotImplementedException("Please implement the LogLine.Message method"); - } - - public static string LogLevel(string logLine) - { - throw new System.NotImplementedException("Please implement the LogLine.LogLevel method"); - } - - public static string Reformat(string logLine) - { - throw new System.NotImplementedException("Please implement the LogLine.Reformat method"); - } -} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/strings/StringsTest.cs b/languages/csharp/concept-exercises/strings/StringsTest.cs deleted file mode 100644 index 1e2ebd459d..0000000000 --- a/languages/csharp/concept-exercises/strings/StringsTest.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Xunit; - -public class LogLineTest -{ - [Theory] - [InlineData("[ERROR]: Stack overflow", "Stack overflow")] - [InlineData("[ERROR]: Disk full", "Disk full")] - [InlineData("[ERROR]: Segmentation fault", "Segmentation fault")] - [InlineData("[ERROR]: File not found ", "File not found")] - [InlineData("[WARNING]: Disk almost full", "Disk almost full")] - [InlineData("[WARNING]: \tTimezone not set\r\n", "Timezone not set")] - [InlineData("[WARNING]: Unsafe password", "Unsafe password")] - [InlineData("[INFO]: File moved", "File moved")] - [InlineData("[INFO]: Timezone changed ", "Timezone changed")] - public void Message(string logLine, string expected) => - Assert.Equal(expected, LogLine.Message(logLine)); - - [Theory] - [InlineData("[ERROR]: Stack overflow", "error")] - [InlineData("[ERROR]: Disk full", "error")] - [InlineData("[ERROR]: Segmentation fault", "error")] - [InlineData("[ERROR]: File not found ", "error")] - [InlineData("[WARNING]: Disk almost full", "warning")] - [InlineData("[WARNING]: \tTimezone not set\r\n", "warning")] - [InlineData("[WARNING]: Unsafe password", "warning")] - [InlineData("[INFO]: File moved", "info")] - [InlineData("[INFO]: Timezone changed ", "info")] - public void LogLevel(string logLine, string expected) => - Assert.Equal(expected, LogLine.LogLevel(logLine)); - - [Theory] - [InlineData("[ERROR]: Stack overflow", "Stack overflow (error)")] - [InlineData("[ERROR]: Disk full", "Disk full (error)")] - [InlineData("[ERROR]: Segmentation fault", "Segmentation fault (error)")] - [InlineData("[ERROR]: File not found ", "File not found (error)")] - [InlineData("[WARNING]: Disk almost full", "Disk almost full (warning)")] - [InlineData("[WARNING]: \tTimezone not set\r\n", "Timezone not set (warning")] - [InlineData("[WARNING]: Unsafe password", "Unsafe password (warning)")] - [InlineData("[INFO]: File moved", "File moved (info)")] - [InlineData("[INFO]: Timezone changed ", "Timezone changed (info)")] - public void Reformat(string logLine, string expected) => - Assert.Equal(expected, LogLine.Reformat(logLine)); -} \ No newline at end of file diff --git a/languages/csharp/config.json b/languages/csharp/config.json index 46ce02dedd..b1a53c4423 100644 --- a/languages/csharp/config.json +++ b/languages/csharp/config.json @@ -3,6 +3,10 @@ "active": true, "blurb": "C# is a modern, object-oriented language with lots of great features, such as type-inference and async/await. The tooling is excellent, and there is extensive, well-written documentation.", "version": 3, + "online_editor": { + "indent_style": "space", + "indent_size": 4 + }, "exercises": { "concept": [ { diff --git a/languages/csharp/docs/README.md b/languages/csharp/docs/README.md new file mode 100644 index 0000000000..58f572182d --- /dev/null +++ b/languages/csharp/docs/README.md @@ -0,0 +1,8 @@ +# C# specific docs + +## General +- [How to implement a Concept Exercise](./implementing-a-concept-exercise.md) + +## Examples +- [New concept exercise (Arrays)](examples/new-concept-exercise-arrays.md) +- [New reference doc (readonly vs const)](examples/new-reference-doc-readonly-vs-const.md) diff --git a/languages/csharp/docs/examples/new-concept-exercise-arrays.md b/languages/csharp/docs/examples/new-concept-exercise-arrays.md new file mode 100644 index 0000000000..a171d72845 --- /dev/null +++ b/languages/csharp/docs/examples/new-concept-exercise-arrays.md @@ -0,0 +1,181 @@ +--- +name: "[C#] Add new Concept Exercise: arrays" +about: Add the arrays Concept Exercise to the C# track +title: "[C#] Add new Concept Exercise: arrays" +labels: track/csharp, exercise/concept +assignees: "" +--- + +# C#: new exercise - arrays + +This issue describes a new `arrays` exercise that should be added to the [v3][docs-v3] [C# track][csharp-docs]. + +## Goal + +The goal of this exercise is to teach the student how the concept of [collections][docs-v3-types-collection] is implemented in [C#][docs.microsoft.com-collections]. We'll teach the student about collections by having the student work with one specific type of collection, namely the [array][docs-v3-types-array]. The students will learn to define arrays, iterate over array items, access items by index, and more. + +Of the many available C# collection types, we chose to use the `array` collection type as the first collection type students will be taught for the following reasons: + +- Arrays don't require the student to know about generics. +- Arrays are a common data type in many language. +- Arrays have a fixed length. No complexity in adding or removing elements. +- Arrays have a simple shorthand syntax. No need to understand how constructors work to define an array. + +## Things to teach + +After completing this exercise, the student should: + +- Know of the existence of the `Array` type. +- Know how to define an array. +- Know how to access elements in an array by index. +- Know how to iterate over elements in an array. +- Know of some basic array functions (like finding the index of an element in an array). +- Know where it's documented, or at least how to search for it. + +## Things not to teach + +The following things are outside the scope of this exercise: + +- Multi-dimensional/jagged arrays. +- Memory and performance characteristics of arrays. +- Enumerables. +- Iterators. +- LINQ. + +## Resources to refer to + +Here are some suggestions for resources to use in the exercise's documentation file(s): + +### Hints + +- [Arrays][docs.microsoft.com-arrays] +- [Single-dimensional arrays][docs.microsoft.com-single-dimensional-arrays] +- [Usings foreach with arrays][docs.microsoft.com-foreach-with-arrays] + +### After + +- [Collections][docs.microsoft.com-collections] +- [Implicitly typed arrays][docs.microsoft.com-implicitly-typed-arrays] + +As this is an introductory exercise, we should take care not to link to very advanced resources, to prevent overwhelming the student. + +## Concepts + +This Concepts Exercise's Concepts are: + +- `basic-collections` +- `basic-arrays` + +## Prequisites + +As an array is a collection type, it holds zero or more instances of another type. That means it _has_ to depend on one or more other types. In this exercise, we'll use the `int` data type for that, which is both interesting enough and easy to work with. The `int` data type is introduced in the `basic-numbers` concept. + +This Concept Exercise's prerequisites Concepts are: + +- `basic-numbers` + +## Implementing + +If you'd like to work on implementing this exercise, the first step is to let us know through a comment on this issue, to prevent multiple people from working on the same exercise. If you have any questions while implementing the exercise, please also post them as comments in this issue. + +Implementing the exercise means creating the following files: + +
+languages
+└── csharp
+    └── exercises
+        └── concept
+            └── arrays
+                ├── .docs
+                |   ├── after.md
+                |   ├── cli.md
+                |   ├── debug.md
+                |   ├── hints.md
+                |   ├── instructions.md
+                |   └── introduction.md
+                ├── .meta
+                |   ├── config.json
+                |   └── Example.cs
+                ├── Arrays.csproj
+                ├── Arrays.cs
+                └── ArraysTest.cs
+
+ +### Step 1: adding track-specific files + +These files are specific to the C# track: + +- `Arrays.csproj`: the C# project file. +- `ArraysTest.cs`: the test suite. +- `Arrays.cs`. the stub implementation file, which is the starting point for students to work on the exercise. +- `.meta/Example.cs`: an example implementation that passes all the tests. + +Check out the [`floating-point-numbers exercise`][csharp-docs-concept-exercises-floating-point-numbers] for an example on what these files should look like. + +### Step 2: adding documentation files + +- `.docs/introduction.md`: an introduction to the concept. It should be explicit about what the exercise teaches and maybe provide a brief introduction to the concepts, but not give away so much that the user doesn't have to do any work to solve the exercise. An example file can be found [here][csharp-docs-introduction.md]. +- `.docs/instructions.md`: instructions for the exercise. It should explicitly explain what the user needs to do (define a method with the signature `X(...)` that takes an A and returns a Z), and provide at least one example usage of that function. If there are multiple tasks within the exercise, it should provide an example of each. An example file can be found [here][csharp-docs-instructions.md]. +- `.docs/hints.md`: if the user gets stuck, we will allow them to click a button requesting a hint, which shows this file. We will softly discourage them using it. The file should contain both general and task-specific "hints". These hints should be enough to unblock almost any student. An example file can be found [here][csharp-docs-hints.md]. +- `.docs/after.md`: once the user completes the exercise they will be shown this file, which gives them any bonus information or further reading about the concept taught. An example file can be found [here][csharp-docs-after.md]. + +These files are also all described in the [V3 readme][docs-v3]. + +### Step 3: adding other files + +- `.meta/config.json`: metadata for the exercise. This includes defining the test file and the solution files, as well as a list of all the tests and the method they are calling. + +See the floating-point-numbers exercise's [config.json file][csharp-meta-config.json] for an example. + +### Step 4: updating files + +- `languages/csharp/config.json`: a new entry should be added to the `"concept"` array, which is part of the `"exercises"` property: + +```json +{ + "slug": "arrays", + "uuid": "b6c532c9-1e89-4fbf-8f08-27f5befb5bb8", + "concepts": ["basic-collections", "basic-arrays"], + "prerequisites": ["basic-numbers"] +} +``` + +### Step 5: updating issues + +- `https://github.com/exercism/v3/issues/18`: this issue should be updated to include the new exercise and its (new) concepts. + +### Inspiration + +When implementing this exericse, it can be very useful to look at already implemented C# exercises like the [strings][csharp-docs-concept-exercises-strings], [dates][csharp-docs-concept-exercises-dates] or [floating-point numbers][csharp-docs-concept-exercises-floating-point-numbers] exercises. You can also check the [general array concept documentation][docs-v3-types-array] to see if any other languages have already implemented an arrays exercise. + +## Representer + +This exercise does not require any specific representation logic to be added to the [representer][csharp-representer]. + +## Analyzer + +This exercise could benefit from having an [analyzer][csharp-analyzer] that can comment on: + +- Difference between `for` vs `foreach` loops. + +[docs.microsoft.com-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/ +[docs.microsoft.com-collections]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/collections +[docs.microsoft.com-foreach-with-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/using-foreach-with-arrays +[docs.microsoft.com-single-dimensional-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/single-dimensional-arrays +[docs.microsoft.com-implicitly-typed-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/implicitly-typed-arrays +[docs-v3]: ../../README.md +[docs-v3-types-array]: ../../../../reference/types/array.md +[docs-v3-types-collection]: ../../../../reference/types/collection.md +[csharp-docs]: ../../reference/README.md +[csharp-docs-concept-exercises-strings]: ../../exercises/concept/strings +[csharp-docs-concept-exercises-dates]: ../../exercises/concept/dates +[csharp-docs-concept-exercises-floating-point-numbers]: ../../exercises/concept/numbers-floating-point +[csharp-analyzer]: https://github.com/exercism/csharp-analyzer +[csharp-representer]: https://github.com/exercism/csharp-representer +[csharp-docs-cli.md]: ../../exercises/.docs/cli.md +[csharp-docs-debug.md]: ../../exercises/.docs/debug.md +[csharp-docs-after.md]: ../../exercises/concept/numbers-floating-point/.docs/after.md +[csharp-docs-hints.md]: ../../exercises/concept/numbers-floating-point/.docs/hints.md +[csharp-docs-introduction.md]: ../../exercises/concept/numbers-floating-point/.docs/introduction.md +[csharp-docs-instructions.md]: ../../exercises/concept/numbers-floating-point/.docs/instructions.md +[csharp-meta-config.json]: ../../exercises/concept/numbers-floating-point/.meta/config.json diff --git a/languages/csharp/docs/examples/new-reference-doc-readonly-vs-const.md b/languages/csharp/docs/examples/new-reference-doc-readonly-vs-const.md new file mode 100644 index 0000000000..8078b1f64a --- /dev/null +++ b/languages/csharp/docs/examples/new-reference-doc-readonly-vs-const.md @@ -0,0 +1,41 @@ +--- +name: "[C#] Add new reference document" +about: Use this template to create an issue to add a new reference document +title: "[C#] Add new reference document: readonly vs const" +labels: type/new-reference, status/help-wanted +assignees: "" +--- + +# [C#] Add new reference document: readonly vs const + +This issue describes how to add a new [C# reference document][reference]: readonly vs const. + +## Description + +The goal of the new reference document is to explain the different between (`static`) `readonly` fields versus `const` fields, which is confusing to many students. + +The document should explain how the two approaches are different, taking into account: + +- What values they can be applied to. +- Readability aspects. +- Performance characteristics. +- Memory aspects. +- Generated IL code (optional). + +Based on the aforementioned differences, the document should provide guidance on when to use which approach and why. + +## Resources to refer to + +- [StackOverflow - static readonly vs const][stackoverflow.com] + +## Contributing + +To create the reference, please: + +- [Create the document at `language/csharp/reference/readonly-vs-const.md`][new-document]. +- Remove the corresponding TODO item in the [reference README][reference]. +- Add a link to the reference document in the [reference README][reference]. + +[stackoverflow.com]: https://stackoverflow.com/questions/755685/static-readonly-vs-const#755693 +[reference]: ../../reference/README.md +[new-document]: https://github.com/exercism/v3/new/master?filename=languages/csharp/reference/readonly-vs-const.md diff --git a/languages/csharp/docs/implementing-a-concept-exercise.md b/languages/csharp/docs/implementing-a-concept-exercise.md new file mode 100644 index 0000000000..38e96ebfaf --- /dev/null +++ b/languages/csharp/docs/implementing-a-concept-exercise.md @@ -0,0 +1,69 @@ +# How to implement a C# concept exercise + +This document describes how to implement a concept exercise for the C# track. As this document is generic, the following placeholders are used: + +- ``: the name of the exercise in kebab-case (e.g. `anonymous-methods`). +- ``: the name of the exercise in PascalCase (e.g. `AnonymousMethods`). + +Before implementing the exercise, please make sure you have a good understanding of what the exercise should be teaching (and what not). This information can be found in the exercise's GitHub issue. Having done this, please read the [C# concept exercises introduction][docs-exercises-concept]. + +To implement a concept exercise, the following files must be created: + +
+languages
+└── csharp
+    └── exercises
+        └── concept
+            └── <SLUG>
+                ├── .docs
+                |   ├── instructions.md
+                |   ├── introduction.md
+                |   ├── hints.md
+                |   └── after.md (optional)
+                ├── .meta
+                |   ├── config.json
+                |   └── Example.cs
+                ├── <NAME>.cs
+                ├── <NAME>.csproj
+                └── <NAME>Test.cs
+
+ +## Step 1: adding track-specific files + +These files are specific to the C# track: + +- `.cs`. the stub implementation file, which is the starting point for students to work on the exercise. +- `.csproj`: the C# project file. +- `Test.cs`: the test suite. +- `.meta/Example.cs`: an example implementation that passes all the tests. + +## Step 2: adding common files + +How to create the files common to all tracks is described in the [how to implement a concept exercise document][docs-general-how-to-implement-a-concept-exercise]. + +## Step 3: add analyzer (optional) + +Some exercises could benefit from having an exercise-specific [analyzer][csharp-analyzer]. If so, please check the [analyzer document][csharp-analyzer] for details on how to do this. + +## Step 4: custom representation (optional) + +Some exercises could benefit from having an custom representation as generated by the [C# representer][csharp-representer]. If so, please check the [representer document][csharp-representer] for details on how to do this. + +## Inspiration + +When implementing an exericse, it can be very useful to look at already implemented C# exercises like the [strings][concept-exercise-strings], [dates][concept-exercise-dates] or [floating-point numbers][concept-exercise-floating-point-numbers] exercises. You can also check the exercise's [general concepts documents][reference] to see if other languages that have already an exercise for that concept. + +## Help + +If you have any questions regarding implementing this exercise, please post them as comments in the exercise's GitHub issue. + +[docs-analyzer]: ./analyzer.md +[docs-representer]: ./representer.md +[docs-reference]: ./reference.md +[docs-exercises-concept]: ../exercises/concept/README.md +[docs-general-concept-exercises]: ../../../docs/concept-exercises.md +[docs-general-how-to-implement-a-concept-exercise]: ../../../docs/maintainers/generic-how-to-implement-a-concept-exercise.md +[concept-exercise-strings]: ../exercises/concept/strings +[concept-exercise-dates]: ../exercises/concept/dates +[concept-exercise-floating-point-numbers]: ../exercises/concept/numbers-floating-point +[reference]: ../../../reference diff --git a/languages/csharp/exercises/.docs/README.md b/languages/csharp/exercises/.docs/README.md new file mode 100644 index 0000000000..33109035de --- /dev/null +++ b/languages/csharp/exercises/.docs/README.md @@ -0,0 +1,15 @@ +# C# exercise documents + +There are two documents that are shared between all exercises: + +- [cli.md][cli]: contains information on how to work with the exercise when using the CLI to download and submit the exercise. +- [debug.md][debug]: explains how a user that is coding in the browser can still do "debugging." + +## Contributing + +Thanks for wanting to contribute to the C# track! Contributions are very welcome! + +To contribute, please submit a PR if you feel the [cli.md][cli] or [debug.md][debug] document can be improved. + +[cli]: ./cli.md +[debug]: ./debug.md diff --git a/languages/csharp/exercises/.docs/cli.md b/languages/csharp/exercises/.docs/cli.md new file mode 100644 index 0000000000..121124974b --- /dev/null +++ b/languages/csharp/exercises/.docs/cli.md @@ -0,0 +1,14 @@ +# CLI + +You can run the tests by opening a command prompt in the exercise's directory, and then running the [`dotnet test` command][docs-dotnet-test]. Alternatively, most IDE's have built-in support for running tests, including [Visual Studio][docs-run-unit-tests-visual-studio], [Rider][docs-run-unit-tests-rider] and [Visual Studio code][docs-run-unit-tests-visual-studio-code]. + +Initially, only the first test will be enabled. This is to encourage you to solve the exercise one step at a time. Once you get the first test passing, remove the `Skip` property from the next test and work on getting that test passing. + +Once none of the tests are skipped and they are all passing, you can submit your solution by opening a command prompt in the exercise's directory and running the +using [`exercism submit` command][docs-exercism-cli]. + +[docs-dotnet-test]: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21 +[docs-exercism-cli]: https://exercism.io/cli +[docs-run-unit-tests-visual-studio]: https://docs.microsoft.com/en-us/visualstudio/test/run-unit-tests-with-test-explorer?view=vs-2019 +[docs-run-unit-tests-visual-studio-code]: https://github.com/OmniSharp/omnisharp-vscode/wiki/How-to-run-and-debug-unit-tests +[docs-run-unit-tests-rider]: https://www.jetbrains.com/help/rider/Unit_Testing_in_Solution.html diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/debug.md b/languages/csharp/exercises/.docs/debug.md similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.docs/debug.md rename to languages/csharp/exercises/.docs/debug.md diff --git a/languages/csharp/exercises/README.md b/languages/csharp/exercises/README.md new file mode 100644 index 0000000000..066f83d44c --- /dev/null +++ b/languages/csharp/exercises/README.md @@ -0,0 +1,9 @@ +# C# exercises + +There are two types of exercises: + +- [Concept exercises][concept-exercises] (WIP) +- [Practice exercises][practice-exercises] (on hold) + +[concept-exercises]: ./concept/README.md +[practice-exercises]: ./practice/README.md diff --git a/languages/csharp/exercises/_sidebar.md b/languages/csharp/exercises/_sidebar.md new file mode 100644 index 0000000000..f566d6192d --- /dev/null +++ b/languages/csharp/exercises/_sidebar.md @@ -0,0 +1,14 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) + - [C#](/languages/csharp/README.md) + - [Docs](/languages/csharp/docs/README.md) + - [Exercises](/languages/csharp/exercises/README.md) + - [Concept](/languages/csharp/exercises/concept/README.md) + - [Practice](/languages/csharp/exercises/practice/README.md) + - [Reference](/languages/csharp/reference/README.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/languages/csharp/exercises/concept/README.md b/languages/csharp/exercises/concept/README.md new file mode 100644 index 0000000000..01c1a96b23 --- /dev/null +++ b/languages/csharp/exercises/concept/README.md @@ -0,0 +1,38 @@ +# C# concept exercises + +The concept exercises are based on this [list of concepts][docs-concept-exercises]. + +## Implemented exercises + +These are the concept exercises that have currently been implemented, as well as the concepts they teach and their prerequisite concepts: + +| exercise | concepts | prerequisites | +| ------------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| [`numbers`][concept-exercise-numbers] | `basic-numbers`
`basic-type-conversion`
`conditionals` | - | +| [`numbers-floating-point`][concept-exercise-numbers-floating-point] | `floating-point-numbers`
`loops` | `basic-numbers`
`basic-type-conversion`
`conditionals` | +| [`strings`][concept-exercise-strings] | `basic-strings` | - | +| [`enums`][concept-exercise-enums] | `basic-enums` | `basic-strings` | +| [`dates`][concept-exercise-dates] | `basic-dates`
`basic-time`
`string-formatting` | `basic-numbers`
`basic-strings` | +| [`bitwise-operations`][concept-exercise-bitwise-operations] | `bitwise-operations`
`advanced-enums` | `basic-enums` | + +**⚠ Note ⚠**: The idea here is to use a `concept` name for the exercise/folder, but perhaps use some sort of "progression", so they will naturally become a sort of path to traverse. In this example, the `numbers` exercise only teaches basic number usage, and the `numbers-floating-point` exercise builds on that and digs deeper into floating-point numbers. + +It's only important that it's reasonably easy to _find_ the exercise. It's okay if the name isn't perfect. We **will** iterate on this. + +## TODO + +Thanks for wanting to contribute to the C# track's concept exercises! Contributions are very welcome! + +To contribute, please find and work on one of the [new exercise issues][issues-new-exercise] or [improve exercise issues][issues-improve-exercise]. + +[docs-concept-exercises]: ../../reference/README.md +[reference]: ./reference.md +[concept-exercises]: ./concept +[concept-exercise-bitwise-operations]: ./bitwise-operations +[concept-exercise-dates]: ./dates +[concept-exercise-enums]: ./enums +[concept-exercise-numbers-floating-point]: ./numbers-floating-point +[concept-exercise-numbers]: ./numbers +[concept-exercise-strings]: ./strings +[issues-new-exercise]: https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3Atrack%2Fcsharp+label%3Atype%2Fnew-exercise+label%3Astatus%2Fhelp-wanted +[issues-improve-exercise]: https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aopen+label%3Atrack%2Fcsharp+label%3Atype%2Fimprove-exercise+label%3Astatus%2Fhelp-wanted diff --git a/languages/csharp/exercises/concept/_sidebar.md b/languages/csharp/exercises/concept/_sidebar.md new file mode 100644 index 0000000000..e1e06b6040 --- /dev/null +++ b/languages/csharp/exercises/concept/_sidebar.md @@ -0,0 +1,13 @@ +- [Introduction](/) +- [Docs](/docs/README.md) +- [Languages](/languages/README.md) + - [C#](/languages/csharp/README.md) + - [Exercises](/languages/csharp/exercises/README.md) + - [Concept](/languages/csharp/exercises/concept/README.md) + - [Practice](/languages/csharp/exercises/practice/README.md) + - [Reference](/languages/csharp/reference/README.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/after.md b/languages/csharp/exercises/concept/bitwise-operations/.docs/after.md similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.docs/after.md rename to languages/csharp/exercises/concept/bitwise-operations/.docs/after.md diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/hints.md b/languages/csharp/exercises/concept/bitwise-operations/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.docs/hints.md rename to languages/csharp/exercises/concept/bitwise-operations/.docs/hints.md diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/instructions.md b/languages/csharp/exercises/concept/bitwise-operations/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.docs/instructions.md rename to languages/csharp/exercises/concept/bitwise-operations/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/bitwise-operations/.docs/introduction.md b/languages/csharp/exercises/concept/bitwise-operations/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.docs/introduction.md rename to languages/csharp/exercises/concept/bitwise-operations/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/bitwise-operations/.meta/Example.cs b/languages/csharp/exercises/concept/bitwise-operations/.meta/Example.cs similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/.meta/Example.cs rename to languages/csharp/exercises/concept/bitwise-operations/.meta/Example.cs diff --git a/languages/csharp/exercises/concept/bitwise-operations/.meta/config.json b/languages/csharp/exercises/concept/bitwise-operations/.meta/config.json new file mode 100644 index 0000000000..9e648d5259 --- /dev/null +++ b/languages/csharp/exercises/concept/bitwise-operations/.meta/config.json @@ -0,0 +1,94 @@ +{ + "solution_files": ["BitwiseOperations.cs"], + "test_file": "BitwiseOperationsTest.cs", + "tests": [ + { + "name": "DefaultForGuest", + "cmd": "Permissions.Default(AccountType.Guest)" + }, + { + "name": "DefaultForUser", + "cmd": "Permissions.Default(AccountType.User)" + }, + { + "name": "DefaultForModerator", + "cmd": "Permissions.Default(AccountType.Moderator)" + }, + { + "name": "DefaultForUnknown", + "cmd": "Permissions.Default((AccountType)123)" + }, + { + "name": "GrantReadToNone", + "cmd": "Permissions.Grant(Permission.None, Permission.Read)" + }, + { + "name": "GrantReadToRead", + "cmd": "Permissions.Grant(Permission.Read, Permission.Read)" + }, + { + "name": "GrantAllToNone", + "cmd": "Permissions.Grant(Permission.None, Permission.All)" + }, + { + "name": "GrantDeleteToReadAndWrite", + "cmd": "Permissions.Grant(Permission.Read | Permission.Write, Permission.Delete)" + }, + { + "name": "GrantReadAndWriteToNone", + "cmd": "Permissions.Grant(Permission.None, Permission.Read | Permission.Write)" + }, + { + "name": "RevokeNoneFromRead", + "cmd": "Permissions.Revoke(Permission.Read, Permission.None)" + }, + { + "name": "RevokeWriteFromWrite", + "cmd": "Permissions.Revoke(Permission.Write, Permission.Write)" + }, + { + "name": "RevokeDeleteFromAll", + "cmd": "Permissions.Revoke(Permission.All, Permission.Delete)" + }, + { + "name": "RevokeReadAndWriteFromWriteAndDelete", + "cmd": "Permissions.Revoke(Permission.Write | Permission.Delete, Permission.Read | Permission.Write)" + }, + { + "name": "RevokeAllFromReadAndWrite", + "cmd": "Permissions.Revoke(Permission.Read | Permission.Write, Permission.All)" + }, + { + "name": "CheckNoneForRead", + "cmd": "Permissions.Check(Permission.None, Permission.Read)" + }, + { + "name": "CheckWriteForWrite", + "cmd": "Permissions.Check(Permission.Write, Permission.Write)" + }, + { + "name": "CheckAllForWrite", + "cmd": "Permissions.Check(Permission.All, Permission.Write)" + }, + { + "name": "CheckReadAndWriteForRead", + "cmd": "Permissions.Check(Permission.Read | Permission.Write, Permission.Read)" + }, + { + "name": "CheckAllForReadAndWrite", + "cmd": "Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Write)" + }, + { + "name": "CheckReadAndWriteForReadAndWrite", + "cmd": "Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Write)" + }, + { + "name": "CheckReadAndWriteForReadAndDelete", + "cmd": "Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Delete)" + }, + { + "name": "CheckReadAndWriteAndDeleteForAll", + "cmd": "Permissions.Check(Permission.Read | Permission.Write | Permission.Delete, Permission.All)" + } + ] +} diff --git a/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperations.cs b/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperations.cs similarity index 52% rename from languages/csharp/concept-exercises/bitwise-operations/BitwiseOperations.cs rename to languages/csharp/exercises/concept/bitwise-operations/BitwiseOperations.cs index 0d713f7db8..36ae239a1c 100644 --- a/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperations.cs +++ b/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperations.cs @@ -8,21 +8,21 @@ public static class Permissions { public static Permission Default(AccountType accountType) { - throw new System.NotImplementedException("Please implement the Permissions.Default method"); + throw new NotImplementedException("Please implement the Permissions.Default method"); } public static Permission Grant(Permission current, Permission grant) { - throw new System.NotImplementedException("Please implement the Permissions.Grant method"); + throw new NotImplementedException("Please implement the Permissions.Grant method"); } public static Permission Revoke(Permission current, Permission revoke) { - throw new System.NotImplementedException("Please implement the Permissions.Revoke method"); + throw new NotImplementedException("Please implement the Permissions.Revoke method"); } public static bool Check(Permission current, Permission check) { - throw new System.NotImplementedException("Please implement the Permissions.Check method"); + throw new NotImplementedException("Please implement the Permissions.Check method"); } } \ No newline at end of file diff --git a/languages/csharp/concept-exercises/bitwise-operations/BitwiseOperations.csproj b/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperations.csproj similarity index 100% rename from languages/csharp/concept-exercises/bitwise-operations/BitwiseOperations.csproj rename to languages/csharp/exercises/concept/bitwise-operations/BitwiseOperations.csproj diff --git a/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperationsTest.cs b/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperationsTest.cs new file mode 100644 index 0000000000..9e4a71e1a1 --- /dev/null +++ b/languages/csharp/exercises/concept/bitwise-operations/BitwiseOperationsTest.cs @@ -0,0 +1,92 @@ +using Xunit; + +public class PermissionsTest +{ + [Fact] + public void DefaultForGuest() => + Assert.Equal(Permission.Read, Permissions.Default(AccountType.Guest)); + + [Fact] + public void DefaultForUser() => + Assert.Equal(Permission.Read | Permission.Write, Permissions.Default(AccountType.User)); + + [Fact] + public void DefaultForModerator() => + Assert.Equal(Permission.Read | Permission.Write | Permission.Delete, Permissions.Default(AccountType.Moderator)); + + [Fact] + public void DefaultForUnknown() => + Assert.Equal(Permission.None, Permissions.Default((AccountType)123)); + + [Fact] + public void GrantReadToNone() => + Assert.Equal(Permission.Read, Permissions.Grant(Permission.None, Permission.Read)); + + [Fact] + public void GrantReadToRead() => + Assert.Equal(Permission.Read, Permissions.Grant(Permission.Read, Permission.Read)); + + [Fact] + public void GrantAllToNone() => + Assert.Equal(Permission.All, Permissions.Grant(Permission.None, Permission.All)); + + [Fact] + public void GrantDeleteToReadAndWrite() => + Assert.Equal(Permission.All, Permissions.Grant(Permission.Read | Permission.Write, Permission.Delete)); + + [Fact] + public void GrantReadAndWriteToNone() => + Assert.Equal(Permission.Read | Permission.Write, Permissions.Grant(Permission.None, Permission.Read | Permission.Write)); + + [Fact] + public void RevokeNoneFromRead() => + Assert.Equal(Permission.Read, Permissions.Revoke(Permission.Read, Permission.None)); + + [Fact] + public void RevokeWriteFromWrite() => + Assert.Equal(Permission.None, Permissions.Revoke(Permission.Write, Permission.Write)); + + [Fact] + public void RevokeDeleteFromAll() => + Assert.Equal(Permission.Read | Permission.Write, Permissions.Revoke(Permission.All, Permission.Delete)); + + [Fact] + public void RevokeReadAndWriteFromWriteAndDelete() => + Assert.Equal(Permission.Delete, Permissions.Revoke(Permission.Write | Permission.Delete, Permission.Read | Permission.Write)); + + [Fact] + public void RevokeAllFromReadAndWrite() => + Assert.Equal(Permission.None, Permissions.Revoke(Permission.Read | Permission.Write, Permission.All)); + + [Fact] + public void CheckNoneForRead() => + Assert.False(Permissions.Check(Permission.None, Permission.Read)); + + [Fact] + public void CheckWriteForWrite() => + Assert.True(Permissions.Check(Permission.Write, Permission.Write)); + + [Fact] + public void CheckAllForWrite() => + Assert.True(Permissions.Check(Permission.All, Permission.Write)); + + [Fact] + public void CheckReadAndWriteForRead() => + Assert.True(Permissions.Check(Permission.Read | Permission.Write, Permission.Read)); + + [Fact] + public void CheckAllForReadAndWrite() => + Assert.True(Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Write)); + + [Fact] + public void CheckReadAndWriteForReadAndWrite() => + Assert.True(Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Write)); + + [Fact] + public void CheckReadAndWriteForReadAndDelete() => + Assert.False(Permissions.Check(Permission.Read | Permission.Write, Permission.Read | Permission.Delete)); + + [Fact] + public void CheckReadAndWriteAndDeleteForAll() => + Assert.True(Permissions.Check(Permission.Read | Permission.Write | Permission.Delete, Permission.All)); +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/dates/.docs/after.md b/languages/csharp/exercises/concept/dates/.docs/after.md similarity index 100% rename from languages/csharp/concept-exercises/dates/.docs/after.md rename to languages/csharp/exercises/concept/dates/.docs/after.md diff --git a/languages/csharp/concept-exercises/dates/.docs/hints.md b/languages/csharp/exercises/concept/dates/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/dates/.docs/hints.md rename to languages/csharp/exercises/concept/dates/.docs/hints.md diff --git a/languages/csharp/concept-exercises/dates/.docs/instructions.md b/languages/csharp/exercises/concept/dates/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/dates/.docs/instructions.md rename to languages/csharp/exercises/concept/dates/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/dates/.docs/introduction.md b/languages/csharp/exercises/concept/dates/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/dates/.docs/introduction.md rename to languages/csharp/exercises/concept/dates/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/dates/.meta/Example.cs b/languages/csharp/exercises/concept/dates/.meta/Example.cs similarity index 100% rename from languages/csharp/concept-exercises/dates/.meta/Example.cs rename to languages/csharp/exercises/concept/dates/.meta/Example.cs diff --git a/languages/csharp/exercises/concept/dates/.meta/config.json b/languages/csharp/exercises/concept/dates/.meta/config.json new file mode 100644 index 0000000000..56c5c4637b --- /dev/null +++ b/languages/csharp/exercises/concept/dates/.meta/config.json @@ -0,0 +1,102 @@ +{ + "solution_files": ["Dates.cs"], + "test_file": "DatesTest.cs", + "tests": [ + { + "name": "ScheduleDateUsingOnlyNumbers", + "cmd": "Appointment.Schedule(\"7/25/2019 13:45:00\")" + }, + { + "name": "ScheduleDateWithTextualMonth", + "cmd": "Appointment.Schedule(\"June 3, 2019 11:30:00\")" + }, + { + "name": "ScheduleDateWithTextualMonthAndWeekday", + "cmd": "Appointment.Schedule(\"Thursday, December 5, 2019 09:00:00\")" + }, + { + "name": "HasPassedWithAppointmentOneYearAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddYears(-1).AddHours(2))" + }, + { + "name": "HasPassedWithAppointmentMonthsAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMonths(-8))" + }, + { + "name": "HasPassedWithAppointmentDaysAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddDays(-23))" + }, + { + "name": "HasPassedWithAppointmentHoursAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddHours(-12))" + }, + { + "name": "HasPassedWithAppointmentMinutesAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMinutes(-55))" + }, + { + "name": "HasPassedWithAppointmentOneMinuteAgo", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMinutes(-1))" + }, + { + "name": "HasPassedWithAppointmentInOneMinute", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMinutes(1))" + }, + { + "name": "HasPassedWithAppointmentInMinutes", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMinutes(5))" + }, + { + "name": "HasPassedWithAppointmentInDays", + "cmd": "Appointment.HasPassed(DateTime.Now.AddDays(19))" + }, + { + "name": "HasPassedWithAppointmentInMonths", + "cmd": "Appointment.HasPassed(DateTime.Now.AddMonths(10))" + }, + { + "name": "HasPassedWithAppointmentInYears", + "cmd": "Appointment.HasPassed(DateTime.Now.AddYears(2).AddMonths(3).AddDays(6))" + }, + { + "name": "IsAfternoonAppointmentForEarlyMorningAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 6, 17, 8, 15, 0))" + }, + { + "name": "IsAfternoonAppointmentForLateMorningAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 2, 23, 11, 59, 59))" + }, + { + "name": "IsAfternoonAppointmentForNoonAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 8, 9, 12, 0, 0))" + }, + { + "name": "IsAfternoonAppointmentForEarlyAfternoonAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 8, 9, 12, 0, 1))" + }, + { + "name": "IsAfternoonAppointmentForLateAfternoonAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 17, 59, 59))" + }, + { + "name": "IsAfternoonAppointmentForEarlyEveningAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 18, 0, 0))" + }, + { + "name": "IsAfternoonAppointmentForLateEveningAppointment", + "cmd": "Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 23, 59, 59))" + }, + { + "name": "DescriptionOnFridayAfternoon", + "cmd": "Appointment.Description(new DateTime(2019, 03, 29, 15, 0, 0))" + }, + { + "name": "DescriptionOnThursdayAfternoon", + "cmd": "Appointment.Description(new DateTime(2019, 07, 25, 13, 45, 0))" + }, + { + "name": "DescriptionOnWednesdayMorning", + "cmd": "Appointment.Description(new DateTime(2020, 9, 9, 9, 9, 9))" + } + ] +} diff --git a/languages/csharp/exercises/concept/dates/Dates.cs b/languages/csharp/exercises/concept/dates/Dates.cs new file mode 100644 index 0000000000..166c158d3d --- /dev/null +++ b/languages/csharp/exercises/concept/dates/Dates.cs @@ -0,0 +1,24 @@ +using System; + +public static class Appointment +{ + public static DateTime Schedule(string appointmentDateDescription) + { + throw new NotImplementedException("Please implement the Appointment.Schedule method"); + } + + public static bool HasPassed(DateTime appointmentDate) + { + throw new NotImplementedException("Please implement the Appointment.HasPassed method"); + } + + public static bool IsAfternoonAppointment(DateTime appointmentDate) + { + throw new NotImplementedException("Please implement the Appointment.IsAfternoonAppointment method"); + } + + public static string Description(DateTime appointmentDate) + { + throw new NotImplementedException("Please implement the Appointment.Description method"); + } +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/dates/Dates.csproj b/languages/csharp/exercises/concept/dates/Dates.csproj similarity index 100% rename from languages/csharp/concept-exercises/dates/Dates.csproj rename to languages/csharp/exercises/concept/dates/Dates.csproj diff --git a/languages/csharp/exercises/concept/dates/DatesTest.cs b/languages/csharp/exercises/concept/dates/DatesTest.cs new file mode 100644 index 0000000000..0f943d2506 --- /dev/null +++ b/languages/csharp/exercises/concept/dates/DatesTest.cs @@ -0,0 +1,145 @@ +using Xunit; +using System; +using System.Globalization; +using System.Reflection; +using System.Threading; +using Xunit.Sdk; + +[UseCulture("en-US")] +public class AppointmentTest +{ + [Fact] + public void ScheduleDateUsingOnlyNumbers() => + Assert.Equal(new DateTime(2019, 07, 25, 13, 45, 0), Appointment.Schedule("7/25/2019 13:45:00")); + + [Fact] + public void ScheduleDateWithTextualMonth() => + Assert.Equal(new DateTime(2019, 6, 3, 11, 30, 0), Appointment.Schedule("June 3, 2019 11:30:00")); + + [Fact] + public void ScheduleDateWithTextualMonthAndWeekday() => + Assert.Equal(new DateTime(2019, 12, 5, 9, 0, 0), Appointment.Schedule("Thursday, December 5, 2019 09:00:00")); + + [Fact] + public void HasPassedWithAppointmentOneYearAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddYears(-1).AddHours(2))); + + [Fact] + public void HasPassedWithAppointmentMonthsAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddMonths(-8))); + + [Fact] + public void HasPassedWithAppointmentDaysAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddDays(-23))); + + [Fact] + public void HasPassedWithAppointmentHoursAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddHours(-12))); + + [Fact] + public void HasPassedWithAppointmentMinutesAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddMinutes(-55))); + + [Fact] + public void HasPassedWithAppointmentOneMinuteAgo() => + Assert.True(Appointment.HasPassed(DateTime.Now.AddMinutes(-1))); + + [Fact] + public void HasPassedWithAppointmentInOneMinute() => + Assert.False(Appointment.HasPassed(DateTime.Now.AddMinutes(1))); + + [Fact] + public void HasPassedWithAppointmentInMinutes() => + Assert.False(Appointment.HasPassed(DateTime.Now.AddMinutes(5))); + + [Fact] + public void HasPassedWithAppointmentInDays() => + Assert.False(Appointment.HasPassed(DateTime.Now.AddDays(19))); + + [Fact] + public void HasPassedWithAppointmentInMonths() => + Assert.False(Appointment.HasPassed(DateTime.Now.AddMonths(10))); + + [Fact] + public void HasPassedWithAppointmentInYears() => + Assert.False(Appointment.HasPassed(DateTime.Now.AddYears(2).AddMonths(3).AddDays(6))); + + [Fact] + public void IsAfternoonAppointmentForEarlyMorningAppointment() => + Assert.False(Appointment.IsAfternoonAppointment(new DateTime(2019, 6, 17, 8, 15, 0))); + + [Fact] + public void IsAfternoonAppointmentForLateMorningAppointment() => + Assert.False(Appointment.IsAfternoonAppointment(new DateTime(2019, 2, 23, 11, 59, 59))); + + [Fact] + public void IsAfternoonAppointmentForNoonAppointment() => + Assert.True(Appointment.IsAfternoonAppointment(new DateTime(2019, 8, 9, 12, 0, 0))); + + [Fact] + public void IsAfternoonAppointmentForEarlyAfternoonAppointment() => + Assert.True(Appointment.IsAfternoonAppointment(new DateTime(2019, 8, 9, 12, 0, 1))); + + [Fact] + public void IsAfternoonAppointmentForLateAfternoonAppointment() => + Assert.True(Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 17, 59, 59))); + + [Fact] + public void IsAfternoonAppointmentForEarlyEveningAppointment() => + Assert.False(Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 18, 0, 0))); + + [Fact] + public void IsAfternoonAppointmentForLateEveningAppointment() => + Assert.False(Appointment.IsAfternoonAppointment(new DateTime(2019, 9, 1, 23, 59, 59))); + + [Fact] + public void DescriptionOnFridayAfternoon() => + Assert.Equal("You have an appointment on Friday 29 March 2019 at 15:00.", Appointment.Description(new DateTime(2019, 03, 29, 15, 0, 0))); + + [Fact] + public void DescriptionOnThursdayAfternoon() => + Assert.Equal("You have an appointment on Thursday 25 July 2019 at 13:45.", Appointment.Description(new DateTime(2019, 07, 25, 13, 45, 0))); + + [Fact] + public void DescriptionOnWednesdayMorning() => + Assert.Equal("You have an appointment on Wednesday 9 September 2020 at 09:09.", Appointment.Description(new DateTime(2020, 9, 9, 9, 9, 9))); + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] + private class UseCultureAttribute : BeforeAfterTestAttribute + { + private readonly CultureInfo _culture; + private readonly CultureInfo _uiCulture; + private CultureInfo _originalCulture; + private CultureInfo _originalUiCulture; + + public UseCultureAttribute(string culture) + : this(culture, culture) { } + + public UseCultureAttribute(string culture, string uiCulture) + { + _culture = new CultureInfo(culture, false); + _uiCulture = new CultureInfo(uiCulture, false); + } + + public override void Before(MethodInfo methodUnderTest) + { + _originalCulture = Thread.CurrentThread.CurrentCulture; + _originalUiCulture = Thread.CurrentThread.CurrentUICulture; + + Thread.CurrentThread.CurrentCulture = _culture; + Thread.CurrentThread.CurrentUICulture = _uiCulture; + + CultureInfo.CurrentCulture.ClearCachedData(); + CultureInfo.CurrentUICulture.ClearCachedData(); + } + + public override void After(MethodInfo methodUnderTest) + { + Thread.CurrentThread.CurrentCulture = _originalCulture; + Thread.CurrentThread.CurrentUICulture = _originalUiCulture; + + CultureInfo.CurrentCulture.ClearCachedData(); + CultureInfo.CurrentUICulture.ClearCachedData(); + } + } +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/enums/.docs/hints.md b/languages/csharp/exercises/concept/enums/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/enums/.docs/hints.md rename to languages/csharp/exercises/concept/enums/.docs/hints.md diff --git a/languages/csharp/concept-exercises/enums/.docs/instructions.md b/languages/csharp/exercises/concept/enums/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/enums/.docs/instructions.md rename to languages/csharp/exercises/concept/enums/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/enums/.docs/introduction.md b/languages/csharp/exercises/concept/enums/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/enums/.docs/introduction.md rename to languages/csharp/exercises/concept/enums/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/enums/.meta/Example.cs b/languages/csharp/exercises/concept/enums/.meta/Example.cs similarity index 100% rename from languages/csharp/concept-exercises/enums/.meta/Example.cs rename to languages/csharp/exercises/concept/enums/.meta/Example.cs diff --git a/languages/csharp/exercises/concept/enums/.meta/config.json b/languages/csharp/exercises/concept/enums/.meta/config.json new file mode 100644 index 0000000000..e6378f8d6f --- /dev/null +++ b/languages/csharp/exercises/concept/enums/.meta/config.json @@ -0,0 +1,38 @@ +{ + "solution_files": ["Enums.cs"], + "test_file": "EnumsTest.cs", + "tests": [ + { + "name": "ParseError", + "cmd": "LogLine.ParseLogLevel(\"[ERROR]: Disk full\")" + }, + { + "name": "ParseWarning", + "cmd": "LogLine.ParseLogLevel(\"[WARNING]: Timezone not set\")" + }, + { + "name": "ParseInfo", + "cmd": "LogLine.ParseLogLevel(\"[INFO]: Timezone changed\")" + }, + { + "name": "ParseUnknown", + "cmd": "LogLine.ParseLogLevel(\"[FATAL]: Crash!\")" + }, + { + "name": "OutputForShortLogForError", + "cmd": "LogLine.OutputForShortLog(LogLevel.Error, \"Stack overflow\")" + }, + { + "name": "OutputForShortLogForWarning", + "cmd": "LogLine.OutputForShortLog(LogLevel.Warning, \"Unsafe password\")" + }, + { + "name": "OutputForShortLogForInfo", + "cmd": "LogLine.OutputForShortLog(LogLevel.Info, \"File moved\")" + }, + { + "name": "OutputForShortLogForUnknown", + "cmd": "LogLine.OutputForShortLog(LogLevel.Unknown, \"Something unknown happened\")" + } + ] +} diff --git a/languages/csharp/concept-exercises/enums/Enums.cs b/languages/csharp/exercises/concept/enums/Enums.cs similarity index 53% rename from languages/csharp/concept-exercises/enums/Enums.cs rename to languages/csharp/exercises/concept/enums/Enums.cs index 68de3c84df..43371916ec 100644 --- a/languages/csharp/concept-exercises/enums/Enums.cs +++ b/languages/csharp/exercises/concept/enums/Enums.cs @@ -6,11 +6,11 @@ public static class LogLine { public static LogLevel ParseLogLevel(string logLine) { - throw new System.NotImplementedException("Please implement the LogLine.ParseLogLevel method"); + throw new NotImplementedException("Please implement the LogLine.ParseLogLevel method"); } public static string OutputForShortLog(LogLevel logLevel, string message) { - throw new System.NotImplementedException("Please implement the LogLine.OutputForShortLog method"); + throw new NotImplementedException("Please implement the LogLine.OutputForShortLog method"); } } \ No newline at end of file diff --git a/languages/csharp/concept-exercises/enums/Enums.csproj b/languages/csharp/exercises/concept/enums/Enums.csproj similarity index 100% rename from languages/csharp/concept-exercises/enums/Enums.csproj rename to languages/csharp/exercises/concept/enums/Enums.csproj diff --git a/languages/csharp/exercises/concept/enums/EnumsTest.cs b/languages/csharp/exercises/concept/enums/EnumsTest.cs new file mode 100644 index 0000000000..a36e121d29 --- /dev/null +++ b/languages/csharp/exercises/concept/enums/EnumsTest.cs @@ -0,0 +1,36 @@ +using Xunit; + +public class LogLineTest +{ + [Fact] + public void ParseError() => + Assert.Equal(LogLevel.Error, LogLine.ParseLogLevel("[ERROR]: Disk full")); + + [Fact] + public void ParseWarning() => + Assert.Equal(LogLevel.Warning, LogLine.ParseLogLevel("[WARNING]: Timezone not set")); + + [Fact] + public void ParseInfo() => + Assert.Equal(LogLevel.Info, LogLine.ParseLogLevel("[INFO]: Timezone changed")); + + [Fact] + public void ParseUnknown() => + Assert.Equal(LogLevel.Unknown, LogLine.ParseLogLevel("[FATAL]: Crash!")); + + [Fact] + public void OutputForShortLogForError() => + Assert.Equal("4:Stack overflow", LogLine.OutputForShortLog(LogLevel.Error, "Stack overflow")); + + [Fact] + public void OutputForShortLogForWarning() => + Assert.Equal("2:Unsafe password", LogLine.OutputForShortLog(LogLevel.Warning, "Unsafe password")); + + [Fact] + public void OutputForShortLogForInfo() => + Assert.Equal("1:File moved", LogLine.OutputForShortLog(LogLevel.Info, "File moved")); + + [Fact] + public void OutputForShortLogForUnknown() => + Assert.Equal("0:Something unknown happened", LogLine.OutputForShortLog(LogLevel.Unknown, "Something unknown happened")); +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/after.md b/languages/csharp/exercises/concept/numbers-floating-point/.docs/after.md similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/.docs/after.md rename to languages/csharp/exercises/concept/numbers-floating-point/.docs/after.md diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/hints.md b/languages/csharp/exercises/concept/numbers-floating-point/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/.docs/hints.md rename to languages/csharp/exercises/concept/numbers-floating-point/.docs/hints.md diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/instructions.md b/languages/csharp/exercises/concept/numbers-floating-point/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/.docs/instructions.md rename to languages/csharp/exercises/concept/numbers-floating-point/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.docs/introduction.md b/languages/csharp/exercises/concept/numbers-floating-point/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/.docs/introduction.md rename to languages/csharp/exercises/concept/numbers-floating-point/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/numbers-floating-point/.meta/Example.cs b/languages/csharp/exercises/concept/numbers-floating-point/.meta/Example.cs similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/.meta/Example.cs rename to languages/csharp/exercises/concept/numbers-floating-point/.meta/Example.cs diff --git a/languages/csharp/exercises/concept/numbers-floating-point/.meta/config.json b/languages/csharp/exercises/concept/numbers-floating-point/.meta/config.json new file mode 100644 index 0000000000..af3aeb01ed --- /dev/null +++ b/languages/csharp/exercises/concept/numbers-floating-point/.meta/config.json @@ -0,0 +1,102 @@ +{ + "solution_files": ["NumbersFloatingPoint.cs"], + "test_file": "NumbersFloatingPointTest.cs", + "tests": [ + { + "name": "MinimalFirstAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(0m)" + }, + { + "name": "TinyFirstAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(0.000001m)" + }, + { + "name": "MaximumFirstAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(999.9999m)" + }, + { + "name": "MinimalSecondAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(1_000.0m)" + }, + { + "name": "TinySecondAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(1_000.0001m)" + }, + { + "name": "MaximumSecondAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(4_999.9990m)" + }, + { + "name": "MinimalThirdAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(5_000.0000m)" + }, + { + "name": "TinyThirdAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(5_000.0001m)" + }, + { + "name": "LargeThirdAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(5_639_998.742909m)" + }, + { + "name": "MinimalNegativeAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(-0.000001m)" + }, + { + "name": "SmallNegativeAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(-0.123m)" + }, + { + "name": "RegularNegativeAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(-300.0m)" + }, + { + "name": "LargeNegativeAnnualPercentageYield", + "cmd": "SavingsAccount.AnnualPercentageYield(-152964.231m)" + }, + { + "name": "AnnualBalanceUpdateForEmptyStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(0.0m)" + }, + { + "name": "AnnualBalanceUpdateForSmallPositiveStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(0.000001m)" + }, + { + "name": "AnnualBalanceUpdateForAveragePositiveStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(1_000.0m)" + }, + { + "name": "AnnualBalanceUpdateForLargePositiveStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(1_000.0001m)" + }, + { + "name": "AnnualBalanceUpdateForHugePositiveStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(898124017.826243404425m)" + }, + { + "name": "AnnualBalanceUpdateForSmallNegativeStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(-0.123m)" + }, + { + "name": "AnnualBalanceUpdateForLargeNegativeStartBalance", + "cmd": "SavingsAccount.AnnualBalanceUpdate(-152964.231m)" + }, + { + "name": "YearsBeforeDesiredBalanceForSmallStartBalance", + "cmd": "SavingsAccount.YearsBeforeDesiredBalance(100.0m, 125.80m)" + }, + { + "name": "YearsBeforeDesiredBalanceForAverageStartBalance", + "cmd": "SavingsAccount.YearsBeforeDesiredBalance(1_000.0m, 1_100.0m)" + }, + { + "name": "YearsBeforeDesiredBalanceForLargeStartBalance", + "cmd": "SavingsAccount.YearsBeforeDesiredBalance(8_080.80m, 9_090.90m)" + }, + { + "name": "YearsBeforeDesiredBalanceForLargeDifferentBetweenStartAndTargetBalance", + "cmd": "SavingsAccount.YearsBeforeDesiredBalance(2_345.67m, 12_345.6789m)" + } + ] +} diff --git a/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.cs b/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.cs new file mode 100644 index 0000000000..081c2e065d --- /dev/null +++ b/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.cs @@ -0,0 +1,19 @@ +using System; + +public static class SavingsAccount +{ + public static float AnnualPercentageYield(decimal balance) + { + throw new NotImplementedException("Please implement the SavingsAccount.AnnualPercentageYield method"); + } + + public static decimal AnnualBalanceUpdate(decimal balance) + { + throw new NotImplementedException("Please implement the SavingsAccount.AnnualBalanceUpdate method"); + } + + public static int YearsBeforeDesiredBalance(decimal balance, decimal targetBalance) + { + throw new NotImplementedException("Please implement the SavingsAccount.YearsBeforeDesiredBalance method"); + } +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.csproj b/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.csproj similarity index 100% rename from languages/csharp/concept-exercises/numbers-floating-point/NumbersFloatingPoint.csproj rename to languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPoint.csproj diff --git a/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPointTest.cs b/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPointTest.cs new file mode 100644 index 0000000000..9bd3ba1ce8 --- /dev/null +++ b/languages/csharp/exercises/concept/numbers-floating-point/NumbersFloatingPointTest.cs @@ -0,0 +1,100 @@ +using Xunit; + +public class SavingsAccountTest +{ + [Fact] + public void MinimalFirstAnnualPercentageYield() => + Assert.Equal(0.5f, SavingsAccount.AnnualPercentageYield(0m)); + + [Fact] + public void TinyFirstAnnualPercentageYield() => + Assert.Equal(0.5f, SavingsAccount.AnnualPercentageYield(0.000001m)); + + [Fact] + public void MaximumFirstAnnualPercentageYield() => + Assert.Equal(0.5f, SavingsAccount.AnnualPercentageYield(999.9999m)); + + [Fact] + public void MinimalSecondAnnualPercentageYield() => + Assert.Equal(1.621f, SavingsAccount.AnnualPercentageYield(1_000.0m)); + + [Fact] + public void TinySecondAnnualPercentageYield() => + Assert.Equal(1.621f, SavingsAccount.AnnualPercentageYield(1_000.0001m)); + + [Fact] + public void MaximumSecondAnnualPercentageYield() => + Assert.Equal(1.621f, SavingsAccount.AnnualPercentageYield(4_999.9990m)); + + [Fact] + public void MinimalThirdAnnualPercentageYield() => + Assert.Equal(2.475f, SavingsAccount.AnnualPercentageYield(5_000.0000m)); + + [Fact] + public void TinyThirdAnnualPercentageYield() => + Assert.Equal(2.475f, SavingsAccount.AnnualPercentageYield(5_000.0001m)); + + [Fact] + public void LargeThirdAnnualPercentageYield() => + Assert.Equal(2.475f, SavingsAccount.AnnualPercentageYield(5_639_998.742909m)); + + [Fact] + public void MinimalNegativeAnnualPercentageYield() => + Assert.Equal(-3.213f, SavingsAccount.AnnualPercentageYield(-0.000001m)); + + [Fact] + public void SmallNegativeAnnualPercentageYield() => + Assert.Equal(-3.213f, SavingsAccount.AnnualPercentageYield(-0.123m)); + + [Fact] + public void RegularNegativeAnnualPercentageYield() => + Assert.Equal(-3.213f, SavingsAccount.AnnualPercentageYield(-300.0m)); + + [Fact] + public void LargeNegativeAnnualPercentageYield() => + Assert.Equal(-3.213f, SavingsAccount.AnnualPercentageYield(-152964.231m)); + + [Fact] + public void AnnualBalanceUpdateForEmptyStartBalance() => + Assert.Equal(0.0000m, SavingsAccount.AnnualBalanceUpdate(0.0m)); + + [Fact] + public void AnnualBalanceUpdateForSmallPositiveStartBalance() => + Assert.Equal(0.000001005m, SavingsAccount.AnnualBalanceUpdate(0.000001m)); + + [Fact] + public void AnnualBalanceUpdateForAveragePositiveStartBalance() => + Assert.Equal(1016.210000m, SavingsAccount.AnnualBalanceUpdate(1_000.0m)); + + [Fact] + public void AnnualBalanceUpdateForLargePositiveStartBalance() => + Assert.Equal(1016.210101621m, SavingsAccount.AnnualBalanceUpdate(1_000.0001m)); + + [Fact] + public void AnnualBalanceUpdateForHugePositiveStartBalance() => + Assert.Equal(920352587.26744292868451875m, SavingsAccount.AnnualBalanceUpdate(898124017.826243404425m)); + + [Fact] + public void AnnualBalanceUpdateForSmallNegativeStartBalance() => + Assert.Equal(-0.12695199m, SavingsAccount.AnnualBalanceUpdate(-0.123m)); + + [Fact] + public void AnnualBalanceUpdateForLargeNegativeStartBalance() => + Assert.Equal(-157878.97174203m, SavingsAccount.AnnualBalanceUpdate(-152964.231m)); + + [Fact] + public void YearsBeforeDesiredBalanceForSmallStartBalance() => + Assert.Equal(47, SavingsAccount.YearsBeforeDesiredBalance(100.0m, 125.80m)); + + [Fact] + public void YearsBeforeDesiredBalanceForAverageStartBalance() => + Assert.Equal(6, SavingsAccount.YearsBeforeDesiredBalance(1_000.0m, 1_100.0m)); + + [Fact] + public void YearsBeforeDesiredBalanceForLargeStartBalance() => + Assert.Equal(5, SavingsAccount.YearsBeforeDesiredBalance(8_080.80m, 9_090.90m)); + + [Fact] + public void YearsBeforeDesiredBalanceForLargeDifferentBetweenStartAndTargetBalance() => + Assert.Equal(85, SavingsAccount.YearsBeforeDesiredBalance(2_345.67m, 12_345.6789m)); +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers/.docs/hints.md b/languages/csharp/exercises/concept/numbers/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/numbers/.docs/hints.md rename to languages/csharp/exercises/concept/numbers/.docs/hints.md diff --git a/languages/csharp/concept-exercises/numbers/.docs/instructions.md b/languages/csharp/exercises/concept/numbers/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/numbers/.docs/instructions.md rename to languages/csharp/exercises/concept/numbers/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/numbers/.docs/introduction.md b/languages/csharp/exercises/concept/numbers/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/numbers/.docs/introduction.md rename to languages/csharp/exercises/concept/numbers/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/numbers/.meta/Example.cs b/languages/csharp/exercises/concept/numbers/.meta/Example.cs similarity index 100% rename from languages/csharp/concept-exercises/numbers/.meta/Example.cs rename to languages/csharp/exercises/concept/numbers/.meta/Example.cs diff --git a/languages/csharp/exercises/concept/numbers/.meta/config.json b/languages/csharp/exercises/concept/numbers/.meta/config.json new file mode 100644 index 0000000000..5579d4392a --- /dev/null +++ b/languages/csharp/exercises/concept/numbers/.meta/config.json @@ -0,0 +1,46 @@ +{ + "solution_files": ["Numbers.cs"], + "test_file": "NumbersTest.cs", + "tests": [ + { + "name": "ProductionRatePerHourForSpeedZero", + "cmd": "AssemblyLine.ProductionRatePerHour(0)" + }, + { + "name": "ProductionRatePerHourForSpeedOne", + "cmd": "AssemblyLine.ProductionRatePerHour(1)" + }, + { + "name": "ProductionRatePerHourForSpeedFour", + "cmd": "AssemblyLine.ProductionRatePerHour(4)" + }, + { + "name": "ProductionRatePerHourForSpeedSeven", + "cmd": "AssemblyLine.ProductionRatePerHour(7)" + }, + { + "name": "ProductionRatePerHourForSpeedNine", + "cmd": "AssemblyLine.ProductionRatePerHour(9)" + }, + { + "name": "WorkingItemsPerMinuteForSpeedZero", + "cmd": "AssemblyLine.WorkingItemsPerMinute(0)" + }, + { + "name": "WorkingItemsPerMinuteForSpeedOne", + "cmd": "AssemblyLine.WorkingItemsPerMinute(1)" + }, + { + "name": "WorkingItemsPerMinuteForSpeedFive", + "cmd": "AssemblyLine.WorkingItemsPerMinute(5)" + }, + { + "name": "WorkingItemsPerMinuteForSpeedFour", + "cmd": "AssemblyLine.WorkingItemsPerMinute(8)" + }, + { + "name": "WorkingItemsPerMinuteForSpeedTen", + "cmd": "AssemblyLine.WorkingItemsPerMinute(10)" + } + ] +} diff --git a/languages/csharp/exercises/concept/numbers/Numbers.cs b/languages/csharp/exercises/concept/numbers/Numbers.cs new file mode 100644 index 0000000000..c888768923 --- /dev/null +++ b/languages/csharp/exercises/concept/numbers/Numbers.cs @@ -0,0 +1,14 @@ +using System; + +public static class AssemblyLine +{ + public static double ProductionRatePerHour(int speed) + { + throw new NotImplementedException("Please implement the AssemblyLine.ProductionRatePerHour method"); + } + + public static int WorkingItemsPerMinute(int speed) + { + throw new NotImplementedException("Please implement the AssemblyLine.WorkingItemsPerMinute method"); + } +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/numbers/Numbers.csproj b/languages/csharp/exercises/concept/numbers/Numbers.csproj similarity index 100% rename from languages/csharp/concept-exercises/numbers/Numbers.csproj rename to languages/csharp/exercises/concept/numbers/Numbers.csproj diff --git a/languages/csharp/exercises/concept/numbers/NumbersTest.cs b/languages/csharp/exercises/concept/numbers/NumbersTest.cs new file mode 100644 index 0000000000..38fc5138c4 --- /dev/null +++ b/languages/csharp/exercises/concept/numbers/NumbersTest.cs @@ -0,0 +1,44 @@ +using Xunit; + +public class AssemblyLineTest +{ + [Fact] + public void ProductionRatePerHourForSpeedZero() => + Assert.Equal(0.0, AssemblyLine.ProductionRatePerHour(0)); + + [Fact] + public void ProductionRatePerHourForSpeedOne() => + Assert.Equal(221.0, AssemblyLine.ProductionRatePerHour(1)); + + [Fact] + public void ProductionRatePerHourForSpeedFour() => + Assert.Equal(884.0, AssemblyLine.ProductionRatePerHour(4)); + + [Fact] + public void ProductionRatePerHourForSpeedSeven() => + Assert.Equal(1392.3, AssemblyLine.ProductionRatePerHour(7)); + + [Fact] + public void ProductionRatePerHourForSpeedNine() => + Assert.Equal(1531.53, AssemblyLine.ProductionRatePerHour(9)); + + [Fact] + public void WorkingItemsPerMinuteForSpeedZero() => + Assert.Equal(0, AssemblyLine.WorkingItemsPerMinute(0)); + + [Fact] + public void WorkingItemsPerMinuteForSpeedOne() => + Assert.Equal(3, AssemblyLine.WorkingItemsPerMinute(1)); + + [Fact] + public void WorkingItemsPerMinuteForSpeedFive() => + Assert.Equal(16, AssemblyLine.WorkingItemsPerMinute(5)); + + [Fact] + public void WorkingItemsPerMinuteForSpeedFour() => + Assert.Equal(26, AssemblyLine.WorkingItemsPerMinute(8)); + + [Fact] + public void WorkingItemsPerMinuteForSpeedTen() => + Assert.Equal(28, AssemblyLine.WorkingItemsPerMinute(10)); +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/strings/.docs/after.md b/languages/csharp/exercises/concept/strings/.docs/after.md similarity index 100% rename from languages/csharp/concept-exercises/strings/.docs/after.md rename to languages/csharp/exercises/concept/strings/.docs/after.md diff --git a/languages/csharp/concept-exercises/strings/.docs/hints.md b/languages/csharp/exercises/concept/strings/.docs/hints.md similarity index 100% rename from languages/csharp/concept-exercises/strings/.docs/hints.md rename to languages/csharp/exercises/concept/strings/.docs/hints.md diff --git a/languages/csharp/concept-exercises/strings/.docs/instructions.md b/languages/csharp/exercises/concept/strings/.docs/instructions.md similarity index 100% rename from languages/csharp/concept-exercises/strings/.docs/instructions.md rename to languages/csharp/exercises/concept/strings/.docs/instructions.md diff --git a/languages/csharp/concept-exercises/strings/.docs/introduction.md b/languages/csharp/exercises/concept/strings/.docs/introduction.md similarity index 100% rename from languages/csharp/concept-exercises/strings/.docs/introduction.md rename to languages/csharp/exercises/concept/strings/.docs/introduction.md diff --git a/languages/csharp/concept-exercises/strings/.meta/Example.cs b/languages/csharp/exercises/concept/strings/.meta/Example.cs similarity index 96% rename from languages/csharp/concept-exercises/strings/.meta/Example.cs rename to languages/csharp/exercises/concept/strings/.meta/Example.cs index 84e7a04f22..faf1a56bf4 100644 --- a/languages/csharp/concept-exercises/strings/.meta/Example.cs +++ b/languages/csharp/exercises/concept/strings/.meta/Example.cs @@ -1,5 +1,3 @@ -using System; - public static class LogLine { public static string Message(string logLine) => diff --git a/languages/csharp/exercises/concept/strings/.meta/config.json b/languages/csharp/exercises/concept/strings/.meta/config.json new file mode 100644 index 0000000000..bb09573864 --- /dev/null +++ b/languages/csharp/exercises/concept/strings/.meta/config.json @@ -0,0 +1,50 @@ +{ + "solution_files": ["Strings.cs"], + "test_file": "StringsTest.cs", + "tests": [ + { + "name": "ErrorMessage", + "cmd": "LogLine.Message(\"[ERROR]: Stack overflow\")" + }, + { + "name": "WarningMessage", + "cmd": "LogLine.Message(\"[WARNING]: Disk almost full\")" + }, + { + "name": "InfoMessage", + "cmd": "LogLine.Message(\"[INFO]: File moved\")" + }, + { + "name": "MessageWithLeadingAndTrailingWhiteSpace", + "cmd": "LogLine.Message(\"[WARNING]: \tTimezone not set \r\n\")" + }, + { + "name": "ErrorLogLevel", + "cmd": "LogLine.LogLevel(\"[ERROR]: Disk full\")" + }, + { + "name": "WarningLogLevel", + "cmd": "LogLine.LogLevel(\"[WARNING]: Unsafe password\")" + }, + { + "name": "InfoLogLevel", + "cmd": "LogLine.LogLevel(\"[INFO]: Timezone changed\")" + }, + { + "name": "ErrorReformat", + "cmd": "LogLine.Reformat(\"[ERROR]: Segmentation fault\")" + }, + { + "name": "WarningReformat", + "cmd": "LogLine.Reformat(\"[WARNING]: Decreased performance\")" + }, + { + "name": "InfoReformat", + "cmd": "LogLine.Reformat(\"[INFO]: Disk defragmented\")" + }, + { + "name": "ReformatWithLeadingAndTrailingWhiteSpace", + "cmd": "LogLine.Reformat(\"[ERROR]: \t Corrupt disk\t \t \r\n\")" + } + ] +} diff --git a/languages/csharp/exercises/concept/strings/Strings.cs b/languages/csharp/exercises/concept/strings/Strings.cs new file mode 100644 index 0000000000..f1fa861bb0 --- /dev/null +++ b/languages/csharp/exercises/concept/strings/Strings.cs @@ -0,0 +1,19 @@ +using System; + +public static class LogLine +{ + public static string Message(string logLine) + { + throw new NotImplementedException("Please implement the LogLine.Message method"); + } + + public static string LogLevel(string logLine) + { + throw new NotImplementedException("Please implement the LogLine.LogLevel method"); + } + + public static string Reformat(string logLine) + { + throw new NotImplementedException("Please implement the LogLine.Reformat method"); + } +} \ No newline at end of file diff --git a/languages/csharp/concept-exercises/strings/Strings.csproj b/languages/csharp/exercises/concept/strings/Strings.csproj similarity index 100% rename from languages/csharp/concept-exercises/strings/Strings.csproj rename to languages/csharp/exercises/concept/strings/Strings.csproj diff --git a/languages/csharp/exercises/concept/strings/StringsTest.cs b/languages/csharp/exercises/concept/strings/StringsTest.cs new file mode 100644 index 0000000000..4203add97e --- /dev/null +++ b/languages/csharp/exercises/concept/strings/StringsTest.cs @@ -0,0 +1,48 @@ +using Xunit; + +public class LogLineTest +{ + [Fact] + public void ErrorMessage() => + Assert.Equal("Stack overflow", LogLine.Message("[ERROR]: Stack overflow")); + + [Fact] + public void WarningMessage() => + Assert.Equal("Disk almost full", LogLine.Message("[WARNING]: Disk almost full")); + + [Fact] + public void InfoMessage() => + Assert.Equal("File moved", LogLine.Message("[INFO]: File moved")); + + [Fact] + public void MessageWithLeadingAndTrailingWhiteSpace() => + Assert.Equal("Timezone not set", LogLine.Message("[WARNING]: \tTimezone not set \r\n")); + + [Fact] + public void ErrorLogLevel() => + Assert.Equal("error", LogLine.LogLevel("[ERROR]: Disk full")); + + [Fact] + public void WarningLogLevel() => + Assert.Equal("warning", LogLine.LogLevel("[WARNING]: Unsafe password")); + + [Fact] + public void InfoLogLevel() => + Assert.Equal("info", LogLine.LogLevel("[INFO]: Timezone changed")); + + [Fact] + public void ErrorReformat() => + Assert.Equal("Segmentation fault (error)", LogLine.Reformat("[ERROR]: Segmentation fault")); + + [Fact] + public void WarningReformat() => + Assert.Equal("Decreased performance (warning)", LogLine.Reformat("[WARNING]: Decreased performance")); + + [Fact] + public void InfoReformat() => + Assert.Equal("Disk defragmented (info)", LogLine.Reformat("[INFO]: Disk defragmented")); + + [Fact] + public void ReformatWithLeadingAndTrailingWhiteSpace() => + Assert.Equal("Corrupt disk (error)", LogLine.Reformat("[ERROR]: \t Corrupt disk\t \t \r\n")); +} \ No newline at end of file diff --git a/languages/csharp/exercises/practice/README.md b/languages/csharp/exercises/practice/README.md new file mode 100644 index 0000000000..880b02aea7 --- /dev/null +++ b/languages/csharp/exercises/practice/README.md @@ -0,0 +1,9 @@ +# C# practice exercises + +Practice Exercises are exercises that help one dig a bit deeper into concepts that one has learnt through Concept Exercises. + +## To do + +Currently, we're not actively working on building practice exercises. This will change once the [concept exercises][exercises-concept] have been built. + +[exercises-concept]: ../concept/README.md diff --git a/languages/csharp/info/floating_point_numbers.md b/languages/csharp/info/floating_point_numbers.md deleted file mode 100644 index 5f9cec3144..0000000000 --- a/languages/csharp/info/floating_point_numbers.md +++ /dev/null @@ -1,13 +0,0 @@ -# Floating-point numbers - -A floating-point number is a number with zero or more digits behind the decimal separator. Examples are `-2.4`, `0.1`, `3.14`, `16.984025` and `1024.0`. - -Different floating-point types can store different numbers of digits after the digit separator - this is referred to as its precision. - -C# has three floating point types: - -- `float`: 4 bytes (~6-9 digits precision). Written as `2.45f`. -- `double`: 8 bytes (~15-17 digits precision). This is the most common type. Written as `2.45` or `2.45d`. -- `decimal`: 16 bytes (28-29 digits precision). Normally used when working with monetary data, as its precision leads to less rounding errors. Written as `2.45m`. - -As can be seen, each type can store a different number of digits. This means that trying to store PI in a `float` will only store the first 6 to 9 digits (with the last digit being rounded). diff --git a/languages/csharp/info/namespaces.md b/languages/csharp/info/namespaces.md deleted file mode 100644 index ec96055863..0000000000 --- a/languages/csharp/info/namespaces.md +++ /dev/null @@ -1,23 +0,0 @@ -# Namespaces - -Namespaces in C# have two primary functions: - -1. Organizing classes. -1. Control scoping of classes. - -## Types in a namespace - -Types are uniquely identified by their name in combination with their namespace. This is referred to as their _full name_, defined as: `.`. - -By default, types within the same namespace can be referred to by just their name. To refer to types in a different namespace, one has to either: - -- Use the type's full name. -- Import the type's namespace through the [`using` keyword][csharp-keyword-using]. - -[csharp-keyword-using]: ../keywords/using.md - -## Resources - -- See [this page][docs.microsoft.com-namespaces] for more information on namespaces. - -[docs.microsoft.com-namespaces]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/namespaces/ diff --git a/languages/csharp/info/ref_struct.md b/languages/csharp/info/ref_struct.md deleted file mode 100644 index 7a9ef2852a..0000000000 --- a/languages/csharp/info/ref_struct.md +++ /dev/null @@ -1,12 +0,0 @@ -# Ref struct - -A `ref struct` is a [struct][csharp-types-struct] that will always be [allocated on the stack][csharp-info-memory_allocation]. It has the following properties: - -- Represents a sequential struct layout. -- Can be used stack-only. i.e. method parameters and local variables. -- Cannot be static or instance members of a class or normal struct. -- Cannot be method parameter of async methods or lambda expressions. -- Cannot be dynamic binding, boxing, unboxing, wrapping or converting. - -[csharp-types-struct]: ../types/struct.md -[csharp-info-memory_allocation]: ./memory_allocation.md diff --git a/languages/csharp/info/reference_types.md b/languages/csharp/info/reference_types.md deleted file mode 100644 index 2888d5013a..0000000000 --- a/languages/csharp/info/reference_types.md +++ /dev/null @@ -1,9 +0,0 @@ -# Reference types - -Variables of reference types store references to their data (objects). With reference types, two variables can reference the same object; therefore, operations on one variable can affect the object referenced by the other variable. Similarly, methods with reference type parameters also get passed references of objects. - -## Resources - -- See [this page][docs.microsoft.com_reference-types] for more information on reference types. - -[docs.microsoft.com_reference-types]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types diff --git a/languages/csharp/info/type_aliases.md b/languages/csharp/info/type_aliases.md deleted file mode 100644 index b364665537..0000000000 --- a/languages/csharp/info/type_aliases.md +++ /dev/null @@ -1,36 +0,0 @@ -# Type aliases - -C# runs on the .NET framework, which has a set of built-in types you can use from C#. To make using these BCL types easier, C# has defined type aliases for the most common BCL types: - -| C# type | .NET type | -| --------- | ---------------- | -| `bool` | `System.Boolean` | -| `byte` | `System.Byte` | -| `sbyte` | `System.SByte` | -| `char` | `System.Char` | -| `decimal` | `System.Decimal` | -| `double` | `System.Double` | -| `float` | `System.Single` | -| `int` | `System.Int32` | -| `uint` | `System.UInt32` | -| `long` | `System.Int64` | -| `ulong` | `System.UInt64` | -| `object` | `System.Object` | -| `short` | `System.Int16` | -| `ushort` | `System.UInt16` | -| `string` | `System.String` | - -For more information, see the [built-in types table][docs.microsoft.com_built-in-types-table]. - -## Which type to use? - -The general consensus is to prefer the C# type over the .NET type. Here are some examples where this prefererence shows: - -- The default [C# editorconfig settings][docs.microsoft.com_editorconfig-language-keywords]. -- The [ReSharper built-in type naming rule][jetbrains.com_built-in-type-naming]. -- The [CoreFX coding style document][github.com_corefx-coding-style]. - -[docs.microsoft.com_built-in-types-table]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table -[docs.microsoft.com_editorconfig-language-keywords]: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#language-keywords -[github.com_corefx-coding-style]: https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md -[jetbrains.com_built-in-type-naming]: https://www.jetbrains.com/help/resharper/Built_In_Type_Naming.html diff --git a/languages/csharp/info/value_types.md b/languages/csharp/info/value_types.md deleted file mode 100644 index 72ccff1f6c..0000000000 --- a/languages/csharp/info/value_types.md +++ /dev/null @@ -1,9 +0,0 @@ -# Value types - -A variable of a value type contains a value of the type. When you assign a new value to a variable of a value type, that value is copied. Similarly, methods with value type parameters also get passed copies of values. - -## Resources - -- See [this page][docs.microsoft.com_value-types] for more information on value types. - -[docs.microsoft.com_value-types]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value-types diff --git a/languages/csharp/keywords/stackalloc.md b/languages/csharp/keywords/stackalloc.md deleted file mode 100644 index 24bbf97fb8..0000000000 --- a/languages/csharp/keywords/stackalloc.md +++ /dev/null @@ -1,5 +0,0 @@ -# `stackalloc` - -The `stackalloc` operator allows allocating a piece of memory on the stack. The allocated memory is automatically deallocated when the method it is used in returns. - -[docs.microsoft.com_stackalloc]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/stackalloc diff --git a/languages/csharp/keywords/using.md b/languages/csharp/keywords/using.md deleted file mode 100644 index 0a3234695f..0000000000 --- a/languages/csharp/keywords/using.md +++ /dev/null @@ -1,20 +0,0 @@ -# `using` - -## Using statement - -The `using` keyword can be used to define a scope after which a resource will be automatically disposed. - -## Using directive - -The `using` keyword can be used to import a [`namespace`][csharp-info-namespaces]. When using types from imported namespaces, these na don't require (unless there is ambiguity due to types with the same name). - -## Using static directive - -Import members of a single class. - -## Resources - -- See the official [`using` keyword documentation][docs.microsoft.com_keywords-using]. - -[csharp-info-namespaces]: ../info/namespaces.md -[docs.microsoft.com_keywords-using]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using diff --git a/languages/csharp/maintainers.md b/languages/csharp/maintainers.md new file mode 100644 index 0000000000..3b3496d6e2 --- /dev/null +++ b/languages/csharp/maintainers.md @@ -0,0 +1,12 @@ +# C# Maintainers + +These awesome people help maintain the C# track. + +## Senior Maintainers + +- ErikSchierboom (@ErikSchierboom on Slack) +- robkeim (@Rob Keim on Slack) + +## Contributing Maintainers + +None yet. diff --git a/languages/csharp/reference/README.md b/languages/csharp/reference/README.md new file mode 100644 index 0000000000..1f26b740dc --- /dev/null +++ b/languages/csharp/reference/README.md @@ -0,0 +1,159 @@ +# C# reference + +## Concepts + +The C# concept exercises are based on concepts. The list below contains the concepts that have been identified for the C# language. + +### Object-oriented + +The core OO features a C# developer should know about are: + +- [Encapsulation](../../../reference/concepts/encapsulation.md) +- [Classes](../../../reference/concepts/classes.md) +- [Objects](../../../reference/concepts/objects.md) +- [State](../../../reference/concepts/state.md) +- [Mutation](../../../reference/concepts/mutation.md) +- [Composition](../../../reference/concepts/composition.md) +- [Inheritance](../../../reference/concepts/inheritance.md) +- [Interfaces](../../../reference/concepts/interfaces.md) +- [Polymorphism](../../../reference/concepts/polymorphism.md) +- [Methods](../../../reference/concepts/methods.md) + +### Functional + +While C# is primarily an OO language, lots of functional concepts have been added to the language: + +- [Immutability](../../../reference/concepts/immutability.md) +- [Pattern matching](../../../reference/concepts/pattern_matching.md) +- [Higher-order functions](../../../reference/concepts/higher_order_functions.md) +- [Type inference](../../../reference/concepts/type_inference.md) +- [Anonymous methods](../../../reference/concepts/anonymous_functions.md) +- [Recursion](../../../reference/concepts/recursion.md) +- [Local functions](../../../reference/concepts/nested_functions.md) +- [Pipelines (LINQ)](../../../reference/concepts/pipelines.md) + +### Platform-specific + +- [Assemblies](../../../reference/tooling/dotnet-assemblies.md) + +### Memory management + +- Resource passing +- [Resource allocation](./memory_allocation.md) (can include `Span`/`Memory` types) +- Resource cleanup +- Resource lifetime + +### Methods + +- Method overloading +- Named arguments +- Optional arguments +- Extension methods (mixin) + +### General + +- Arithmetic overflow +- [Sameness](../../../reference/concepts/sameness.md) +- [Conditionals](../../../reference/concepts/conditionals.md) +- [Enumeration](../../../reference/concepts/enumeration.md) +- Iterators (yield) +- Namespaces +- [Generics](../../../reference/concepts/generics.md) +- Exception handling +- Implicit/explicit conversion +- Boxing/unboxing +- Anonymous types +- Concurrency (can include concurrent collections) +- Asynchronous programming +- Expressions vs statements +- Attributes +- Slicing +- Unsafe code +- Reflection +- Nullability + +### Types + +- Signed integers +- Unsigned integers +- Floating point numbers +- [Strings][string] +- Enums +- [Characters][char] +- [Booleans][bool] +- [Arrays][array] +- [Lists][list] +- [Dictionaries][map] +- [Sets][set] +- [Queues][queue] +- [Stacks][stack] +- [Tuples][tuple] +- [Ranges][range] +- Indexes +- Events + +## Concept interpretation + +The concept exercises use the following concepts: + +| concept | interpretation | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `basic-numbers` | Know of the existence of the two most commonly used number types, `int` and `double`, and understand that the former represents whole numbers, and the latter floating-point numbers. Know of basic operators such as multiplication and comparison. Know where it's documented, or at least how to search for it. | +| `basic-strings` | Know of the existence of the `string` type. Know of some basic functions (like looking up a character at a position, or slicing the string). Know how to do basic string formatting. Know where it's documented, or at least how to search for it. | +| `basic-dates` | Know of the existence of the `DateTime` type. Know of the individual, date-related properties. Know how to access the current date. Know how to compare dates. Know how to convert a `string` to a `DateTime` and vice versa. Know where it's documented, or at least how to search for it | +| `basic-enums` | Know of the existence of the `enum` keyword. Know how to define enum members. Know how to convert a `string` to an `enum` and vice versa. Know where it's documented, or at least how to search for it | +| `advanced-enums` | Know how to define a "flags" enum. Know how to add, remove or check for flags. | +| `basic-time` | Know of the existence of the `DateTime` type. Know of the individual, time-related properties. Know where it's documented, or at least how to search for it. | +| `basic-type-conversion` | Know that it is sometimes possible to convert from one type to another type. | +| `conditionals` | Know of the existence of conditional execution statements (such as the `if` statement). | +| `floating-point-numbers` | Know of the existing of the three floating point types: `double`, `float` and `decimal`. Know when to use which type. | +| `string-formatting` | Know how to format a string. Know where it's documented, or at least how to search for it. | +| `bitwise-operations` | Know how to apply bitwise operations to numbers. Know where it's documented, or at least how to search for it. | + +This also indicates that for example `basic-strings` does **not** teach using custom formatting strings and that `basic-numbers` does **not** teach about checked/unchecked arithmetic. + +## Reference docs + +Reference docs are written to help explain a particular C# concept to a student when no appropriate online document can be found. They will be used when creating exercises and as references in exercise documentation. + +The following reference docs have been written: + +- [Code style][code_style] +- [Memory allocation][memory_allocation] + +## TODO + +- Reference doc on difference between `static readonly` and `const` + +[issues-improve-reference]: https://github.com/exercism/v3/issues?q=is%3Aissue+is%3Aopen+label%3Atrack%2Fcsharp+label%3Atype%2Fimprove-reference+label%3Astatus%2Fhelp-wanted +[issues-new-reference]: https://github.com/exercism/v3/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Atrack%2Fcsharp+label%3Atype%2Fnew-reference+label%3Astatus%2Fhelp-wanted+ +[code_style]: ./code_style.md +[memory_allocation]: ./memory_allocation.md +[bool]: ../../../reference/types/boolean.md +[string]: ../../../reference/types/string.md +[char]: ../../../reference/types/char.md +[null]: ../../../reference/types/null.md +[int]: ../../../reference/types/integer.md +[uint]: ../../../reference/types/integer.md +[byte]: ../../../reference/types/byte.md +[sbyte]: ../../../reference/types/byte.md +[short]: ../../../reference/types/short.md +[ushort]: ../../../reference/types/short.md +[long]: ../../../reference/types/long.md +[ulong]: ../../../reference/types/long.md +[double]: ../../../reference/types/double.md +[float]: ../../../reference/types/single.md +[decimal]: ../../../reference/types/decimal_number.md +[big-integer]: ../../../reference/types/big_integer.md +[array]: ../../../reference/types/array.md +[list]: ../../../reference/types/list.md +[map]: ../../../reference/types/map.md +[set]: ../../../reference/types/set.md +[stack]: ../../../reference/types/stack.md +[queue]: ../../../reference/types/deque.md +[class]: ../../../reference/types/class.md +[struct]: ../../../reference/types/struct.md +[value-tuple]: ../../../reference/types/tuple.md +[tuple]: ../../../reference/types/tuple.md +[range]: ../../../reference/types/range.md +[nullable]: ../../../reference/types/nullable.md diff --git a/languages/csharp/reference/_sidebar.md b/languages/csharp/reference/_sidebar.md new file mode 100644 index 0000000000..ef5a706676 --- /dev/null +++ b/languages/csharp/reference/_sidebar.md @@ -0,0 +1,14 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) + - [C#](/languages/csharp/README.md) + - [Docs](/languages/csharp/docs/README.md) + - [Exercises](/languages/csharp/exercises/README.md) + - [Reference](/languages/csharp/reference/README.md) + - [Code style](/languages/csharp/reference/code_style.md) + - [Memory allocation](/languages/csharp/reference/memory_allocation.md) +- Reference + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/languages/csharp/info/code_style.md b/languages/csharp/reference/code_style.md similarity index 78% rename from languages/csharp/info/code_style.md rename to languages/csharp/reference/code_style.md index 1ebe5c36ba..eb2e1d2096 100644 --- a/languages/csharp/info/code_style.md +++ b/languages/csharp/reference/code_style.md @@ -15,6 +15,16 @@ Broadly speaking, the C# naming conventions are as follows: These conventions are described in the [.NET capitalization conventions][docs.microsoft.com_capitalization-conventions] and the [.NET general naming conventions][docs.microsoft.com_general-naming-conventions]. +## Other conventions + +### Prefer type alias + +The general consensus is to prefer the C# type over the .NET type. Here are some examples where this prefererence shows: + +- The default [C# editorconfig settings][docs.microsoft.com_editorconfig-language-keywords]. +- The [ReSharper built-in type naming rule][jetbrains.com_built-in-type-naming]. +- The [CoreFX coding style document][github.com_corefx-coding-style]. + ## Enforcing code style It is possible to encode C# coding style conventions using [`.editorconfig files`][docs.microsoft.com_editorconfig]. This includes being able to specify [formatting conventions][docs.microsoft.com_editorconfig-formatting-conventions] and [naming conventions][docs.microsoft.com_editorconfig-naming-conventions]. @@ -34,3 +44,6 @@ The [dotnet format global tool][github.com_dotnet-format-editorconfig-options] c [github.com_dotnet-format]: https://github.com/dotnet/format/blob/master/README.md [github.com_dotnet-format-editorconfig-options]: https://github.com/dotnet/format/wiki/Supported-.editorconfig-options [github.com_dotnet-format-how-to]: https://github.com/dotnet/format/blob/master/README.md#how-to-install +[docs.microsoft.com_editorconfig-language-keywords]: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#language-keywords +[github.com_corefx-coding-style]: https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md +[jetbrains.com_built-in-type-naming]: https://www.jetbrains.com/help/resharper/Built_In_Type_Naming.html diff --git a/languages/csharp/info/memory_allocation.md b/languages/csharp/reference/memory_allocation.md similarity index 85% rename from languages/csharp/info/memory_allocation.md rename to languages/csharp/reference/memory_allocation.md index e50830f417..81e4fbe7f4 100644 --- a/languages/csharp/info/memory_allocation.md +++ b/languages/csharp/reference/memory_allocation.md @@ -13,7 +13,7 @@ The heap is long-lived and has lots of memory available. When an object is alloc ## What goes where? -In principle, [value types][csharp-value_types] are allocated on the stack and [reference types][csharp-reference_types] on the heap. There are some exceptions to this, for example when a value type is part of a reference type (e.g. a class with an `int` field). +In principle, value types are allocated on the stack and reference types on the heap. There are some exceptions to this, for example when a value type is part of a reference type (e.g. a class with an `int` field). ## Resources @@ -22,8 +22,6 @@ In principle, [value types][csharp-value_types] are allocated on the stack and [ - [Jon skeet on C# memory allocation][jonskeet.uk_memory] - [Pro .NET memory management (book)][pro-dotnet-memory] -[csharp-value_types]: ./value_types.md -[csharp-reference_types]: ./reference_types.md [docs.microsoft.com_garbage-collection-fundamentals]: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals [jonskeet.uk_memory]: https://jonskeet.uk/csharp/memory.html [jetbrains.com_memory-management-concepts]: https://www.jetbrains.com/help/dotmemory/NET_Memory_Management_Concepts.html diff --git a/languages/csharp/types/array.md b/languages/csharp/types/array.md deleted file mode 100644 index af33cd2927..0000000000 --- a/languages/csharp/types/array.md +++ /dev/null @@ -1,7 +0,0 @@ -# `Array` - -> This is a stub - -See the general [`array` type][general-type-array]. - -[general-type-array]: ../../../types/array.md diff --git a/languages/csharp/types/biginteger.md b/languages/csharp/types/biginteger.md deleted file mode 100644 index 7af8309b83..0000000000 --- a/languages/csharp/types/biginteger.md +++ /dev/null @@ -1,7 +0,0 @@ -# `BigInteger` - -> This is a stub - -See the general [`bigint` type][general-type-bigint]. - -[general-type-bigint]: ../../../types/big_integer.md diff --git a/languages/csharp/types/bool.md b/languages/csharp/types/bool.md deleted file mode 100644 index f49bab4e6f..0000000000 --- a/languages/csharp/types/bool.md +++ /dev/null @@ -1,7 +0,0 @@ -# `bool` - -> This is a stub - -See the general [`boolean` type][general-type-boolean]. - -[general-type-boolean]: ../../../types/boolean.md diff --git a/languages/csharp/types/char.md b/languages/csharp/types/char.md deleted file mode 100644 index 85242c0e46..0000000000 --- a/languages/csharp/types/char.md +++ /dev/null @@ -1,8 +0,0 @@ -# `char` - -The `char` type represents a single unicode character (letters, digits, punctuation, etc.). It is a [`struct` type][csharp-type-struct]. - -See the general [`char` type][general-type-char]. - -[csharp-type-struct]: ./struct.md -[general-type-char]: ../../../types/char.md diff --git a/languages/csharp/types/class.md b/languages/csharp/types/class.md deleted file mode 100644 index e65e4929f8..0000000000 --- a/languages/csharp/types/class.md +++ /dev/null @@ -1,7 +0,0 @@ -# `Class` - -> This is a stub - -See the general [`class` type][general-type-class]. - -[general-type-class]: ../../../types/class.md diff --git a/languages/csharp/types/datetime.md b/languages/csharp/types/datetime.md deleted file mode 100644 index 2f68a17e21..0000000000 --- a/languages/csharp/types/datetime.md +++ /dev/null @@ -1,7 +0,0 @@ -# `DateTime` - -The `DateTime` type is contains both [date][general-type-date] and [time][general-type-time] information. - -[csharp-type-timespan]: ./timespan.md -[general-type-date]: ../../../types/date.md -[general-type-time]: ../../../types/time.md diff --git a/languages/csharp/types/enum.md b/languages/csharp/types/enum.md deleted file mode 100644 index dbdd2e0941..0000000000 --- a/languages/csharp/types/enum.md +++ /dev/null @@ -1,3 +0,0 @@ -# `enum` - -The C# `enum` type represents a fixed set of named constants (an enumeration). Its chief purpose is to provide a type-safe way of interacting with numeric constants, limiting the available values to a pre-defined set. diff --git a/languages/csharp/types/string.md b/languages/csharp/types/string.md deleted file mode 100644 index d91c83cae7..0000000000 --- a/languages/csharp/types/string.md +++ /dev/null @@ -1,7 +0,0 @@ -# `string` - -A `string` in C# is a sequence of Unicode characters (letters, digits, punctuation, etc.). - -See the general [`string` type][general-type-string]. - -[general-type-string]: ../../../types/string.md diff --git a/languages/csharp/types/struct.md b/languages/csharp/types/struct.md deleted file mode 100644 index 8f80c2db61..0000000000 --- a/languages/csharp/types/struct.md +++ /dev/null @@ -1,14 +0,0 @@ -# `Struct` - -A `struct` type is a [value type][csharp-info-value_types] that is typically used to encapsulate small groups of related variables. - -All simple types are structs: - -- Integral types: integer numeric types and the [`char` type][csharp-type-char] -- [Floating-point types][csharp-info-floating_point_numbers] -- [`bool`][csharp-type-bool] - -[csharp-info-value_types]: ../info/value_types.md -[csharp-info-floating_point_numbers]: ../info/floating_point_numbers.md -[csharp-type-bool]: ./bool.md -[csharp-type-char]: ./char.md diff --git a/languages/csharp/types/timespan.md b/languages/csharp/types/timespan.md deleted file mode 100644 index 5d37fa7a34..0000000000 --- a/languages/csharp/types/timespan.md +++ /dev/null @@ -1,5 +0,0 @@ -# `TimeSpan` - -The `TimeSpan` type represents a span of [time][general-type-time]. - -[general-type-time]: ../../../types/time.md diff --git a/languages/dart/README.md b/languages/dart/README.md index b9cb118d4c..9317471cde 100644 --- a/languages/dart/README.md +++ b/languages/dart/README.md @@ -18,12 +18,12 @@ - [`object`][type-object]. -[type-boolean]: ../../types/boolean.md -[type-function]: ../../types/function.md -[type-number]: ../../types/number.md -[type-object]: ../../types/object.md -[type-string]: ../../types/string.md -[type-symbol]: ../../types/symbol.md +[type-boolean]: ../../reference/types/boolean.md +[type-function]: ../../reference/types/function.md +[type-number]: ../../reference/types/number.md +[type-object]: ../../reference/types/object.md +[type-string]: ../../reference/types/string.md +[type-symbol]: ../../reference/types/symbol.md ## Expressions @@ -50,22 +50,22 @@ - [Type casting][concept-type-casting] (see also [type inference][concept-type-inference]) - [Variables][concept-variables] -[concept-arithmetic]: ../../concepts/arithmetic.md -[concept-bitwise-manipulation]: ../../concepts/bitwise_manipulation.md -[concept-boolean-logic]: ../../concepts/boolean_logic.md -[concept-comments]: ../../concepts/comments.md -[concept-conditionals]: ../../concepts/conditionals.md -[concept-destructuring]: ../../concepts/destructuring.md -[concept-destructuring-assignment]: ../../concepts/destructuring_assignment.md -[concept-duck-typing]: ../../concepts/duck_typing.md -[concept-enumeration]: ../../concepts/enumeration.md -[concept-functions]: ../../concepts/functions.md -[concept-loops]: ../../concepts/loops.md -[concept-methods]: ../../concepts/methods.md -[concept-rest-parameters]: ../../concepts/rest_parameters.md -[concept-scope]: ../../concepts/scope.md -[concept-type-casting]: ../../concepts/type_casting.md -[concept-variables]: ../../concepts/variables.md +[concept-arithmetic]: ../../reference/concepts/arithmetic.md +[concept-bitwise-manipulation]: ../../reference/concepts/bitwise_manipulation.md +[concept-boolean-logic]: ../../reference/concepts/boolean_logic.md +[concept-comments]: ../../reference/concepts/comments.md +[concept-conditionals]: ../../reference/concepts/conditionals.md +[concept-destructuring]: ../../reference/concepts/destructuring.md +[concept-destructuring-assignment]: ../../reference/concepts/destructuring_assignment.md +[concept-duck-typing]: ../../reference/concepts/duck_typing.md +[concept-enumeration]: ../../reference/concepts/enumeration.md +[concept-functions]: ../../reference/concepts/functions.md +[concept-loops]: ../../reference/concepts/loops.md +[concept-methods]: ../../reference/concepts/methods.md +[concept-rest-parameters]: ../../reference/concepts/rest_parameters.md +[concept-scope]: ../../reference/concepts/scope.md +[concept-type-casting]: ../../reference/concepts/type_casting.md +[concept-variables]: ../../reference/concepts/variables.md ### Object-oriented @@ -78,14 +78,14 @@ - [Polymorphism][concept-polymorphism] (see also [duck-typing][concept-duck-typing]) - [State][concept-state] -[concept-classes]: ../../concepts/classes.md -[concept-composition]: ../../concepts/composition.md -[concept-encapsulation]: ../../concepts/encapsulation.md -[concept-inheritance]: ../../concepts/inheritance.md -[concept-mutation]: ../../concepts/mutation.md -[concept-objects]: ../../concepts/objects.md -[concept-polymorphism]: ../../concepts/polymorphism.md -[concept-state]: ../../concepts/state.md +[concept-classes]: ../../reference/concepts/classes.md +[concept-composition]: ../../reference/concepts/composition.md +[concept-encapsulation]: ../../reference/concepts/encapsulation.md +[concept-inheritance]: ../../reference/concepts/inheritance.md +[concept-mutation]: ../../reference/concepts/mutation.md +[concept-objects]: ../../reference/concepts/objects.md +[concept-polymorphism]: ../../reference/concepts/polymorphism.md +[concept-state]: ../../reference/concepts/state.md ### Functional @@ -98,14 +98,14 @@ - [Recursion][concept-recursion] - [Type inference][concept-type-inference] -[concept-anonymous-functions]: ../../concepts/anonymous_functions.md -[concept-higher-order-functions]: ../../concepts/higher_order_functions.md -[concept-immutable]: ../../concepts/immutability.md -[concept-nested-functions]: ../../concepts/nested_functions.md -[concept-partial-application]: ../../concepts/partial_application.md -[concept-pure-functions]: ../../concepts/pure_functions.md -[concept-recursion]: ../../concepts/recursion.md -[concept-type-inference]: ../../concepts/type_inference.md +[concept-anonymous-functions]: ../../reference/concepts/anonymous_functions.md +[concept-higher-order-functions]: ../../reference/concepts/higher_order_functions.md +[concept-immutable]: ../../reference/concepts/immutability.md +[concept-nested-functions]: ../../reference/concepts/nested_functions.md +[concept-partial-application]: ../../reference/concepts/partial_application.md +[concept-pure-functions]: ../../reference/concepts/pure_functions.md +[concept-recursion]: ../../reference/concepts/recursion.md +[concept-type-inference]: ../../reference/concepts/type_inference.md ### Language specific concepts @@ -116,7 +116,7 @@ - [Generators][concept-generators] - Package Management -[concept-concurrency]: ../../concepts/concurrency.md +[concept-concurrency]: ../../reference/concepts/concurrency.md [concept-generators]: ../../languages/dart/info/generators.md [keyword-async]: ./keywords/async.md [keyword-await]: ./keywords/await.md diff --git a/languages/dart/keywords/async.md b/languages/dart/keywords/async.md index b88b6b98f6..7a8a4e5459 100644 --- a/languages/dart/keywords/async.md +++ b/languages/dart/keywords/async.md @@ -5,4 +5,4 @@ Marks a [function][concept-functions] to be asynchronous function; an asynchrono See [concurrency][concept-concurrency]. [concept-concurrency]: ../info/concurrency.md -[concept-functions]: ../../../concepts/functions.md +[concept-functions]: ../../../reference/concepts/functions.md diff --git a/languages/dart/keywords/await.md b/languages/dart/keywords/await.md index 99805c2f4f..3d0b983266 100644 --- a/languages/dart/keywords/await.md +++ b/languages/dart/keywords/await.md @@ -5,5 +5,5 @@ The `await` operator is used to wait for a `Future`. It can only be used inside See [concurrency][concept-concurrency]. [concept-concurrency]: ../info/concurrency.md -[concept-functions]: ../../../concepts/functions.md +[concept-functions]: ../../../reference/concepts/functions.md [keyword-async]: ./async.md diff --git a/languages/dart/keywords/function.md b/languages/dart/keywords/function.md index 18cf533cba..ec1c811bb1 100644 --- a/languages/dart/keywords/function.md +++ b/languages/dart/keywords/function.md @@ -20,6 +20,5 @@ function greet(name) { } ``` -[concept-scope]: ../../../concepts/scope.md -[concept-expressions]: ../../../concepts/expressions.md -[concept-functions]: ../../../concepts/functions.md +[concept-expressions]: ../../../reference/concepts/expressions.md +[concept-functions]: ../../../reference/concepts/functions.md diff --git a/languages/dart/types/bool.md b/languages/dart/types/bool.md index a6f79ecb38..ac60fe962c 100644 --- a/languages/dart/types/bool.md +++ b/languages/dart/types/bool.md @@ -2,4 +2,4 @@ > This is a stub -[type-boolean]: ../../../types/boolean.md +[type-boolean]: ../../../reference/types/boolean.md diff --git a/languages/dart/types/error.md b/languages/dart/types/error.md index b59815ae6f..901f8f2345 100644 --- a/languages/dart/types/error.md +++ b/languages/dart/types/error.md @@ -4,4 +4,4 @@ See the general [`error` type][type-error]. -[type-error]: ../../../types/error.md +[type-error]: ../../../reference/types/error.md diff --git a/languages/dart/types/function.md b/languages/dart/types/function.md index b52457082b..b417f23536 100644 --- a/languages/dart/types/function.md +++ b/languages/dart/types/function.md @@ -2,4 +2,4 @@ > This is a stub -[type-function]: ../../../types/function.md +[type-function]: ../../../reference/types/function.md diff --git a/languages/dart/types/map.md b/languages/dart/types/map.md index d8653d08dd..5a62ac681e 100644 --- a/languages/dart/types/map.md +++ b/languages/dart/types/map.md @@ -2,4 +2,4 @@ > This is a stub -[type-map]: ../../../types/map.md +[type-map]: ../../../reference/types/map.md diff --git a/languages/dart/types/number.md b/languages/dart/types/number.md index 4f2327a0bb..c373ab306c 100644 --- a/languages/dart/types/number.md +++ b/languages/dart/types/number.md @@ -2,5 +2,5 @@ > This is a stub -[type-number]: ../../../types/number.md -[type-object]: ../../../types/object.md +[type-number]: ../../../reference/types/number.md +[type-object]: ../../../reference/types/object.md diff --git a/languages/dart/types/regexp.md b/languages/dart/types/regexp.md index e58653755d..39cc514850 100644 --- a/languages/dart/types/regexp.md +++ b/languages/dart/types/regexp.md @@ -3,4 +3,4 @@ > This is a stub [concept-prototype-inheritance]: ../../../languages/dart/info/prototype_inheritance.md -[type-regexp]: ../../../types/regular_expression.md +[type-regexp]: ../../../reference/types/regular_expression.md diff --git a/languages/dart/types/set.md b/languages/dart/types/set.md index fe1543b059..ab94480c93 100644 --- a/languages/dart/types/set.md +++ b/languages/dart/types/set.md @@ -2,4 +2,4 @@ > This is a stub -[type-set]: ../../../types/set.md +[type-set]: ../../../reference/types/set.md diff --git a/languages/dart/types/string.md b/languages/dart/types/string.md index b7720c8346..d2884aba6d 100644 --- a/languages/dart/types/string.md +++ b/languages/dart/types/string.md @@ -4,4 +4,4 @@ The `String` global object is a constructor for a character or a sequence of characters. -[type-string]: ../../../types/string.md +[type-string]: ../../../reference/types/string.md diff --git a/languages/dart/types/symbol.md b/languages/dart/types/symbol.md index 1e5a0b289a..0167f0f031 100644 --- a/languages/dart/types/symbol.md +++ b/languages/dart/types/symbol.md @@ -2,4 +2,4 @@ > This is a stub -[type-symbol]: ../../../types/symbol.md +[type-symbol]: ../../../reference/types/symbol.md diff --git a/languages/fsharp/README.md b/languages/fsharp/README.md index ba1b7f70cc..c1404b820a 100644 --- a/languages/fsharp/README.md +++ b/languages/fsharp/README.md @@ -22,19 +22,19 @@ These are concepts that, as far as I know, are either unique to F# or shared wit Thinking as an F# developer means knowing about how to use the following functional programming concepts in F# (as F# is, after all, a functional-first language): -- [Immutability](../../concepts/immutability.md) -- [Pattern matching](../../concepts/pattern_matching.md) -- [Function composition](../../concepts/function_composition.md) -- [Pure functions](../../concepts/pure_functions.md) -- [Higher-order functions](../../concepts/higher_order_functions.md) -- [Nested functions](../../concepts/nested_functions.md) -- [Anonymous functions](../../concepts/anonymous_functions.md) -- [Partial application](../../concepts/partial_application.md) -- [Type inference](../../concepts/type_inference.md) -- [Expression-oriented (not statement oriented)](../../concepts/expression_oriented.md) -- [Recursion (and tail-recursion)](../../concepts/recursion.md) -- [Pipelines (for, while, map, filter, reduce)](../../concepts/pipelines.md) -- [REPL](../../concepts/repl.md) +- [Immutability](../../reference/concepts/immutability.md) +- [Pattern matching](../../reference/concepts/pattern_matching.md) +- [Function composition](../../reference/concepts/function_composition.md) +- [Pure functions](../../reference/concepts/pure_functions.md) +- [Higher-order functions](../../reference/concepts/higher_order_functions.md) +- [Nested functions](../../reference/concepts/nested_functions.md) +- [Anonymous functions](../../reference/concepts/anonymous_functions.md) +- [Partial application](../../reference/concepts/partial_application.md) +- [Type inference](../../reference/concepts/type_inference.md) +- [Expression-oriented (not statement oriented)](../../reference/concepts/expression_oriented.md) +- [Recursion (and tail-recursion)](../../reference/concepts/recursion.md) +- [Pipelines (for, while, map, filter, reduce)](../../reference/concepts/pipelines.md) +- [REPL](../../reference/concepts/repl.md) - Railway-oriented programming (not a language feature, but a common way of dealing with chaining error states) - Monads - Currying @@ -44,10 +44,10 @@ Thinking as an F# developer means knowing about how to use the following functio While F# is "functional first" language, it does have (very nice) object-orientation features. It is important to know how and when to apply the OO features, and which OO features (see https://youtu.be/yL7xBhWrdKw?t=2248) to use. The core OO features an F# developer should know about are: -- [Classes](../../concepts/classes.md) -- [Interfaces](../../concepts/interfaces.md) -- [State](../../concepts/state.md) -- [Mutation](../../concepts/mutation.md) +- [Classes](../../reference/concepts/classes.md) +- [Interfaces](../../reference/concepts/interfaces.md) +- [State](../../reference/concepts/state.md) +- [Mutation](../../reference/concepts/mutation.md) - Dot notation (instead of using functions to access data) - Static/non-static members - Named arguments @@ -60,7 +60,7 @@ Note that some of these features are specific to object-orientation in the world ## Platform-specific concepts - .NET interop (how to integrate with other .NET libraries, which are mostly written in C#. good interop was key in the F# design!) -- [Assemblies](../../tooling/dotnet-assemblies.md) +- [Assemblies](../../reference/tooling/dotnet-assemblies.md) ## General concepts @@ -68,7 +68,7 @@ Note that some of these features are specific to object-orientation in the world - Scoping through indentation (whitespace significant) - Ranges - Slicing (linked to ranges) -- [Generics](../../concepts/generics.md) +- [Generics](../../reference/concepts/generics.md) - Modules - Namespaces - Attributes @@ -92,7 +92,7 @@ Note that some of these features are specific to object-orientation in the world - Array - List - Map -- [Set](../../types/set.md) +- [Set](../../reference/types/set.md) - Sequence - Anonymous records - Events diff --git a/languages/go/README.md b/languages/go/README.md index 4304e3bd5e..7ec0dcddf0 100644 --- a/languages/go/README.md +++ b/languages/go/README.md @@ -22,30 +22,30 @@ ## General concepts -- [Arithmetic](../../concepts/arithmetic.md) -- [Bitwise manipulation](../../concepts/bitwise_manipulation.md) -- [Boolean logic](../../concepts/boolean_logic.md) +- [Arithmetic](../../reference/concepts/arithmetic.md) +- [Bitwise manipulation](../../reference/concepts/bitwise_manipulation.md) +- [Boolean logic](../../reference/concepts/boolean_logic.md) - Channels - Code Formatting -- [Comments](../../concepts/comments.md) +- [Comments](../../reference/concepts/comments.md) - Concurrency -- [Conditionals](../../concepts/conditionals.md) +- [Conditionals](../../reference/concepts/conditionals.md) - Defer - Errors and Error Handling -- [Functions](../../concepts/functions.md) -- [Loops](../../concepts/loops.md) -- [Methods](../../concepts/methods.md) +- [Functions](../../reference/concepts/functions.md) +- [Loops](../../reference/concepts/loops.md) +- [Methods](../../reference/concepts/methods.md) - Modules -- [Mutexes](../../concepts/locking.md) +- [Mutexes](../../reference/concepts/locking.md) - Packages - Panics - Pointers - Nil - Reflection -- [Scope](../../concepts/scope.md) +- [Scope](../../reference/concepts/scope.md) - Type Switch - Unsafe -- [Variables](../../concepts/variables.md) +- [Variables](../../reference/concepts/variables.md) - Zero Values ## Object-oriented Concepts diff --git a/languages/go/info/structs.md b/languages/go/info/structs.md index 4fcf9d55c6..5dc8820e85 100644 --- a/languages/go/info/structs.md +++ b/languages/go/info/structs.md @@ -1,6 +1,6 @@ # Structs -See also [records](../../../types/record.md) +See also [records](../../../reference/types/record.md) # Classes diff --git a/languages/javascript/README.md b/languages/javascript/README.md index 0fabd1fb76..8c7ae9158b 100644 --- a/languages/javascript/README.md +++ b/languages/javascript/README.md @@ -32,16 +32,16 @@ The wrapper's `valueOf()` method returns the primitive value. Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`][keyword-typeof] [`object`][type-object], and not their primitive type). See [prototype-based inheritance][concept-prototype-inheritance]. -[type-array]: ../../types/array.md -[type-bigint]: ../../types/big_integer.md -[type-boolean]: ../../types/boolean.md -[type-function]: ../../types/function.md -[type-null]: ../../types/null.md -[type-number]: ../../types/number.md -[type-object]: ../../types/object.md -[type-string]: ../../types/string.md -[type-symbol]: ../../types/symbol.md -[type-undefined]: ../../concepts/undefined.md +[type-array]: ../../reference/types/array.md +[type-bigint]: ../../reference/types/big_integer.md +[type-boolean]: ../../reference/types/boolean.md +[type-function]: ../../reference/types/function.md +[type-null]: ../../reference/types/null.md +[type-number]: ../../reference/types/number.md +[type-object]: ../../reference/types/object.md +[type-string]: ../../reference/types/string.md +[type-symbol]: ../../reference/types/symbol.md +[type-undefined]: ../../reference/concepts/undefined.md ## Global Objects (not "types") @@ -100,14 +100,14 @@ Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`] - [Polymorphism][concept-polymorphism] (see also [duck-typing][concept-duck-typing]) - [State][concept-state] -[concept-classes]: ../../concepts/classes.md -[concept-composition]: ../../concepts/composition.md -[concept-encapsulation]: ../../concepts/encapsulation.md -[concept-inheritance]: ../../concepts/inheritance.md -[concept-mutation]: ../../concepts/mutation.md -[concept-objects]: ../../concepts/objects.md -[concept-polymorphism]: ../../concepts/polymorphism.md -[concept-state]: ../../concepts/state.md +[concept-classes]: ../../reference/concepts/classes.md +[concept-composition]: ../../reference/concepts/composition.md +[concept-encapsulation]: ../../reference/concepts/encapsulation.md +[concept-inheritance]: ../../reference/concepts/inheritance.md +[concept-mutation]: ../../reference/concepts/mutation.md +[concept-objects]: ../../reference/concepts/objects.md +[concept-polymorphism]: ../../reference/concepts/polymorphism.md +[concept-state]: ../../reference/concepts/state.md ## Functional concepts @@ -120,14 +120,14 @@ Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`] - [Recursion][concept-recursion] - [Type inference][concept-type-inference] -[concept-anonymous-functions]: ../../concepts/anonymous_functions.md -[concept-higher-order-functions]: ../../concepts/higher_order_functions.md -[concept-immutable]: ../../concepts/immutability.md -[concept-nested-functions]: ../../concepts/nested_functions.md -[concept-partial-application]: ../../concepts/partial_application.md -[concept-pure-functions]: ../../concepts/pure_functions.md -[concept-recursion]: ../../concepts/recursion.md -[concept-type-inference]: ../../concepts/type_inference.md +[concept-anonymous-functions]: ../../reference/concepts/anonymous_functions.md +[concept-higher-order-functions]: ../../reference/concepts/higher_order_functions.md +[concept-immutable]: ../../reference/concepts/immutability.md +[concept-nested-functions]: ../../reference/concepts/nested_functions.md +[concept-partial-application]: ../../reference/concepts/partial_application.md +[concept-pure-functions]: ../../reference/concepts/pure_functions.md +[concept-recursion]: ../../reference/concepts/recursion.md +[concept-type-inference]: ../../reference/concepts/type_inference.md ## General concepts @@ -147,22 +147,22 @@ Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`] - [Type casting][concept-type-casting] (see also [type inference][concept-type-inference]) - [Variables][concept-variables] -[concept-arithmetic]: ../../concepts/arithmetic.md -[concept-bitwise-manipulation]: ../../concepts/bitwise_manipulation.md -[concept-boolean-logic]: ../../concepts/boolean_logic.md -[concept-comments]: ../../concepts/comments.md -[concept-conditionals]: ../../concepts/conditionals.md -[concept-destructuring]: ../../concepts/destructuring.md -[concept-destructuring-assignment]: ../../concepts/destructuring_assignment.md -[concept-duck-typing]: ../../concepts/duck_typing.md -[concept-enumeration]: ../../concepts/enumeration.md -[concept-functions]: ../../concepts/functions.md -[concept-loops]: ../../concepts/loops.md -[concept-methods]: ../../concepts/methods.md -[concept-rest-parameters]: ../../concepts/rest_parameters.md -[concept-scope]: ../../concepts/scope.md -[concept-type-casting]: ../../concepts/type_casting.md -[concept-variables]: ../../concepts/variables.md +[concept-arithmetic]: ../../reference/concepts/arithmetic.md +[concept-bitwise-manipulation]: ../../reference/concepts/bitwise_manipulation.md +[concept-boolean-logic]: ../../reference/concepts/boolean_logic.md +[concept-comments]: ../../reference/concepts/comments.md +[concept-conditionals]: ../../reference/concepts/conditionals.md +[concept-destructuring]: ../../reference/concepts/destructuring.md +[concept-destructuring-assignment]: ../../reference/concepts/destructuring_assignment.md +[concept-duck-typing]: ../../reference/concepts/duck_typing.md +[concept-enumeration]: ../../reference/concepts/enumeration.md +[concept-functions]: ../../reference/concepts/functions.md +[concept-loops]: ../../reference/concepts/loops.md +[concept-methods]: ../../reference/concepts/methods.md +[concept-rest-parameters]: ../../reference/concepts/rest_parameters.md +[concept-scope]: ../../reference/concepts/scope.md +[concept-type-casting]: ../../reference/concepts/type_casting.md +[concept-variables]: ../../reference/concepts/variables.md ## Language specific concepts @@ -185,7 +185,7 @@ Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`] - [Arrays are objects, with indexer][global-object-array] - [Functions are callable objects][global-object-function] -[concept-concurrency]: ../../concepts/concurrency.md +[concept-concurrency]: ../../reference/concepts/concurrency.md [concept-events]: ../../languages/javascript/info/events.md [concept-event-loop]: ../../languages/javascript/info/event_loop.md [concept-generators]: ../../languages/javascript/info/generators.md @@ -203,7 +203,7 @@ Note: Wrapped primitives (using the `new Constructor()` syntax are of [`typeof`] [keyword-instanceof]: ./keywords/instanceof.md [keyword-require]: ./keywords/require.md [keyword-typeof]: ./keywords/typeof.md -[platforms-jsdoc]: ../../tooling/jsdoc.md +[platforms-jsdoc]: ../../reference/tooling/jsdoc.md ## Other important/interesting things diff --git a/languages/javascript/info/falsy.md b/languages/javascript/info/falsy.md index c42d484615..e55e8792bc 100644 --- a/languages/javascript/info/falsy.md +++ b/languages/javascript/info/falsy.md @@ -18,11 +18,11 @@ A falsy value is a value that is considered `false` when encountered in a [Boole | `undefined` | `undefined` - the primitive value | | `NaN` | `NaN` - not a number | -[concept-conditionals]: ../../../concepts/conditionals.md -[concept-loops]: ../../../concepts/loops.md -[concept-type-coercion]: ../../../concepts/type_casting.md +[concept-conditionals]: ../../../reference/concepts/conditionals.md +[concept-loops]: ../../../reference/concepts/loops.md +[concept-type-coercion]: ../../../reference/concepts/type_casting.md [language-javascript]: ../../../languages/javascript/README.md -[type-bigint]: ../../../types/big_integer.md -[type-boolean]: ../../../types/boolean.md -[type-null]: ../../../types/null.md -[type-string]: ../../../types/string.md +[type-bigint]: ../../../reference/types/big_integer.md +[type-boolean]: ../../../reference/types/boolean.md +[type-null]: ../../../reference/types/null.md +[type-string]: ../../../reference/types/string.md diff --git a/languages/javascript/info/global_objects.md b/languages/javascript/info/global_objects.md index 4542aa29e0..9f54f299dd 100644 --- a/languages/javascript/info/global_objects.md +++ b/languages/javascript/info/global_objects.md @@ -110,7 +110,7 @@ These objects represent and interact with structured data buffers and data coded - `Proxy` [concept-prototype-inheritance]: ./prototype_inheritance.md -[concept-scope]: ../../../concepts/scope.md +[concept-scope]: ../../../reference/concepts/scope.md [concept-strict-mode]: ./strict_mode.md [global-object-array]: ../../../languages/javascript/objects/array.md [global-object-boolean]: ../../../languages/javascript/objects/boolean.md @@ -131,5 +131,5 @@ These objects represent and interact with structured data buffers and data coded [global-object-typed-array]: ../../../languages/javascript/objects/typed-array.md [global-object-weakmap]: ../../../languages/javascript/objects/weakmap.md [global-object-weakset]: ../../../languages/javascript/objects/weakset.md -[type-null]: ../../../types/null.md +[type-null]: ../../../reference/types/null.md [type-undefined]: ./undefined.md diff --git a/languages/javascript/info/prototype_inheritance.md b/languages/javascript/info/prototype_inheritance.md index 8eeaa0d4c3..ca72ad427d 100644 --- a/languages/javascript/info/prototype_inheritance.md +++ b/languages/javascript/info/prototype_inheritance.md @@ -15,14 +15,14 @@ JavaScript objects are dynamic "bags" of properties (referred to as "own propert JavaScript does **not** have "methods" in the form that [class][concept-class]-based languages define them. In JavaScript, any [function][type-function] can be added to an object in the form of a property. An inherited function acts just as any other property, including _property shadowing_. -[concept-class]: ../../../concepts/classes.md -[concept-inheritance]: ../../../concepts/inheritance.md -[concept-property]: ../../../concepts/state.md +[concept-class]: ../../../reference/concepts/classes.md +[concept-inheritance]: ../../../reference/concepts/inheritance.md +[concept-property]: ../../../reference/concepts/state.md [keyword-instanceof]: ../keywords/instanceof.md [language-cplusplus]: ../../../languages/cplusplus/README.md [language-java]: ../../../languages/java/README.md [language-javascript]: ../../../languages/javascript/README.md [global-objects-object]: ../../../languages/javascript/objects/object.md -[type-object]: ../../../types/object.md -[type-null]: ../../../types/null.md -[type-function]: ../../../types/function.md +[type-object]: ../../../reference/types/object.md +[type-null]: ../../../reference/types/null.md +[type-function]: ../../../reference/types/function.md diff --git a/languages/javascript/info/sameness.md b/languages/javascript/info/sameness.md index dcefb36853..15c13f27eb 100644 --- a/languages/javascript/info/sameness.md +++ b/languages/javascript/info/sameness.md @@ -31,7 +31,7 @@ Same-value equality addresses a final use case: determining whether two values a Similar to same-value equality, but `+0` and `-0` are considered equal. -[concept-sameness]: ../../../concepts/sameness.md -[concept-type-casting]: ../../../concepts/type_casting.md +[concept-sameness]: ../../../reference/concepts/sameness.md +[concept-type-casting]: ../../../reference/concepts/type_casting.md [language-javascript]: ../README.md [wiki-liskov]: http://en.wikipedia.org/wiki/Liskov_substitution_principle diff --git a/languages/javascript/info/truthy.md b/languages/javascript/info/truthy.md index f02fc61248..1998b368ce 100644 --- a/languages/javascript/info/truthy.md +++ b/languages/javascript/info/truthy.md @@ -5,6 +5,6 @@ In [JavaScript][language-javascript], a truthy value is a value that is consider JavaScript uses [type coercion][concept-type-coercion] in Boolean contexts. [concept-falsy]: ./falsy.md -[concept-type-coercion]: ../../../concepts/type_casting.md +[concept-type-coercion]: ../../../reference/concepts/type_casting.md [language-javascript]: ../../../languages/javascript/README.md -[type-boolean]: ../../../types/boolean.md +[type-boolean]: ../../../reference/types/boolean.md diff --git a/languages/javascript/info/undefined.md b/languages/javascript/info/undefined.md index f2065ae3b8..fac61664ae 100644 --- a/languages/javascript/info/undefined.md +++ b/languages/javascript/info/undefined.md @@ -5,6 +5,6 @@ A [variable][concept-variables] that has not been assigned a value is of type `undefined`. A [method][concept-functions] or statement also returns `undefined` if the variable that is being evaluated does not have an assigned value. A function returns `undefined` if a value was not returned. [language-javascript]: ../../../languages/javascript/README.md -[concept-functions]: ../../../concepts/functions.md -[concept-variables]: ../../../concepts/variables.md -[type-null]: ../../../types/null.md +[concept-functions]: ../../../reference/concepts/functions.md +[concept-variables]: ../../../reference/concepts/variables.md +[type-null]: ../../../reference/types/null.md diff --git a/languages/javascript/keywords/async.md b/languages/javascript/keywords/async.md index aa5c535010..8d03121a9d 100644 --- a/languages/javascript/keywords/async.md +++ b/languages/javascript/keywords/async.md @@ -6,5 +6,5 @@ See [concurrency][concept-concurrency]. [concept-concurrency]: ../info/concurrency.md [concept-event-loop]: ../info/event_loop.md -[concept-functions]: ../../../concepts/functions.md +[concept-functions]: ../../../reference/concepts/functions.md [global-objects-promise]: ../objects/promise.md diff --git a/languages/javascript/keywords/await.md b/languages/javascript/keywords/await.md index dcff0cb94c..d761e27d44 100644 --- a/languages/javascript/keywords/await.md +++ b/languages/javascript/keywords/await.md @@ -5,6 +5,6 @@ The `await` operator is used to wait for a [`Promise`][global-objects-promise]. See [concurrency][concept-concurrency]. [concept-concurrency]: ../info/concurrency.md -[concept-functions]: ../../../concepts/functions.md +[concept-functions]: ../../../reference/concepts/functions.md [global-objects-promise]: ../objects/promise.md [keyword-async]: ./async.md diff --git a/languages/javascript/keywords/function.md b/languages/javascript/keywords/function.md index 21fc3ea144..8392f3579f 100644 --- a/languages/javascript/keywords/function.md +++ b/languages/javascript/keywords/function.md @@ -28,6 +28,6 @@ The `Function` constructor creates a new Function **object**. Calling the constr const greet = new Function("name", "return `Hello ${name}`"); ``` -[concept-scope]: ../../../concepts/scope.md -[concept-expressions]: ../../../concepts/expressions.md -[concept-functions]: ../../../concepts/functions.md +[concept-scope]: ../../../reference/concepts/scope.md +[concept-expressions]: ../../../reference/concepts/expressions.md +[concept-functions]: ../../../reference/concepts/functions.md diff --git a/languages/javascript/keywords/typeof.md b/languages/javascript/keywords/typeof.md index 2295305d2a..54d184fa34 100644 --- a/languages/javascript/keywords/typeof.md +++ b/languages/javascript/keywords/typeof.md @@ -38,17 +38,17 @@ platforms). Consequently, `null` had 0 as type tag, hence the `"object"` [language-csharp]: ../../csharp/README.md [language-ruby]: ../../csharp/README.md -[type-array]: ../../../types/array.md -[type-bigint]: ../../../types/big_integer.md -[type-boolean]: ../../../types/boolean.md -[type-function]: ../../../types/function.md -[type-null]: ../../../types/null.md -[type-number]: ../../../types/number.md -[type-object]: ../../../types/object.md -[type-pointer]: ../../../types/pointer.md -[type-string]: ../../../types/string.md -[type-symbol]: ../../../types/symbol.md -[type-undefined]: ../../../concepts/undefined.md +[type-array]: ../../../reference/types/array.md +[type-bigint]: ../../../reference/types/big_integer.md +[type-boolean]: ../../../reference/types/boolean.md +[type-function]: ../../../reference/types/function.md +[type-null]: ../../../reference/types/null.md +[type-number]: ../../../reference/types/number.md +[type-object]: ../../../reference/types/object.md +[type-pointer]: ../../../reference/types/pointer.md +[type-string]: ../../../reference/types/string.md +[type-symbol]: ../../../reference/types/symbol.md +[type-undefined]: ../../../reference/concepts/undefined.md [ref-null-pointer-typeof]: https://2ality.com/2013/10/typeof-null.html [csharp-operator-is]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is diff --git a/languages/javascript/objects/array.md b/languages/javascript/objects/array.md index c3eeb44d31..98a6548954 100644 --- a/languages/javascript/objects/array.md +++ b/languages/javascript/objects/array.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`array` type][type-array]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-array]: ../../../types/array.md +[type-array]: ../../../reference/types/array.md diff --git a/languages/javascript/objects/bigint.md b/languages/javascript/objects/bigint.md index 78f87470fe..dee509f730 100644 --- a/languages/javascript/objects/bigint.md +++ b/languages/javascript/objects/bigint.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`bigint` type][type-bigint]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-bigint]: ../../../types/big_integer.md +[type-bigint]: ../../../reference/types/big_integer.md diff --git a/languages/javascript/objects/boolean.md b/languages/javascript/objects/boolean.md index 7e12ec321c..3e3765b2fd 100644 --- a/languages/javascript/objects/boolean.md +++ b/languages/javascript/objects/boolean.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`boolean` type][type-boolean]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-boolean]: ../../../types/boolean.md +[type-boolean]: ../../../reference/types/boolean.md diff --git a/languages/javascript/objects/date.md b/languages/javascript/objects/date.md index 69f73876cd..df865d557c 100644 --- a/languages/javascript/objects/date.md +++ b/languages/javascript/objects/date.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`date` type][type-date]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-date]: ../../../types/date.md +[type-date]: ../../../reference/types/date.md diff --git a/languages/javascript/objects/error.md b/languages/javascript/objects/error.md index 8a7bccf1c7..fd04eb63d7 100644 --- a/languages/javascript/objects/error.md +++ b/languages/javascript/objects/error.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`error` type][type-error]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-error]: ../../../types/error.md +[type-error]: ../../../reference/types/error.md diff --git a/languages/javascript/objects/function.md b/languages/javascript/objects/function.md index 58f1fcaa91..b2e70b541e 100644 --- a/languages/javascript/objects/function.md +++ b/languages/javascript/objects/function.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`function` type][type-function]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-function]: ../../../types/function.md +[type-function]: ../../../reference/types/function.md diff --git a/languages/javascript/objects/map.md b/languages/javascript/objects/map.md index 404f8ea433..2cfd230425 100644 --- a/languages/javascript/objects/map.md +++ b/languages/javascript/objects/map.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`map` type][type-map]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-map]: ../../../types/map.md +[type-map]: ../../../reference/types/map.md diff --git a/languages/javascript/objects/number.md b/languages/javascript/objects/number.md index abfa46f350..b111ec3257 100644 --- a/languages/javascript/objects/number.md +++ b/languages/javascript/objects/number.md @@ -6,5 +6,5 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md [concept-global-objects]: ../../../languages/javascript/info/global_objects.md -[type-number]: ../../../types/number.md -[type-object]: ../../../types/object.md +[type-number]: ../../../reference/types/number.md +[type-object]: ../../../reference/types/object.md diff --git a/languages/javascript/objects/object.md b/languages/javascript/objects/object.md index 7cba88287c..57f2157649 100644 --- a/languages/javascript/objects/object.md +++ b/languages/javascript/objects/object.md @@ -26,14 +26,14 @@ A JavaScript [`Date`][type-date] is a regular object which inherit from [`Date.p [info-prototype-inheritance]: ../info/prototype_inheritance.md [object-array]: ./array.md [object-date]: ./date.md -[type-array]: ../../../types/array.md -[type-function]: ../../../types/function.md -[type-hash-map]: ../../../types/hash_map.md -[type-date]: ../../../types/date.md -[type-datetime]: ../../../types/datetime.md -[type-null]: ../../../types/null.md -[type-object]: ../../../types/object.md -[type-string]: ../../../types/string.md -[type-symbol]: ../../../types/symbol.md -[type-timestamp]: ../../../types/timestamp.md -[type-undefined]: ../../../types/undefined.md +[type-array]: ../../../reference/types/array.md +[type-function]: ../../../reference/types/function.md +[type-hash-map]: ../../../reference/types/hash_map.md +[type-date]: ../../../reference/types/date.md +[type-datetime]: ../../../reference/types/datetime.md +[type-null]: ../../../reference/types/null.md +[type-object]: ../../../reference/types/object.md +[type-string]: ../../../reference/types/string.md +[type-symbol]: ../../../reference/types/symbol.md +[type-timestamp]: ../../../reference/types/timestamp.md +[type-undefined]: ../../../reference/types/undefined.md diff --git a/languages/javascript/objects/promise.md b/languages/javascript/objects/promise.md index ceb55d695b..0459ffdd26 100644 --- a/languages/javascript/objects/promise.md +++ b/languages/javascript/objects/promise.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`promise` type][type-promise]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-promise]: ../../../types/promise.md +[type-promise]: ../../../reference/types/promise.md diff --git a/languages/javascript/objects/regexp.md b/languages/javascript/objects/regexp.md index a8b5b503d9..ce701c34ae 100644 --- a/languages/javascript/objects/regexp.md +++ b/languages/javascript/objects/regexp.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`regexp` type][type-regexp]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-regexp]: ../../../types/regular_expression.md +[type-regexp]: ../../../reference/types/regular_expression.md diff --git a/languages/javascript/objects/set.md b/languages/javascript/objects/set.md index fe525ac8f0..962c2a52f9 100644 --- a/languages/javascript/objects/set.md +++ b/languages/javascript/objects/set.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`set` type][type-set]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-set]: ../../../types/set.md +[type-set]: ../../../reference/types/set.md diff --git a/languages/javascript/objects/string.md b/languages/javascript/objects/string.md index d398bd72fa..e46d01ef8d 100644 --- a/languages/javascript/objects/string.md +++ b/languages/javascript/objects/string.md @@ -7,4 +7,4 @@ The `String` global object is a constructor for [`string`s][type-string] or a se See [prototype-based inheritance][concept-prototype-inheritance] and the general [`string` type][type-string]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-string]: ../../../types/string.md +[type-string]: ../../../reference/types/string.md diff --git a/languages/javascript/objects/symbol.md b/languages/javascript/objects/symbol.md index ec9ffc28fa..9ec0638088 100644 --- a/languages/javascript/objects/symbol.md +++ b/languages/javascript/objects/symbol.md @@ -5,4 +5,4 @@ See [prototype-based inheritance][concept-prototype-inheritance] and the general [`symbol` type][type-symbol]. [concept-prototype-inheritance]: ../../../languages/javascript/info/prototype_inheritance.md -[type-symbol]: ../../../types/symbol.md +[type-symbol]: ../../../reference/types/symbol.md diff --git a/languages/javascript/transitions/from_coffeescript.md b/languages/javascript/transitions/from_coffeescript.md index ac3dd0e9fd..1603c4fe5e 100644 --- a/languages/javascript/transitions/from_coffeescript.md +++ b/languages/javascript/transitions/from_coffeescript.md @@ -52,11 +52,11 @@ JavaScript does not have to be compiled, whereas [CoffeeScript][language-coffees [coffeescript-keyword-by]: ../../coffeescript/keywords/by.md [coffeescript-keyword-until]: ../../coffeescript/keywords/until.md [coffeescript-keyword-when]: ../../coffeescript/keywords/when.md -[concept-destructuring]: ../../../concepts/destructuring.md -[concept-destructuring-assignment]: ../../../concepts/destructuring_assignment.md -[concept-list-comprehension]: ../../../concepts/list_comprehension.md -[concept-rest-parameters]: ../../../concepts/rest_parameters.md -[concept-variable-shadowing]: ../../../concepts/variable_shadowing.md +[concept-destructuring]: ../../../reference/concepts/destructuring.md +[concept-destructuring-assignment]: ../../../reference/concepts/destructuring_assignment.md +[concept-list-comprehension]: ../../../reference/concepts/list_comprehension.md +[concept-rest-parameters]: ../../../reference/concepts/rest_parameters.md +[concept-variable-shadowing]: ../../../reference/concepts/variable_shadowing.md [javascript-concept-arrow-function-expression]: ../../../languages/javascript/info/arrow_function_expression.md [javascript-concept-strict-mode]: ../../../languages/javascript/info/strict_mode.md [javascript-keyword-const]: ../keywords/const.md @@ -68,4 +68,4 @@ JavaScript does not have to be compiled, whereas [CoffeeScript][language-coffees [language-haskell]: ../../haskell/README.md [language-python]: ../../python/README.md [language-ruby]: ../../ruby/README.md -[tool-babel]: ../../../tooling/babel.md +[tool-babel]: ../../../reference/tooling/babel.md diff --git a/languages/julia/README.md b/languages/julia/README.md index 269394cf0f..5b4dde1529 100644 --- a/languages/julia/README.md +++ b/languages/julia/README.md @@ -2,23 +2,23 @@ ## Object-oriented concepts -- [Mutability](../../concepts/mutation.md) -- [Multiple Dispatch](../../concepts/multiple-dispatch.md) +- [Mutability](../../reference/concepts/mutation.md) +- [Multiple Dispatch](../../reference/concepts/multiple-dispatch.md) - Constructors (external & internal) ## Functional concepts -- [Immutability](../../concepts/immutability.md) -- [Higher-order functions](../../concepts/higher_order_functions.md) -- [Nested functions](../../concepts/nested_functions.md) -- [Anonymous functions](../../concepts/anonymous_functions.md) -- [Type inference](../../concepts/type_inference.md) -- [REPL](../../concepts/repl.md) +- [Immutability](../../reference/concepts/immutability.md) +- [Higher-order functions](../../reference/concepts/higher_order_functions.md) +- [Nested functions](../../reference/concepts/nested_functions.md) +- [Anonymous functions](../../reference/concepts/anonymous_functions.md) +- [Type inference](../../reference/concepts/type_inference.md) +- [REPL](../../reference/concepts/repl.md) ## General concepts -- [Metaprogramming](../../concepts/metaprogramming.md) - - [Macros](../../concepts/macros.md) (using/calling) +- [Metaprogramming](../../reference/concepts/metaprogramming.md) + - [Macros](../../reference/concepts/macros.md) (using/calling) - Package Management - Unicode identifiers - Iterators @@ -52,7 +52,7 @@ - Abstract type - Struct - Tuple -- [Array](../../types/array.md) +- [Array](../../reference/types/array.md) - 1-based indexing - Arbitrary indexing - Multidimensional arrays @@ -62,7 +62,7 @@ - Nothing - Missing - Union -- [String](../../types/string.md) +- [String](../../reference/types/string.md) ## Resources used diff --git a/languages/python/README.md b/languages/python/README.md index 9e37ec435e..f29546d741 100644 --- a/languages/python/README.md +++ b/languages/python/README.md @@ -11,62 +11,62 @@ Python is an interpreted, dynamically (but strongly) typed, and garbage-collecte ## Object-oriented concepts -- [Classes](../../concepts/classes.md) -- [Composition](../../concepts/composition.md) -- [Encapsulation](../../concepts/encapsulation.md) -- [Inheritance](../../concepts/inheritance.md) -- [Interfaces](../../concepts/interfaces.md) -- [Mutation](../../concepts/mutation.md) -- [Objects](../../concepts/objects.md) -- [Polymorphism](../../concepts/polymorphism.md) -- [State](../../concepts/state.md) +- [Classes](../../reference/concepts/classes.md) +- [Composition](../../reference/concepts/composition.md) +- [Encapsulation](../../reference/concepts/encapsulation.md) +- [Inheritance](../../reference/concepts/inheritance.md) +- [Interfaces](../../reference/concepts/interfaces.md) +- [Mutation](../../reference/concepts/mutation.md) +- [Objects](../../reference/concepts/objects.md) +- [Polymorphism](../../reference/concepts/polymorphism.md) +- [State](../../reference/concepts/state.md) ## Functional concepts -- [Anonymous functions](../../concepts/anonymous_functions.md) (Python's `lambda`s) -- [Higher-order functions](../../concepts/higher_order_functions.md) -- [Immutability](../../concepts/immutability.md) (of certain builtin primitives) -- [Nested functions](../../concepts/nested_functions.md) -- [Partial application](../../concepts/partial_application.md) -- [Pipelines](../../concepts/pipelines.md) -- [Pure functions](../../concepts/pure_functions.md) -- [Recursion](../../concepts/recursion.md) -- [REPL](../../concepts/repl.md) -- [Type inference](../../concepts/type_inference.md) +- [Anonymous functions](../../reference/concepts/anonymous_functions.md) (Python's `lambda`s) +- [Higher-order functions](../../reference/concepts/higher_order_functions.md) +- [Immutability](../../reference/concepts/immutability.md) (of certain builtin primitives) +- [Nested functions](../../reference/concepts/nested_functions.md) +- [Partial application](../../reference/concepts/partial_application.md) +- [Pipelines](../../reference/concepts/pipelines.md) +- [Pure functions](../../reference/concepts/pure_functions.md) +- [Recursion](../../reference/concepts/recursion.md) +- [REPL](../../reference/concepts/repl.md) +- [Type inference](../../reference/concepts/type_inference.md) ## General concepts -- [Arithmetic](../../concepts/arithmetic.md) -- [Bitwise manipulation](../../concepts/bitwise_manipulation.md) -- [Boolean logic](../../concepts/boolean_logic.md) -- [Comments](../../concepts/comments.md) -- [Conditionals](../../concepts/conditionals.md) -- [Enumeration](../../concepts/enumeration.md) -- [Functions](../../concepts/functions.md) -- [Generics](../../concepts/generics.md) -- [Locking](../../concepts/locking.md) -- [Loops](../../concepts/loops.md) -- [Methods](../../concepts/methods.md) -- [Scope](../../concepts/scope.md) -- [Variables](../../concepts/variables.md) +- [Arithmetic](../../reference/concepts/arithmetic.md) +- [Bitwise manipulation](../../reference/concepts/bitwise_manipulation.md) +- [Boolean logic](../../reference/concepts/boolean_logic.md) +- [Comments](../../reference/concepts/comments.md) +- [Conditionals](../../reference/concepts/conditionals.md) +- [Enumeration](../../reference/concepts/enumeration.md) +- [Functions](../../reference/concepts/functions.md) +- [Generics](../../reference/concepts/generics.md) +- [Locking](../../reference/concepts/locking.md) +- [Loops](../../reference/concepts/loops.md) +- [Methods](../../reference/concepts/methods.md) +- [Scope](../../reference/concepts/scope.md) +- [Variables](../../reference/concepts/variables.md) ## Types -- [array](../../types/array.md) -- [bool](../../types/boolean.md) -- [bytes](../../types/bytes.md) -- [class](../../types/class.md) -- [float](../../types/floating_point_number.md) -- [decimal](../../types/decimal_number.md) -- [deque](../../types/deque.md) -- [dict](../../types/hash_map.md) -- [int](../../types/integer.md) -- [list](../../types/list.md) -- [None](../../types/null.md) -- [set](../../types/set.md) -- [str](../../types/string.md) -- [struct](../../types/struct.md) -- [tuple](../../types/tuple.md) +- [array](../../reference/types/array.md) +- [bool](../../reference/types/boolean.md) +- [bytes](../../reference/types/bytes.md) +- [class](../../reference/types/class.md) +- [float](../../reference/types/floating_point_number.md) +- [decimal](../../reference/types/decimal_number.md) +- [deque](../../reference/types/deque.md) +- [dict](../../reference/types/hash_map.md) +- [int](../../reference/types/integer.md) +- [list](../../reference/types/list.md) +- [None](../../reference/types/null.md) +- [set](../../reference/types/set.md) +- [str](../../reference/types/string.md) +- [struct](../../reference/types/struct.md) +- [tuple](../../reference/types/tuple.md) ## Resources used diff --git a/reference/README.md b/reference/README.md new file mode 100644 index 0000000000..2f974bbd9d --- /dev/null +++ b/reference/README.md @@ -0,0 +1,19 @@ +# Reference documents + +There are four types of reference documents: + +- [Concepts][concepts] +- [Paradigms][paradigms] +- [Tooling][tooling] +- [Types][types] + +## Contributing + +Thanks for wanting to contribute to Exercism's reference documents! Contributions are very welcome! + +To contribute, please go to the [concepts][concepts], [paradigms][paradigms], [tooling][tooling] or [types][types] page to see which documents have been written. You can then contribute by submitting a PR to update an existing document, or to add a missing document. + +[concepts]: ./concepts/README.md +[paradigms]: ./paradigms/README.md +[tooling]: ./tooling/README.md +[types]: ./types/README.md diff --git a/reference/_sidebar.md b/reference/_sidebar.md new file mode 100644 index 0000000000..74952c8e7c --- /dev/null +++ b/reference/_sidebar.md @@ -0,0 +1,14 @@ +- [Start here](/) +- Docs + - [Concept Exercises](/docs/concept-exercises.md) + - [The features of v3](/docs/features-of-v3.md) + - [Rationale for v3](/docs/rationale-for-v3.md) + - [Docs for Maintainers](/docs/maintainers/README.md) +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) + + diff --git a/reference/concepts/README.md b/reference/concepts/README.md new file mode 100644 index 0000000000..0befce14c9 --- /dev/null +++ b/reference/concepts/README.md @@ -0,0 +1,86 @@ +# Concepts + +This section aims to outline all concepts that are taught within Exercism, providing a canonical description / resource that can be provided by tracks. Within exercise READMEs, tracks should link to the generic description and then go on to outline details of their own language-specific implementations. + +For example, we might have one or many exercises on "enumeration" in Ruby. The exercise README would start by taking the generic description of looping and enumeration from here and then add its own language-specific information. It might read something like this: + +> Most languages have a concept of looping or enumerating through a data-structure. Depending on your background, you might be familiar with "for loops" or maybe using a method `.each`. In you are unfamiliar with the concepts around looping or enumeration, or would like a reminder, check out `[this article](...)`. +> +> In Ruby we generally use enumeration using.... + +We should not presume a programmer knows these topics, and should ensure that tracks explain them clearly both in the general term and how they are used in a language. + +For example the concept of `null` (or `nil` or `None`) does not exist in some languages, and is extremely esoteric the first time it is encountered. We should therefore ensure that we explain its purpose in the language, and provide good documentation for learning more, as well as providing an exercise that demonstrates its language-implementation. + +## Contributing + +Thanks for wanting to contribute to Exercism's concept reference documents! Contributions are very welcome! + +To contribute, check the list below to see which documents have already been written. You can then contribute by submitting a PR to update an existing document, or to add a missing document. + +## References + +- [Anonymous functions](./anonymous_functions.md) +- [Arithmetic](./arithmetic.md) +- [ASCII](./ascii.md) +- [Assignment](./assignment.md) +- [Bitwise manipulation](./bitwise_manipulation.md) +- [Boolean logic](./boolean_logic.md) +- [Character encoding](./character_encoding.md) +- [Classes](./classes.md) +- [Comments](./comments.md) +- [Comparisons](./comparisons.md) +- [Composition](./composition.md) +- [Concurrency](./concurrency.md) +- [Conditionals](./conditionals.md) +- [Constants](./constants.md) +- [Destructuring](./destructuring.md) +- [Destructuring assignment](./destructuring_assignment.md) +- [Duck typing](./duck_typing.md) +- [Encapsulation](./encapsulation.md) +- [Enumeration](./enumeration.md) +- [Evaluation](./evaluation.md) +- [Expression-oriented](./expression_oriented.md) +- [Expressions](./expressions.md) +- [Function composition](./function_composition.md) +- [Functions](./functions.md) +- [Generics](./generics.md) +- [Hashing](./hashing.md) +- [Higher-order functions](./higher_order_functions.md) +- [Immutability](./immutability.md) +- [Inheritance](./inheritance.md) +- [Interfaces](./interfaces.md) +- [List comprehension](./list_comprehension.md) +- [Locking](./locking.md) +- [Loops](./loops.md) +- [Macros](./macros.md) +- [Metaprogramming](./metaprogramming.md) +- [Methods](./methods.md) +- [Multiple-dispatch](./multiple-dispatch.md) +- [Mutation](./mutation.md) +- [Nested functions](./nested_functions.md) +- [Objects](./objects.md) +- [Operators](./operators.md) +- [Partial application](./partial_application.md) +- [Pattern matching](./pattern_matching.md) +- [Pipelines](./pipelines.md) +- [Polymorphism](./polymorphism.md) +- [Prototype-based programming](./prototype_based-programming.md) +- [Pure functions](./pure_functions.md) +- [Recursion](./recursion.md) +- [REPL](./repl.md) +- [Rest parameters](./rest_parameters.md) +- [Return values](./return_values.md) +- [Sameness](./sameness.md) +- [Scope](./scope.md) +- [Signedness](./signedness.md) +- [State](./state.md) +- [Truthy and falsy](./truthy_and_falsy.md) +- [Type casting](./type_casting.md) +- [Type inference](./type_inference.md) +- [Undefined](./undefined.md) +- [Unicode](./unicode.md) +- [UTF7](./utf7.md) +- [UTF8](./utf8.md) +- [Variable shadowing](./variable_shadowing.md) +- [Variables](./variables.md) diff --git a/reference/concepts/_sidebar.md b/reference/concepts/_sidebar.md new file mode 100644 index 0000000000..f8455b7d08 --- /dev/null +++ b/reference/concepts/_sidebar.md @@ -0,0 +1,72 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + - [Concepts](/reference/concepts/README.md) + - [Anonymous functions](/reference/concepts/anonymous_functions.md) + - [Arithmetic](/reference/concepts/arithmetic.md) + - [ASCII](/reference/concepts/ascii.md) + - [Assignment](/reference/concepts/assignment.md) + - [Bitwise manipulation](/reference/concepts/bitwise_manipulation.md) + - [Boolean logic](/reference/concepts/boolean_logic.md) + - [Character encoding](/reference/concepts/character_encoding.md) + - [Classes](/reference/concepts/classes.md) + - [Comments](/reference/concepts/comments.md) + - [Comparisons](/reference/concepts/comparisons.md) + - [Composition](/reference/concepts/composition.md) + - [Concurrency](/reference/concepts/concurrency.md) + - [Conditionals](/reference/concepts/conditionals.md) + - [Constants](/reference/concepts/constants.md) + - [Destructuring](/reference/concepts/destructuring.md) + - [Destructuring assignment](/reference/concepts/destructuring_assignment.md) + - [Duck typing](/reference/concepts/duck_typing.md) + - [Encapsulation](/reference/concepts/encapsulation.md) + - [Enumeration](/reference/concepts/enumeration.md) + - [Evaluation](/reference/concepts/evaluation.md) + - [Expression-oriented](/reference/concepts/expression_oriented.md) + - [Expressions](/reference/concepts/expressions.md) + - [Function composition](/reference/concepts/function_composition.md) + - [Functions](/reference/concepts/functions.md) + - [Generics](/reference/concepts/generics.md) + - [Hashing](/reference/concepts/hashing.md) + - [Higher-order functions](/reference/concepts/higher_order_functions.md) + - [Immutability](/reference/concepts/immutability.md) + - [Inheritance](/reference/concepts/inheritance.md) + - [Interfaces](/reference/concepts/interfaces.md) + - [List comprehension](/reference/concepts/list_comprehension.md) + - [Locking](/reference/concepts/locking.md) + - [Loops](/reference/concepts/loops.md) + - [Macros](/reference/concepts/macros.md) + - [Metaprogramming](/reference/concepts/metaprogramming.md) + - [Methods](/reference/concepts/methods.md) + - [Multiple-dispatch](/reference/concepts/multiple-dispatch.md) + - [Mutation](/reference/concepts/mutation.md) + - [Nested functions](/reference/concepts/nested_functions.md) + - [Objects](/reference/concepts/objects.md) + - [Operators](/reference/concepts/operators.md) + - [Partial application](/reference/concepts/partial_application.md) + - [Pattern matching](/reference/concepts/pattern_matching.md) + - [Pipelines](/reference/concepts/pipelines.md) + - [Polymorphism](/reference/concepts/polymorphism.md) + - [Prototype-based programming](/reference/concepts/prototype_based-programming.md) + - [Pure functions](/reference/concepts/pure_functions.md) + - [Recursion](/reference/concepts/recursion.md) + - [REPL](/reference/concepts/repl.md) + - [Rest parameters](/reference/concepts/rest_parameters.md) + - [Return values](/reference/concepts/return_values.md) + - [Sameness](/reference/concepts/sameness.md) + - [Scope](/reference/concepts/scope.md) + - [Signedness](/reference/concepts/signedness.md) + - [State](/reference/concepts/state.md) + - [Truthy and falsy](/reference/concepts/truthy_and_falsy.md) + - [Type casting](/reference/concepts/type_casting.md) + - [Type inference](/reference/concepts/type_inference.md) + - [Undefined](/reference/concepts/undefined.md) + - [Unicode](/reference/concepts/unicode.md) + - [UTF7](/reference/concepts/utf7.md) + - [UTF8](/reference/concepts/utf8.md) + - [Variable shadowing](/reference/concepts/variable_shadowing.md) + - [Variables](/reference/concepts/variables.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/concepts/anonymous_functions.md b/reference/concepts/anonymous_functions.md similarity index 100% rename from concepts/anonymous_functions.md rename to reference/concepts/anonymous_functions.md diff --git a/concepts/arithmetic.md b/reference/concepts/arithmetic.md similarity index 100% rename from concepts/arithmetic.md rename to reference/concepts/arithmetic.md diff --git a/concepts/ascii.md b/reference/concepts/ascii.md similarity index 100% rename from concepts/ascii.md rename to reference/concepts/ascii.md diff --git a/concepts/assignment.md b/reference/concepts/assignment.md similarity index 100% rename from concepts/assignment.md rename to reference/concepts/assignment.md diff --git a/concepts/bitwise_manipulation.md b/reference/concepts/bitwise_manipulation.md similarity index 75% rename from concepts/bitwise_manipulation.md rename to reference/concepts/bitwise_manipulation.md index 3f0acd18af..77a2699b2f 100644 --- a/concepts/bitwise_manipulation.md +++ b/reference/concepts/bitwise_manipulation.md @@ -1,3 +1,9 @@ # Bitwise manipulation While manipulating individual [bits](../types/bit.md) may not be a concept that a lot of programmers will be familiar with, this is a general programming topic, which we don't aim to teach. It might be important in a language, in which case an early exercise to demonstrate the syntax would be valid, but for many languages, it could be "discovered" through a later side exercise. In either situation, a link should be provided to the canonical article. + +# Implementations + +- [C#][implementation-csharp] + +[implementation-csharp]: ../../languages/csharp/exercises/concept/bitwise-operations/.docs/introduction.md diff --git a/concepts/boolean_logic.md b/reference/concepts/boolean_logic.md similarity index 100% rename from concepts/boolean_logic.md rename to reference/concepts/boolean_logic.md diff --git a/concepts/character_encoding.md b/reference/concepts/character_encoding.md similarity index 100% rename from concepts/character_encoding.md rename to reference/concepts/character_encoding.md diff --git a/concepts/classes.md b/reference/concepts/classes.md similarity index 100% rename from concepts/classes.md rename to reference/concepts/classes.md diff --git a/concepts/comments.md b/reference/concepts/comments.md similarity index 100% rename from concepts/comments.md rename to reference/concepts/comments.md diff --git a/concepts/comparisons.md b/reference/concepts/comparisons.md similarity index 100% rename from concepts/comparisons.md rename to reference/concepts/comparisons.md diff --git a/concepts/composition.md b/reference/concepts/composition.md similarity index 100% rename from concepts/composition.md rename to reference/concepts/composition.md diff --git a/concepts/concurrency.md b/reference/concepts/concurrency.md similarity index 86% rename from concepts/concurrency.md rename to reference/concepts/concurrency.md index f92fbafe98..719bb1ff59 100644 --- a/concepts/concurrency.md +++ b/reference/concepts/concurrency.md @@ -7,4 +7,4 @@ See also [Event loop][javascript-event-loop]. -[javascript-event-loop]: ../languages/javascript/info/event_loop.md +[javascript-event-loop]: ../../languages/javascript/info/event_loop.md diff --git a/concepts/conditionals.md b/reference/concepts/conditionals.md similarity index 100% rename from concepts/conditionals.md rename to reference/concepts/conditionals.md diff --git a/concepts/constants.md b/reference/concepts/constants.md similarity index 100% rename from concepts/constants.md rename to reference/concepts/constants.md diff --git a/concepts/destructuring.md b/reference/concepts/destructuring.md similarity index 100% rename from concepts/destructuring.md rename to reference/concepts/destructuring.md diff --git a/concepts/destructuring_assignment.md b/reference/concepts/destructuring_assignment.md similarity index 100% rename from concepts/destructuring_assignment.md rename to reference/concepts/destructuring_assignment.md diff --git a/concepts/duck_typing.md b/reference/concepts/duck_typing.md similarity index 100% rename from concepts/duck_typing.md rename to reference/concepts/duck_typing.md diff --git a/concepts/encapsulation.md b/reference/concepts/encapsulation.md similarity index 100% rename from concepts/encapsulation.md rename to reference/concepts/encapsulation.md diff --git a/concepts/enumeration.md b/reference/concepts/enumeration.md similarity index 100% rename from concepts/enumeration.md rename to reference/concepts/enumeration.md diff --git a/concepts/evaluation.md b/reference/concepts/evaluation.md similarity index 100% rename from concepts/evaluation.md rename to reference/concepts/evaluation.md diff --git a/concepts/expression_oriented.md b/reference/concepts/expression_oriented.md similarity index 100% rename from concepts/expression_oriented.md rename to reference/concepts/expression_oriented.md diff --git a/concepts/expressions.md b/reference/concepts/expressions.md similarity index 100% rename from concepts/expressions.md rename to reference/concepts/expressions.md diff --git a/concepts/function_composition.md b/reference/concepts/function_composition.md similarity index 100% rename from concepts/function_composition.md rename to reference/concepts/function_composition.md diff --git a/concepts/functions.md b/reference/concepts/functions.md similarity index 100% rename from concepts/functions.md rename to reference/concepts/functions.md diff --git a/concepts/generics.md b/reference/concepts/generics.md similarity index 100% rename from concepts/generics.md rename to reference/concepts/generics.md diff --git a/concepts/hashing.md b/reference/concepts/hashing.md similarity index 100% rename from concepts/hashing.md rename to reference/concepts/hashing.md diff --git a/concepts/higher_order_functions.md b/reference/concepts/higher_order_functions.md similarity index 100% rename from concepts/higher_order_functions.md rename to reference/concepts/higher_order_functions.md diff --git a/concepts/immutability.md b/reference/concepts/immutability.md similarity index 100% rename from concepts/immutability.md rename to reference/concepts/immutability.md diff --git a/concepts/inheritance.md b/reference/concepts/inheritance.md similarity index 100% rename from concepts/inheritance.md rename to reference/concepts/inheritance.md diff --git a/concepts/interfaces.md b/reference/concepts/interfaces.md similarity index 100% rename from concepts/interfaces.md rename to reference/concepts/interfaces.md diff --git a/concepts/list_comprehension.md b/reference/concepts/list_comprehension.md similarity index 100% rename from concepts/list_comprehension.md rename to reference/concepts/list_comprehension.md diff --git a/concepts/locking.md b/reference/concepts/locking.md similarity index 100% rename from concepts/locking.md rename to reference/concepts/locking.md diff --git a/concepts/loops.md b/reference/concepts/loops.md similarity index 100% rename from concepts/loops.md rename to reference/concepts/loops.md diff --git a/concepts/macros.md b/reference/concepts/macros.md similarity index 100% rename from concepts/macros.md rename to reference/concepts/macros.md diff --git a/concepts/metaprogramming.md b/reference/concepts/metaprogramming.md similarity index 100% rename from concepts/metaprogramming.md rename to reference/concepts/metaprogramming.md diff --git a/concepts/methods.md b/reference/concepts/methods.md similarity index 100% rename from concepts/methods.md rename to reference/concepts/methods.md diff --git a/concepts/multiple-dispatch.md b/reference/concepts/multiple-dispatch.md similarity index 88% rename from concepts/multiple-dispatch.md rename to reference/concepts/multiple-dispatch.md index d37b04d3a8..0a22dac0fd 100644 --- a/concepts/multiple-dispatch.md +++ b/reference/concepts/multiple-dispatch.md @@ -8,7 +8,7 @@ Multiple Dispatch is a form of [polymorphism][concept-polymorphism]. ## Implementations -- [Julia](../languages/julia/concept-exercises/multiple-dispatch/) +- [Julia](../../languages/julia/concept-exercises/multiple-dispatch/) ## Sources diff --git a/concepts/mutation.md b/reference/concepts/mutation.md similarity index 100% rename from concepts/mutation.md rename to reference/concepts/mutation.md diff --git a/concepts/nested_functions.md b/reference/concepts/nested_functions.md similarity index 100% rename from concepts/nested_functions.md rename to reference/concepts/nested_functions.md diff --git a/concepts/objects.md b/reference/concepts/objects.md similarity index 100% rename from concepts/objects.md rename to reference/concepts/objects.md diff --git a/concepts/operators.md b/reference/concepts/operators.md similarity index 100% rename from concepts/operators.md rename to reference/concepts/operators.md diff --git a/concepts/partial_application.md b/reference/concepts/partial_application.md similarity index 100% rename from concepts/partial_application.md rename to reference/concepts/partial_application.md diff --git a/concepts/pattern_matching.md b/reference/concepts/pattern_matching.md similarity index 100% rename from concepts/pattern_matching.md rename to reference/concepts/pattern_matching.md diff --git a/concepts/pipelines.md b/reference/concepts/pipelines.md similarity index 100% rename from concepts/pipelines.md rename to reference/concepts/pipelines.md diff --git a/concepts/polymorphism.md b/reference/concepts/polymorphism.md similarity index 100% rename from concepts/polymorphism.md rename to reference/concepts/polymorphism.md diff --git a/concepts/prototype_based-programming.md b/reference/concepts/prototype_based-programming.md similarity index 100% rename from concepts/prototype_based-programming.md rename to reference/concepts/prototype_based-programming.md diff --git a/concepts/pure_functions.md b/reference/concepts/pure_functions.md similarity index 100% rename from concepts/pure_functions.md rename to reference/concepts/pure_functions.md diff --git a/concepts/recursion.md b/reference/concepts/recursion.md similarity index 100% rename from concepts/recursion.md rename to reference/concepts/recursion.md diff --git a/concepts/repl.md b/reference/concepts/repl.md similarity index 100% rename from concepts/repl.md rename to reference/concepts/repl.md diff --git a/concepts/rest_parameters.md b/reference/concepts/rest_parameters.md similarity index 100% rename from concepts/rest_parameters.md rename to reference/concepts/rest_parameters.md diff --git a/concepts/return_values.md b/reference/concepts/return_values.md similarity index 100% rename from concepts/return_values.md rename to reference/concepts/return_values.md diff --git a/concepts/sameness.md b/reference/concepts/sameness.md similarity index 100% rename from concepts/sameness.md rename to reference/concepts/sameness.md diff --git a/concepts/scope.md b/reference/concepts/scope.md similarity index 100% rename from concepts/scope.md rename to reference/concepts/scope.md diff --git a/concepts/signedness.md b/reference/concepts/signedness.md similarity index 100% rename from concepts/signedness.md rename to reference/concepts/signedness.md diff --git a/concepts/state.md b/reference/concepts/state.md similarity index 100% rename from concepts/state.md rename to reference/concepts/state.md diff --git a/concepts/truthy_and_falsy.md b/reference/concepts/truthy_and_falsy.md similarity index 100% rename from concepts/truthy_and_falsy.md rename to reference/concepts/truthy_and_falsy.md diff --git a/concepts/type_casting.md b/reference/concepts/type_casting.md similarity index 100% rename from concepts/type_casting.md rename to reference/concepts/type_casting.md diff --git a/concepts/type_inference.md b/reference/concepts/type_inference.md similarity index 100% rename from concepts/type_inference.md rename to reference/concepts/type_inference.md diff --git a/concepts/undefined.md b/reference/concepts/undefined.md similarity index 100% rename from concepts/undefined.md rename to reference/concepts/undefined.md diff --git a/concepts/unicode.md b/reference/concepts/unicode.md similarity index 100% rename from concepts/unicode.md rename to reference/concepts/unicode.md diff --git a/concepts/utf7.md b/reference/concepts/utf7.md similarity index 100% rename from concepts/utf7.md rename to reference/concepts/utf7.md diff --git a/concepts/utf8.md b/reference/concepts/utf8.md similarity index 100% rename from concepts/utf8.md rename to reference/concepts/utf8.md diff --git a/concepts/variable_shadowing.md b/reference/concepts/variable_shadowing.md similarity index 88% rename from concepts/variable_shadowing.md rename to reference/concepts/variable_shadowing.md index 2985a8ea59..32721ef316 100644 --- a/concepts/variable_shadowing.md +++ b/reference/concepts/variable_shadowing.md @@ -10,6 +10,6 @@ Some languages, such as [CoffeeScript][language-coffeescript], disallow variable [concept-functions]: ./functions.md [concept-scope]: ./scope.md [concept-variables]: ./variables.md -[language-coffeescript]: ../languages/coffeescript/README.md -[language-kotlin]: ../languages/kotlin/README.md -[language-java]: ../languages/java/README.md +[language-coffeescript]: ../../languages/coffeescript/README.md +[language-kotlin]: ../../languages/kotlin/README.md +[language-java]: ../../languages/java/README.md diff --git a/concepts/variables.md b/reference/concepts/variables.md similarity index 100% rename from concepts/variables.md rename to reference/concepts/variables.md diff --git a/reference/paradigms/README.md b/reference/paradigms/README.md new file mode 100644 index 0000000000..5b84d69283 --- /dev/null +++ b/reference/paradigms/README.md @@ -0,0 +1,18 @@ +# Paradigms + +This directory contains files on paradigms, with links to the concepts that are commonly used in them. + +## Contributing + +Thanks for wanting to contribute to Exercism's paradigm reference documents! Contributions are very welcome! + +To contribute, check the list below to see which documents have been written. You can then contribute by submitting a PR to update an existing document. + +## References + +- [Declarative](./declarative.md) +- [Functional](./functional.md) +- [Imperative](./imperative.md) +- [Logic](./logic.md) +- [Object Oriented](./object-oriented.md) +- [Procedural](./procedural.md) diff --git a/reference/paradigms/_sidebar.md b/reference/paradigms/_sidebar.md new file mode 100644 index 0000000000..7d87f6c922 --- /dev/null +++ b/reference/paradigms/_sidebar.md @@ -0,0 +1,14 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Declarative](declarative.md) + - [Functional](functional.md) + - [Imperative](imperative.md) + - [Logic](logic.md) + - [Object Oriented](object-oriented.md) + - [Procedural](procedural.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) diff --git a/paradigms/declarative.md b/reference/paradigms/declarative.md similarity index 100% rename from paradigms/declarative.md rename to reference/paradigms/declarative.md diff --git a/paradigms/functional.md b/reference/paradigms/functional.md similarity index 100% rename from paradigms/functional.md rename to reference/paradigms/functional.md diff --git a/paradigms/imperative.md b/reference/paradigms/imperative.md similarity index 100% rename from paradigms/imperative.md rename to reference/paradigms/imperative.md diff --git a/paradigms/logic.md b/reference/paradigms/logic.md similarity index 100% rename from paradigms/logic.md rename to reference/paradigms/logic.md diff --git a/paradigms/object-oriented.md b/reference/paradigms/object-oriented.md similarity index 66% rename from paradigms/object-oriented.md rename to reference/paradigms/object-oriented.md index bc1e2da568..fe0925ee36 100644 --- a/paradigms/object-oriented.md +++ b/reference/paradigms/object-oriented.md @@ -8,12 +8,12 @@ Track-specific sub-concepts of these could be covered by specific track exercise ## Concepts -- [classes](../concepts/classes.md) -- [composition](../concepts/composition.md) -- [encapsulation](../concepts/encapsulation.md) -- [inheritance](../concepts/inheritance.md) -- [interfaces](../concepts/interfaces.md) -- [mutation](../concepts/mutation.md) -- [objects](../concepts/objects.md) -- [polymorphism](../concepts/polymorphism.md) -- [state](../concepts/state.md) +- [Classes](../concepts/classes.md) +- [Composition](../concepts/composition.md) +- [Encapsulation](../concepts/encapsulation.md) +- [Inheritance](../concepts/inheritance.md) +- [Interfaces](../concepts/interfaces.md) +- [Mutation](../concepts/mutation.md) +- [Objects](../concepts/objects.md) +- [Polymorphism](../concepts/polymorphism.md) +- [State](../concepts/state.md) diff --git a/paradigms/procedural.md b/reference/paradigms/procedural.md similarity index 100% rename from paradigms/procedural.md rename to reference/paradigms/procedural.md diff --git a/reference/tooling/README.md b/reference/tooling/README.md new file mode 100644 index 0000000000..32b15eab7d --- /dev/null +++ b/reference/tooling/README.md @@ -0,0 +1,15 @@ +# Tooling + +This directory contains files on tooling that is used by multiple languages. + +## Contributing + +Thanks for wanting to contribute to Exercism's tooling reference documents! Contributions are very welcome! + +To contribute, check the list below to see which documents have already been written. You can then contribute by submitting a PR to update an existing document, or to add a missing document. + +## References + +- [Babel](./babel.md) +- [.NET assemblies](./dotnet-assemblies.md) +- [JSDoc](./jsdoc.md) diff --git a/reference/tooling/_sidebar.md b/reference/tooling/_sidebar.md new file mode 100644 index 0000000000..d4517448eb --- /dev/null +++ b/reference/tooling/_sidebar.md @@ -0,0 +1,11 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Babel](/reference/tooling/babel.md) + - [.NET assemblies](/reference/tooling/dotnet-assemblies.md) + - [JSDoc](/reference/tooling/jsdoc.md) + - [Types](/reference/types/README.md) diff --git a/tooling/babel.md b/reference/tooling/babel.md similarity index 84% rename from tooling/babel.md rename to reference/tooling/babel.md index cd2d364eca..9c46c43ced 100644 --- a/tooling/babel.md +++ b/reference/tooling/babel.md @@ -4,4 +4,4 @@ Babel is a [JavaScript][language-javascript] compiler / transpiler. Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of [JavaScript][language-javascript] in current and older browsers or environments. -[language-javascript]: ../languages/javascript +[language-javascript]: ../../languages/javascript diff --git a/tooling/dotnet-assemblies.md b/reference/tooling/dotnet-assemblies.md similarity index 100% rename from tooling/dotnet-assemblies.md rename to reference/tooling/dotnet-assemblies.md diff --git a/tooling/jsdoc.md b/reference/tooling/jsdoc.md similarity index 92% rename from tooling/jsdoc.md rename to reference/tooling/jsdoc.md index c9f4cff796..e83f297710 100644 --- a/tooling/jsdoc.md +++ b/reference/tooling/jsdoc.md @@ -10,8 +10,8 @@ JSDoc is a markup language used to annotate [JavaScript][language-javascript] so - [Visual Studio][web-vs-studio], [WebStorm][web-webstorm] and many other Integrated development environments or Text Editors offer Code Completion and other assistance based on JSDoc comments. - Open source [Atom editor][web-atom] supports JSDoc via the [atom-easy-jsdoc][web-atom-plugin] plugin. -[language-javascript]: ../languages/javascript/README.md -[language-typescript]: ../languages/typescript/README.md +[language-javascript]: ../../languages/javascript/README.md +[language-typescript]: ../../languages/typescript/README.md [web-atom]: https://atom.io/ [web-atom-plugin]: https://atom.io/packages/atom-easy-jsdoc [web-closure-compiler]: https://developers.google.com/closure/ diff --git a/reference/types/README.md b/reference/types/README.md new file mode 100644 index 0000000000..0e14b1a501 --- /dev/null +++ b/reference/types/README.md @@ -0,0 +1,66 @@ +# Types + +These are types common to many different languages. Track-specific sub-types could be covered by specific track exercises. + +## Contributing + +Thanks for wanting to contribute to Exercism's type reference documents! Contributions are very welcome! + +To contribute, check the list below to see which documents have already been written. You can then contribute by submitting a PR to update an existing document, or to add a missing document. + +## References + +- [Array](./array.md) +- [Big integer](./big_integer.md) +- [Bit](./bit.md) +- [Boolean](./boolean.md) +- [Byte](./byte.md) +- [Bytes](./bytes.md) +- [Char](./char.md) +- [Class](./class.md) +- [Collection](./collection.md) +- [Date](./date.md) +- [Datetime](./datetime.md) +- [Decimal number](./decimal_number.md) +- [Deque](./deque.md) +- [Dictionary](./dictionary.md) +- [Double](./double.md) +- [Duration](./duration.md) +- [Error](./error.md) +- [Floating-point number](./floating_point_number.md) +- [Function](./function.md) +- [Future](./future.md) +- [Half](./half.md) +- [Hash map](./hash_map.md) +- [Integer](./integer.md) +- [List](./list.md) +- [Long](./long.md) +- [Map](./map.md) +- [Null](./null.md) +- [Nullable](./nullable.md) +- [Number](./number.md) +- [Object](./object.md) +- [Pair](./pair.md) +- [Pattern](./pattern.md) +- [Pointer](./pointer.md) +- [Product type](./product_type.md) +- [Promise](./promise.md) +- [Range](./range.md) +- [Record](./record.md) +- [Regular expression](./regular_expression.md) +- [Set](./set.md) +- [Short](./short.md) +- [Signed](./signed.md) +- [Single](./single.md) +- [Stack](./stack.md) +- [String](./string.md) +- [Struct](./struct.md) +- [Sum type](./sum_type.md) +- [Symbol](./symbol.md) +- [Time](./time.md) +- [Timestamp](./timestamp.md) +- [Triple](./triple.md) +- [Tuple](./tuple.md) +- [Undefined](./undefined.md) +- [Unsigned](./unsigned.md) +- [Word](./word.md) diff --git a/reference/types/_sidebar.md b/reference/types/_sidebar.md new file mode 100644 index 0000000000..ec8b85136e --- /dev/null +++ b/reference/types/_sidebar.md @@ -0,0 +1,62 @@ +- [Start here](/) +- Docs +- [Languages](/languages/README.md) +- [Reference](/reference/README.md) + - [Concepts](/reference/concepts/README.md) + - [Paradigms](/reference/paradigms/README.md) + - [Tooling](/reference/tooling/README.md) + - [Types](/reference/types/README.md) + - [Array](/reference/types/array.md) + - [Big integer](/reference/types/big_integer.md) + - [Bit](/reference/types/bit.md) + - [Boolean](/reference/types/boolean.md) + - [Byte](/reference/types/byte.md) + - [Bytes](/reference/types/bytes.md) + - [Char](/reference/types/char.md) + - [Class](/reference/types/class.md) + - [Collection](/reference/types/collection.md) + - [Date](/reference/types/date.md) + - [Datetime](/reference/types/datetime.md) + - [Decimal number](/reference/types/decimal_number.md) + - [Deque](/reference/types/deque.md) + - [Dictionary](/reference/types/dictionary.md) + - [Double](/reference/types/double.md) + - [Duration](/reference/types/duration.md) + - [Error](/reference/types/error.md) + - [Floating-point number](/reference/types/floating_point_number.md) + - [Function](/reference/types/function.md) + - [Future](/reference/types/future.md) + - [Half](/reference/types/half.md) + - [Hash map](/reference/types/hash_map.md) + - [Integer](/reference/types/integer.md) + - [List](/reference/types/list.md) + - [Long](/reference/types/long.md) + - [Map](/reference/types/map.md) + - [Null](/reference/types/null.md) + - [Nullable](/reference/types/nullable.md) + - [Number](/reference/types/number.md) + - [Object](/reference/types/object.md) + - [Pair](/reference/types/pair.md) + - [Pattern](/reference/types/pattern.md) + - [Pointer](/reference/types/pointer.md) + - [Product type](/reference/types/product_type.md) + - [Promise](/reference/types/promise.md) + - [Range](/reference/types/range.md) + - [Record](/reference/types/record.md) + - [Regular expression](/reference/types/regular_expression.md) + - [Set](/reference/types/set.md) + - [Short](/reference/types/short.md) + - [Signed](/reference/types/signed.md) + - [Single](/reference/types/single.md) + - [Stack](/reference/types/stack.md) + - [String](/reference/types/string.md) + - [Struct](/reference/types/struct.md) + - [Sum type](/reference/types/sum_type.md) + - [Symbol](/reference/types/symbol.md) + - [Time](/reference/types/time.md) + - [Timestamp](/reference/types/timestamp.md) + - [Triple](/reference/types/triple.md) + - [Tuple](/reference/types/tuple.md) + - [Undefined](/reference/types/undefined.md) + - [Unsigned](/reference/types/unsigned.md) + - [Word](/reference/types/word.md) diff --git a/types/array.md b/reference/types/array.md similarity index 100% rename from types/array.md rename to reference/types/array.md diff --git a/types/big_integer.md b/reference/types/big_integer.md similarity index 100% rename from types/big_integer.md rename to reference/types/big_integer.md diff --git a/types/bit.md b/reference/types/bit.md similarity index 100% rename from types/bit.md rename to reference/types/bit.md diff --git a/types/boolean.md b/reference/types/boolean.md similarity index 100% rename from types/boolean.md rename to reference/types/boolean.md diff --git a/types/byte.md b/reference/types/byte.md similarity index 100% rename from types/byte.md rename to reference/types/byte.md diff --git a/types/bytes.md b/reference/types/bytes.md similarity index 100% rename from types/bytes.md rename to reference/types/bytes.md diff --git a/types/char.md b/reference/types/char.md similarity index 100% rename from types/char.md rename to reference/types/char.md diff --git a/types/class.md b/reference/types/class.md similarity index 100% rename from types/class.md rename to reference/types/class.md diff --git a/types/collection.md b/reference/types/collection.md similarity index 100% rename from types/collection.md rename to reference/types/collection.md diff --git a/types/date.md b/reference/types/date.md similarity index 79% rename from types/date.md rename to reference/types/date.md index 3a3b311cb5..68c1c9ea92 100644 --- a/types/date.md +++ b/reference/types/date.md @@ -6,6 +6,11 @@ The difference between two dates may be representable by a [Duration][type-durat See also [DateTime][type-datetime] and [Time][type-time]. +# Implementations + +- [C#][implementation-csharp] + [type-datetime]: ./datetime.md [type-duration]: ./duration.md [type-time]: ./time.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/dates/.docs/introduction.md diff --git a/types/datetime.md b/reference/types/datetime.md similarity index 67% rename from types/datetime.md rename to reference/types/datetime.md index baf27c5610..5b1176ecb5 100644 --- a/types/datetime.md +++ b/reference/types/datetime.md @@ -4,6 +4,11 @@ A compound type combining [Date][type-date] and [Time][type-time] into one. Some The difference between two times may be representable by a [Duration][type-duration]. +# Implementations + +- [C#][implementation-csharp] + [type-date]: ./date.md [type-duration]: ./duration.md [type-time]: ./time.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/dates/.docs/introduction.md diff --git a/types/decimal_number.md b/reference/types/decimal_number.md similarity index 100% rename from types/decimal_number.md rename to reference/types/decimal_number.md diff --git a/types/deque.md b/reference/types/deque.md similarity index 100% rename from types/deque.md rename to reference/types/deque.md diff --git a/types/dictionary.md b/reference/types/dictionary.md similarity index 100% rename from types/dictionary.md rename to reference/types/dictionary.md diff --git a/types/double.md b/reference/types/double.md similarity index 68% rename from types/double.md rename to reference/types/double.md index a0a413bb59..a17bde2193 100644 --- a/types/double.md +++ b/reference/types/double.md @@ -4,6 +4,11 @@ Double is usually referring to Double-precision [floating-point][type-floating-p It's often _double_ the size of a [`single`][type-single]. +# Implementations + +- [C#][implementation-csharp] + [type-bit]: ./bit.md [type-floating-point]: ./floating_point_number.md [type-single]: ./single.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/numbers/.docs/introduction.md diff --git a/types/duration.md b/reference/types/duration.md similarity index 100% rename from types/duration.md rename to reference/types/duration.md diff --git a/types/error.md b/reference/types/error.md similarity index 100% rename from types/error.md rename to reference/types/error.md diff --git a/types/floating_point_number.md b/reference/types/floating_point_number.md similarity index 68% rename from types/floating_point_number.md rename to reference/types/floating_point_number.md index 7d4e80e57e..eba9dc9798 100644 --- a/types/floating_point_number.md +++ b/reference/types/floating_point_number.md @@ -10,8 +10,15 @@ Programming languages may name their floating point type to the amount of _preci - Quadruple (occupying 128 [bits][type-bit]) - Octuple (occupying 256 [bits][type-bit]) +# Implementations + +- [C# (basic)][implementation-csharp-basic] +- [C# (advanced)][implementation-csharp-advanced] + [type-bit]: ./bit.md [type-double]: ./double.md [type-half]: ./half.md [type-single]: ./single.md [wiki-ieee754]: https://en.wikipedia.org/wiki/IEEE_754 +[implementation-csharp-basic]: ../../languages/csharp/exercises/concept/numbers/.docs/introduction.md +[implementation-csharp-advanced]: ../../languages/csharp/exercises/concept/numbers-floating-point/.docs/introduction.md diff --git a/types/function.md b/reference/types/function.md similarity index 100% rename from types/function.md rename to reference/types/function.md diff --git a/types/future.md b/reference/types/future.md similarity index 100% rename from types/future.md rename to reference/types/future.md diff --git a/types/half.md b/reference/types/half.md similarity index 100% rename from types/half.md rename to reference/types/half.md diff --git a/types/hash_map.md b/reference/types/hash_map.md similarity index 100% rename from types/hash_map.md rename to reference/types/hash_map.md diff --git a/types/integer.md b/reference/types/integer.md similarity index 82% rename from types/integer.md rename to reference/types/integer.md index 9d1dc1f962..d9b944950f 100644 --- a/types/integer.md +++ b/reference/types/integer.md @@ -16,9 +16,14 @@ Various programming languages _limit_ the range of values a single integer can h - [Long][type-long] - [Word][type-word] +# Implementations + +- [C#][implementation-csharp] + [type-bit]: ./bit.md [type-byte]: ./byte.md [type-char]: ./char.md [type-long]: ./long.md [type-short]: ./short.md [type-word]: ./word.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/numbers/.docs/introduction.md diff --git a/types/list.md b/reference/types/list.md similarity index 100% rename from types/list.md rename to reference/types/list.md diff --git a/types/long.md b/reference/types/long.md similarity index 100% rename from types/long.md rename to reference/types/long.md diff --git a/types/map.md b/reference/types/map.md similarity index 100% rename from types/map.md rename to reference/types/map.md diff --git a/types/null.md b/reference/types/null.md similarity index 100% rename from types/null.md rename to reference/types/null.md diff --git a/types/nullable.md b/reference/types/nullable.md similarity index 100% rename from types/nullable.md rename to reference/types/nullable.md diff --git a/types/number.md b/reference/types/number.md similarity index 78% rename from types/number.md rename to reference/types/number.md index 8cf5b0dd4a..50da236c2b 100644 --- a/types/number.md +++ b/reference/types/number.md @@ -7,8 +7,12 @@ An number is a generic numeric type that often encompasses multiple more specifi - [JavaScript][language-javascript]'s `number` is a [double-precision 64 bit floating point format (IEEE 754)][wiki-number]. - [Kotlin][language-kotlin] has the following types to represent numbers: [`Byte`][type-byte], [`Short`][type-short], [`Int`][type-integer] and [`Long`][type-long], both [signed][type-signed] and [unsigned][type-unsigned]. These types can be inferred dynamically, or declared explicitly. Additionally it supports [`Float`][type-single] and [`Double`][type-double] for floating point numbers. -[language-javascript]: ../languages/javascript/README.md -[language-kotlin]: ../languages/kotlin/README.md +# Implementations + +- [C#][implementation-csharp] + +[language-javascript]: ../../languages/javascript/README.md +[language-kotlin]: ../../languages/kotlin/README.md [type-byte]: ./byte.md [type-double]: ./double.md [type-integer]: ./integer.md @@ -18,3 +22,4 @@ An number is a generic numeric type that often encompasses multiple more specifi [type-single]: ./single.md [type-unsigned]: ./unsigned.md [wiki-number]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format +[implementation-csharp]: ../../languages/csharp/exercises/concept/numbers/.docs/introduction.md diff --git a/types/object.md b/reference/types/object.md similarity index 100% rename from types/object.md rename to reference/types/object.md diff --git a/types/pair.md b/reference/types/pair.md similarity index 100% rename from types/pair.md rename to reference/types/pair.md diff --git a/types/pattern.md b/reference/types/pattern.md similarity index 100% rename from types/pattern.md rename to reference/types/pattern.md diff --git a/types/pointer.md b/reference/types/pointer.md similarity index 100% rename from types/pointer.md rename to reference/types/pointer.md diff --git a/types/product_type.md b/reference/types/product_type.md similarity index 100% rename from types/product_type.md rename to reference/types/product_type.md diff --git a/types/promise.md b/reference/types/promise.md similarity index 100% rename from types/promise.md rename to reference/types/promise.md diff --git a/types/range.md b/reference/types/range.md similarity index 100% rename from types/range.md rename to reference/types/range.md diff --git a/types/record.md b/reference/types/record.md similarity index 100% rename from types/record.md rename to reference/types/record.md diff --git a/types/regular_expression.md b/reference/types/regular_expression.md similarity index 100% rename from types/regular_expression.md rename to reference/types/regular_expression.md diff --git a/types/set.md b/reference/types/set.md similarity index 100% rename from types/set.md rename to reference/types/set.md diff --git a/types/short.md b/reference/types/short.md similarity index 100% rename from types/short.md rename to reference/types/short.md diff --git a/types/signed.md b/reference/types/signed.md similarity index 100% rename from types/signed.md rename to reference/types/signed.md diff --git a/types/single.md b/reference/types/single.md similarity index 100% rename from types/single.md rename to reference/types/single.md diff --git a/types/stack.md b/reference/types/stack.md similarity index 100% rename from types/stack.md rename to reference/types/stack.md diff --git a/types/string.md b/reference/types/string.md similarity index 75% rename from types/string.md rename to reference/types/string.md index 93091c8c9f..7b989273bf 100644 --- a/types/string.md +++ b/reference/types/string.md @@ -11,4 +11,4 @@ A string is a sequence of [characters][type-char] (letters, digits, punctuation, - [C#][implementation-csharp] [type-char]: ./char.md -[implementation-csharp]: ../languages/csharp/concept-exercises/strings/.docs/introduction.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/strings/.docs/introduction.md diff --git a/types/struct.md b/reference/types/struct.md similarity index 100% rename from types/struct.md rename to reference/types/struct.md diff --git a/types/sum_type.md b/reference/types/sum_type.md similarity index 100% rename from types/sum_type.md rename to reference/types/sum_type.md diff --git a/types/symbol.md b/reference/types/symbol.md similarity index 100% rename from types/symbol.md rename to reference/types/symbol.md diff --git a/types/time.md b/reference/types/time.md similarity index 75% rename from types/time.md rename to reference/types/time.md index 1f8d836f76..e55b247eec 100644 --- a/types/time.md +++ b/reference/types/time.md @@ -6,6 +6,11 @@ The difference between two times may be representable by a [Duration][type-durat See also [DateTime][type-datetime] and [Date][type-date]. +# Implementations + +- [C#][implementation-csharp] + [type-date]: ./date.md [type-datetime]: ./datetime.md [type-duration]: ./duration.md +[implementation-csharp]: ../../languages/csharp/exercises/concept/dates/.docs/introduction.md diff --git a/types/timestamp.md b/reference/types/timestamp.md similarity index 100% rename from types/timestamp.md rename to reference/types/timestamp.md diff --git a/types/triple.md b/reference/types/triple.md similarity index 100% rename from types/triple.md rename to reference/types/triple.md diff --git a/types/tuple.md b/reference/types/tuple.md similarity index 100% rename from types/tuple.md rename to reference/types/tuple.md diff --git a/types/undefined.md b/reference/types/undefined.md similarity index 100% rename from types/undefined.md rename to reference/types/undefined.md diff --git a/types/unsigned.md b/reference/types/unsigned.md similarity index 100% rename from types/unsigned.md rename to reference/types/unsigned.md diff --git a/types/word.md b/reference/types/word.md similarity index 100% rename from types/word.md rename to reference/types/word.md diff --git a/tooling/README.md b/tooling/README.md deleted file mode 100644 index f1241475c4..0000000000 --- a/tooling/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Tooling - -This directory contains files on tooling that is used by multiple languages. - diff --git a/types/README.md b/types/README.md deleted file mode 100644 index 74feb6ba19..0000000000 --- a/types/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Types - - -These are types common to many different languages. Track-specific sub-types could be covered by specific track exercises.