Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.2

Type to search the documentation.

    한국어
    Xen / coding-class v0.1.0-demo.2

    Coding Class

    After reading a concept, solve an exercise, build a program, and fix an error. Each class follows exercise → program project → debugging. Start from requirements and completion criteria before consulting hints.

    1. Exercise — choose your path: List the basic chapters from installation through testing. If you can already build a small tool, identify the first advanced chapter. Completion: explain that scope modes begin the advanced path.
    2. Build a program — define your first goal: Plan a file word counter, recording input files, expected counts, and a failure case. Completion: one two gives 2, an empty file gives 0, and an absent path gives an error. Implement it in the word-counter class.
    3. Debug — locate the failing stage: Classify “command not found,” “type mismatch,” and “runtime index out of bounds” as environment, checking, or execution problems. Choose the first diagnostic action for each. Completion: choose command -v xen, xen check, and xen run respectively, and explain why editing source alone cannot fix command lookup.
    ClassExercise and project focus
    Installing XenEnvironment, workspace, PATH
    Your first programOutput order, executables, source paths
    Variables and valuesValue tracing, receipts, mutability
    Data types and conversionsDivision, averages, numeric mismatches
    Functions and control flowRanges, even totals, return paths
    Strings and collectionsBytes and words, score summaries, empty input
    Structs and enumsStates, task cards, missing match branches
    Missing values and errorsOption, input conversion, ? errors
    Working with multiple filesModule paths, shop totals, declarations
    Build a word counterFile boundaries, multiple files, arguments
    Testing your codeFilters, word-count regression, endpoint bugs

    Advanced practice starts with scope modes. Choose how to modify, borrow, transfer, and optimize, and check the resulting restrictions.

    ClassExercise and project focus
    Scope modesReference scopes, opt experiments, caller annotations
    Copies, moves, and referencesIndependent copies, updates, borrow errors
    Generics and type inferenceType arguments, fallbacks, inference errors
    Slices and iteratorsPipeline order, box consumption, view lifetimes
    Box and recursive dataLink termination, list length, moved owners

    Use a separate file per task. Check and run ordinary programs; use xen test for test-only files. Debugging starters fail intentionally. Record the cause, fix it, and rerun the original and boundary inputs. These are self-checked exercises: use each page’s completion criteria.

    Return through Read the Learn chapter when you need a concept. Classes follow the same order as the learning roadmap, so you can alternate between the tabs.