Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

written assignment error handling #1140

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

TheMaja
Copy link
Contributor

@TheMaja TheMaja commented Oct 2, 2023

  • created new directory for javascript and python error handling
  • added java content

Related issues: [please specify]

Description:

What are you up to? Fill us in :)

I solemnly swear that:

  • I ran the hugo server and looked at my changed in the browser with my own eyes
  • I ran the linter and there were no errors
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

Comment on lines 80 to 84
raise error

raise "Some error"

raise {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these will be allowed in python, it will cause type errors.

Comment on lines 8 to 11
prerequisites:
hard:
- error-handling/javascript-error-handling
- error-handling/python-error-handling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the prerequisite correct?

Comment on lines 22 to 28
1. In your programming language, what is the fundamental purpose of error handling, and why is it crucial in software development?

2. In your programming language, what are some poor practices in error handling that developers should avoid? Provide examples if possible.

3. In your programming language, when should developers catch and handle errors, and what factors should influence this decision?

4. In your programming language, demonstrate how to raise a custom error with a specific error message. Write a code snippet that showcases this, and explain why it's essential to include clear error messages in custom exceptions.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I don't think the "In your programming language" part is necessary for questions that are general and don't involve code.
  • I think it would be good to have some code snippets related questions too and have the learner pick and explain certaint things like in the tdd written assignment.
  • I think a question about why we use try catch/except when handling errors would be good because most learners don't know that it's for graceful handling of errors instead of breaking the whole program when it's not necessary
  1. I think this should be one question, you can rephrase the it or remove the part from "and"
  2. I think we should explicitly say if we want the learners to provide examples and mention how many(E.g. "provide at least 1 example")
  3. I think this could be rephrased to one question or the last part of the question removed or made it's own question
  • We should also link to the submission instructions for written assignments

Copy link
Contributor

@Ngoakor12 Ngoakor12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The prerequisite are wrong. E.g. If you are doing web dev, you won't be able to work on this assignment because you haven't done the java and python error handling topics
  • I also think we should try and follow the test-driven development written assignments(umuzi/ACN-syllabus/content/topics/test-driven-development-questions/_index.md) as much as possible. This means: creating a topic that covers general info about error handling. E.g. the intro of each topic since it's being repeated in each language topic. Then in that topic we can link to language specific topics for error handling. We can then link this new topic as the prerequisite to this assignment


1. What is the fundamental purpose of error handling?

2. What are some poor practices in error handling that developers should avoid? Provide 1 example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In your programming language" should be mentioned somewhere in this sentence since we require an example

}
```

please select and write one snippet that is a good example of error handling.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "In your programming language", should also be included in this sentence.
  • We could also ask them to explain why.
  • Which example would you say is good in the snippets? I think the "good" example could be improved. E.g.
try {
  // Code...
} catch (error) {
	throw new Error(`Unexpected error occured while doing ${action} with ${computerSpecs}. Error stack: ${JSON.stringify(error.stack)}`)
}

This is just an example of rethrowing with more context while not ignoring the caught error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants