ratfactor/ziglings

Use `role` instead of `class` for struct related exercises

niyue opened this issue · 1 comments

niyue commented

For exercises 37/38 about structs, there are some sample code like this:

// We'll use an enum to specify the character class.
const Class = enum {
    wizard,
    thief,
    bard,
    warrior,
};

// Please add a new property to this struct called "health" and make
// it a u8 integer type.
const Character = struct {
    class: Class,
    gold: u32,
    experience: u32,
    health: u32,
};

Since class is a keyword/feature in many other programming languages, such as Java/Python/C++, users with other programming language experiences probably have to pay special attention to tell if this is a new syntax for zig introduced in the new exercises. This seems unnecessary distraction, and we may change the wording from class to other word like role to avoid such issue. Just my two cents.

I agree, especially because it's a role play.