Skip to content

Improve learning experience for interfaces, errors and error wrapping #2492

@junedev

Description

@junedev

[This is a dummy issue for now to keep track of this improvement idea. More detailed issues that can be worked on will be created later. If someone wants to work beforehand, please comment below and we can discuss.]

In JavaScript, teaching inheritance together with errors works very well which is why I thought a similar combination might work out in Go. But I think it's not working very well, interfaces are quite a big topic in Go so we currently only scratch the surface in the existing "The Farm" exercise. We don't practice creating an interface currently, people don't understand the difference between unwrapping an error and not unwrapping, etc. To fix this I think it would be good to have one exercise to teach interfaces with tasks that include creating and interface and using an existing one etc. Then we can have an errors concept that includes error wrapping and shows unwrapping and not unwrapping in error handling "side by side" so people better understand the difference and can practice in the exercise. The new interfaces exercise will then be a prerequisite for the errors exercise.

Sequence:

  • Create new separate exercise for interfaces
  • Remove learning interfaces from the errors exercise
  • Simplify existing error concept and exercise
  • Create new error wrapping concept and exercise

Metadata

Metadata

Assignees

Labels

x:rep/mediumMedium amount of reputation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions