Codele / Programming basics
Reading errors and fixing bugs
Every programmer meets errors every day. They are not failures: they are clues. Pick a kind of trouble and learn to read it.
- A syntax error is a grammar mistake. The translator refuses to start and points at the line.
- A runtime error (a crash) happens while the program runs. The program stops at that line.
- A logic bug runs fine but gives the wrong answer. No message appears, so you must compare with what you expected.
- Read an error message from the line number, then the last line: it names the kind of error.
- Fix one thing, run again, and read the next clue. Errors are normal.
Loading the playable lesson…