Lessons

D · Introductory

D · Introductory. Ten lessons. Open-book quizzes. Lesson 1 free.

10 lessons · The Host · Lesson 1 free

Pass all ten lessons for the certificate. Sample · Claim

  1. Program structure

    Lesson 1 · On the house

    Program structure

    A D source file, main, imports from Phobos, writeln, and compiling with dmd, ldc2, or gdc.

  2. Variables and types

    Lesson 2

    Variables and types

    Built-in types with fixed sizes, auto inference, default initialization, const and immutable, and casts.

  3. Decisions

    Lesson 3

    Decisions

    if/else, the ternary operator, switch on integers and strings, case ranges, and final switch.

  4. Loops

    Lesson 4

    Loops

    while, do-while, for, foreach over ranges and arrays with index, labeled break and continue.

  5. Functions

    Lesson 5

    Functions

    Passing parameters by value, ref, out, and in, plus default arguments, overloading, UFCS, and nested functions.

  6. Arrays and slices

    Lesson 6

    Arrays and slices

    Static arrays, dynamic arrays, slicing, appending with ~=, length, and bounds checks.

  7. Strings

    Lesson 7

    Strings

    string as immutable(char)[], UTF-8, concatenation, std.string helpers, std.format, and conversions.

  8. Associative arrays

    Lesson 8

    Associative arrays

    Built-in hash maps: V[K], insert, in lookups, get with default, remove, keys, values, and iteration.

  9. Structs

    Lesson 9

    Structs

    Value types with fields, methods, constructors, default values, static members, and toString.

  10. Enums and modules

    Lesson 10

    Enums and modules

    Named enums with base types, enum properties, std.conv for names, and splitting code into modules.

Sample certificate

Certificate of completion

Sign in to claim your certificate of completion.

Certificate

Finish all ten lessons, then sign in

Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.

All lessons