Changing the wording of the error messages


#1

When player code has an error, a error message appears.
1st on a larger font size is the proposed solution: example try this.findNearestEnemy()
2nd on a much smaller size is the actual error cause: example enimy not defined, or enemy is null

I am teaching young children and they are thrown off by these error messages because they try to jump and add the proposed solution to the code without reading or considering the error cause.

Sometimes the proposed solution does not work, and the real solution (correct the spelling on a variable name or add a if not-null test) requires the students to read the actual error cause.


#2

Indeed, the proposed fixes are not always 100% correct—after all, computers are extremely dumb machines and that is why we still have the job to program them. :smile:

What we can do is to analyze specific cases and improve the accuracy of the suggestions. Please post code samples that exhibit wrong suggestions when you spot those, so that we can debug and see what can be done to improve them.