-
-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
Going through this guide and enjoying it so far. I'm writing this issue to ask whether it would benefit the website if the code samples used more descriptive names for things like constants, variables, and tests. In quite a few cases it feels like they were written temporarily and not refactored.
I would be happy to make PRs toward this, just thought I'd make an issue first to make sure that this is something worth doing.
Examples:
test "hmm" {
Mode.count += 1;
try expect(Mode.count == 1);
}Suggestion:
test "enum namespaced variable" {
Mode.count += 1;
try expect(Mode.count == 1);
}test "automatic dereference" {
var thing = Stuff{ .x = 10, .y = 20 };
thing.swap();
try expect(thing.x == 20);
try expect(thing.y == 10);
}Suggestion:
test "automatic dereference" {
var p = Point{ .x = 10, .y = 20 };
p.swap();
try expect(p.x == 20);
try expect(p.y == 10);
}The official zigs documentation on structs also seems to use Point as an example, not that it really matters.
Sobeston and jeramyRR
Metadata
Metadata
Assignees
Labels
No labels