CodeYourFuture / CodeYourFuture/curriculum
Introduce error handling and try/catch (probably in Data Groups?)
- Dominant language
- HTML
- Stars
- 76
- Forks
- 135
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 20
Description
ITP currently doesn't introduce error handling. Both conceptually ("Think about something may go wrong, and do something about it") and practically ("try/catch/exceptions/throw").
This was originally a prereq of the Piscine. We'll skip over it for the first Piscine, but we'd like to re-add this as a prereq.
The "thinking about errors" piece is realistically more important than the practicality of try/catch etc. We want to be training people to be thinking about what can go wrong.
One flaw of how we've taught this in the past we'd like to avoid doing again is teaching `catch (err) { console.error(err); }` as a default action. I'd really like us to emphasise that if something goes wrong, either our code needs to work around it (e.g. with a retry), or we need to _display something to the user_. In the past a lot of our trainees have thought `console.error` is a valid way of telling a user something went wrong.
Data Groups probably has some spare time to throw in this extra topic, but open to discussion!
Contributor guide
Assessment
This issue has not been assessed yet.