You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
Commit c620e13
Browse filesBrowse the repository at this point in the historyBrowse files
Web 0.14.1: Drei Arten von Fehlern, rote Zeilennummer bei Fehlern
- L7: neuer Schritt „Drei Arten von Fehlern“ (Syntax-, Laufzeit-, Logikfehler)
mit den Meldungen der App, Kompetenz, zwei Wissenstest-Fragen
- L20: rote Zeilennummer, Debugger für Logikfehler, Kompetenz und Frage
- L22: Exception = Laufzeitfehler; Glossar mit den drei Begriffen (de/en/pt)
- Bereich Programmieren: Zeilennummer der Fehlerzeile wird rot (Syntax-
probleme und Abbruchzeile), Konsole nennt die Zeile des Laufzeitfehlers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ugz28UvRVgxHGG62rH4ie7
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ The format is loosely inspired by Keep a Changelog.
8
8
9
9
### Changed
10
10
11
+
-**Web 0.14.1, three kinds of errors and red line numbers:** lesson 7 gets the new step „Drei Arten von Fehlern“ (syntax error, runtime error, logic error, with the app's own messages), a Kompetenz item and two quiz questions; lesson 20 explains the red line number and calls the debugger the tool for logic errors (plus Kompetenz and quiz question); lesson 22 calls an exception a runtime error; glossary entries Syntaxfehler, Laufzeitfehler, Logikfehler (de/en/pt). In the Programming area the line number of an error turns red (syntax problems and the line where the run stopped), and the console names the line of a runtime error, e.g. „Zeile 3: Division durch null.“ The round red dot stays the breakpoint.
11
12
-**Web 0.13.37, no coffee cup and a better camel in lesson 4:** the coffee cup drawing in step „Jetzt in Java“ is removed again (Holger's decision). The camel for camelCase is redrawn to look more like a camel: long legs with knees and broad feet, U-shaped neck, longer snout, tail with tuft.
12
13
-**Web 0.13.34, camel for camelCase and coffee cup for Java in lesson 4:** below the Angeberwissen on CamelCase a drawing of a two-humped camel whose humps sit under the capitals of `preisMitSteuer` (en `priceWithTax`, pt `precoComIva`), with a caption (de/en/pt). Step „Jetzt in Java“ shows a steaming coffee cup with `{ }` on it (own drawing, deliberately not the Java logo, which is an Oracle trademark), caption: „Java“ is American slang for coffee (de/en/pt). Own SVG drawings, no third-party licence.
13
14
-**Web 0.13.33, clearer competence in lesson 6:** „vor der Ausgabe in einer Variablen rechnen“ now reads „ein Ergebnis zuerst ausrechnen und in einer Variablen speichern, dann diese Variable ausgeben, z. B. `int summe = a + b`, danach `output: summe`“, in the competences step and the „Ich kann“ checklist (de/en/pt).
Copy file name to clipboardExpand all lines: web/lessons/de/07-simulation-und-schreibtischtest.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ kurz: Ein Struktogramm Schritt für Schritt ausführen, von Hand nachrechnen und
10
10
- die Simulation starten, anhalten, einzelne Schritte ausführen und stoppen
11
11
- während der Simulation Variablen, Ausgabe und den letzten Schritt ablesen
12
12
- einen Schreibtischtest als Tabelle von Hand durchführen
13
+
- Syntaxfehler, Laufzeitfehler und Logikfehler unterscheiden
13
14
- einen Fehler finden, indem ich die Werte mit meiner Erwartung vergleiche
14
15
- Java-Code mit dem Einzelschritt und Haltepunkten verfolgen
15
16
:::
@@ -65,9 +66,25 @@ Vergleiche danach deine Tabelle mit der Simulation. Stimmen die Werte unter **Va
65
66
66
67
> Der Schreibtischtest lohnt sich besonders in Prüfungen. Dort hast du keinen Computer, aber du kannst trotzdem zeigen, was dein Struktogramm tut.
67
68
69
+
## Drei Arten von Fehlern
70
+
71
+
Fehler gehören zum Programmieren dazu, auch bei Profis. Man unterscheidet drei Arten, denn jede findest du auf einem anderen Weg:
72
+
73
+
-**Syntaxfehler** (syntax error): Der Text hält sich nicht an die Regeln der Sprache, z. B. fehlt am Ende ein `;`. Das Programm startet gar nicht.
74
+
-**Laufzeitfehler** (runtime error): Das Programm startet, bricht aber an einer Stelle ab, z. B. beim Teilen durch 0.
75
+
-**Logikfehler** (logic error): Das Programm läuft bis zum Ende, aber das Ergebnis ist falsch, z. B. weil Klammern fehlen: `a + b / 2` statt `(a + b) / 2`.
76
+
77
+
So zeigt dir VisuStruct die Fehler:
78
+
79
+
-**Syntaxfehler:** Im Struktogramm passieren sie seltener, weil die Kästen die Form vorgeben. Im Bereich [Programmieren](#zeige-codelive) wird die Stelle rot unterstrichen, die Zeilennummer wird rot, und dazu steht z. B. **Zeile 2: Hier fehlt noch: ;**.
80
+
-**Laufzeitfehler:** Die Simulation bleibt auf dem Kasten stehen und meldet z. B. **Division durch null.** Im Bereich Programmieren wird die Zeilennummer rot, und die [Konsole](#zeige-konsole) nennt die Zeile: **Zeile 3: Division durch null.**
81
+
-**Logikfehler:** Hier meldet niemand etwas. Der Computer weiß nicht, was du eigentlich wolltest. Nur du kennst das richtige Ergebnis, darum hilft hier der Schreibtischtest.
82
+
83
+
> Eine rote Zeilennummer zeigt einen Fehler. Der runde rote Punkt vor der Zeilennummer ist etwas anderes: ein Haltepunkt. Den lernst du unten bei „Jetzt in Java“ kennen.
84
+
68
85
## Fehler finden
69
86
70
-
Gibt ein Struktogramm etwas Falsches aus, gehst du so vor:
87
+
Gibt ein Struktogramm etwas Falsches aus, ist das ein Logikfehler. Dann gehst du so vor:
71
88
72
89
1.**Erwartung aufschreiben:** Was soll bei einer bestimmten Eingabe herauskommen?
73
90
2.**Schritt für Schritt ausführen:** Starte die Simulation mit **Schritt** und beobachte die Variablen.
@@ -246,6 +263,7 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
246
263
- Ich kann die Simulation starten, anhalten, einzelne Schritte ausführen und stoppen. → Die Simulation starten
247
264
- Ich kann während der Simulation Variablen, Ausgabe und den letzten Schritt ablesen. → Was die Simulation anzeigt
248
265
- Ich kann einen Schreibtischtest als Tabelle von Hand durchführen. → Der Schreibtischtest
266
+
- Ich kann Syntaxfehler, Laufzeitfehler und Logikfehler unterscheiden. → Drei Arten von Fehlern
249
267
- Ich kann einen Fehler finden, indem ich die Werte mit meiner Erwartung vergleiche. → Fehler finden
250
268
- Ich kann Java-Code mit dem Einzelschritt und Haltepunkten verfolgen. → Jetzt in Java
251
269
:::
@@ -292,4 +310,16 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
292
310
-[x] Das Programm hält vor dieser Zeile an.
293
311
-[ ] Die Zeile wird übersprungen.
294
312
> Das ist ein Haltepunkt. Mit ▶︎ oder dem Einzelschritt geht es weiter.
313
+
? Ordne jedem Fehler seine Fehlerart zu.
314
+
→ Drei Arten von Fehlern
315
+
= Am Zeilenende fehlt das Semikolon. -> Syntaxfehler
316
+
= Das Programm teilt durch 0 und bricht ab. -> Laufzeitfehler
317
+
= Der Durchschnitt ist zu groß, weil Klammern fehlen. -> Logikfehler
318
+
319
+
? Das Programm läuft ohne Meldung bis zum Ende, gibt aber 12 statt 21 aus. Welche Fehlerart ist das?
320
+
→ Drei Arten von Fehlern
321
+
-[ ] Syntaxfehler
322
+
-[ ] Laufzeitfehler
323
+
-[x] Logikfehler
324
+
> Es gibt keine Meldung, das Ergebnis ist trotzdem falsch. So einen Fehler findest du nur mit deiner Erwartung und dem Schreibtischtest.
Copy file name to clipboardExpand all lines: web/lessons/de/20-java.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ kurz: Alle Elemente in Java auf einen Blick, Code erzeugen, im Bereich Programmi
13
13
- ein kurzes Java-Programm als Struktogramm nachbauen
14
14
- im Bereich Programmieren Java tippen und das entstehende Struktogramm lesen
15
15
- ein Programm mit ▶︎ ausführen und Ein- und Ausgaben in der Konsole nutzen
16
+
- an der roten Zeilennummer einen Syntaxfehler oder Laufzeitfehler finden
16
17
- Haltepunkte setzen und ein Programm im Einzelschritt verfolgen
17
18
:::
18
19
@@ -135,6 +136,8 @@ Oben im Bereich Programmieren startet [▶︎ Ausführen](#zeige-ausfuehren) dei
135
136
136
137
Die Grenze zwischen Code und Konsole kannst du mit der Maus nach oben oder unten ziehen.
137
138
139
+
Geht etwas schief, wird die Zeilennummer rot. Bei einem Syntaxfehler ist die Stelle zusätzlich rot unterstrichen, und es steht z. B. **Zeile 2: Hier fehlt noch: ;** darunter. Dann startet ▶︎ das Programm gar nicht erst. Bricht das Programm beim Ausführen ab, ist es ein Laufzeitfehler, und die Konsole nennt die Zeile, z. B. **Zeile 3: Division durch null.** Die drei Fehlerarten kennst du aus der Lektion „Simulation und Schreibtischtest“.
140
+
138
141
> Der Bereich Programmieren versteht die Java-Befehle, die es auch als Kasten im Struktogramm gibt. Eigene Klassen und Objekte kennt es noch nicht. Fenster mit Swing gehen trotzdem: Schalte dafür im Zahnrad **Echtes Java (mit Swing)** ein (Lektion „Dein erstes Fenster“).
139
142
140
143
::: angeberwissen
@@ -143,7 +146,7 @@ Profis nennen ein Programm, in dem man Code schreibt, ausführt und Fehler sucht
143
146
144
147
## Fehler suchen mit dem Debugger
145
148
146
-
Manchmal läuft ein Programm, rechnet aber falsch. Dann hilft der **Debugger**: Er führt dein Programm langsam aus, und du schaust ihm dabei zu.
149
+
Manchmal läuft ein Programm, rechnet aber falsch. Das ist ein Logikfehler. Dann hilft der **Debugger**: Er führt dein Programm langsam aus, und du schaust ihm dabei zu.
147
150
148
151
-**Haltepunkt:** Klicke links auf eine Zeilennummer. Ein roter Punkt erscheint. [▶︎ Ausführen](#zeige-ausfuehren) hält vor dieser Zeile an. Ein zweiter Klick nimmt den Punkt wieder weg.
149
152
-**Gelbe Zeile:** Sie wird als Nächstes ausgeführt. Im Struktogramm ist der passende Kasten markiert.
@@ -329,6 +332,7 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
329
332
- Ich kann ein kurzes Java-Programm als Struktogramm nachbauen. → Übung: Java als Struktogramm
330
333
- Ich kann im Bereich Programmieren Java tippen und das entstehende Struktogramm lesen. → Java direkt schreiben
331
334
- Ich kann ein Programm mit ▶︎ ausführen und Ein- und Ausgaben in der Konsole nutzen. → Das Programm ausführen
335
+
- Ich kann an der roten Zeilennummer einen Syntaxfehler oder Laufzeitfehler finden. → Das Programm ausführen
332
336
- Ich kann Haltepunkte setzen und ein Programm im Einzelschritt verfolgen. → Fehler suchen mit dem Debugger
333
337
:::
334
338
@@ -368,4 +372,10 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
368
372
-[x] Das Programm hält vor dieser Zeile an.
369
373
-[ ] Die Zeile enthält einen Fehler.
370
374
> Das ist ein Haltepunkt. Danach geht es mit ▶︎ oder dem Einzelschritt weiter.
375
+
? Die Zeilennummer 3 im Bereich Programmieren ist rot. Was heißt das?
376
+
→ Das Programm ausführen
377
+
-[ ] In Zeile 3 ist ein Haltepunkt.
378
+
-[x] In Zeile 3 steckt ein Fehler.
379
+
-[ ] Zeile 3 wird als Nächstes ausgeführt.
380
+
> Der Haltepunkt ist ein runder roter Punkt, die nächste Zeile ist gelb. Eine rote Zeilennummer zeigt einen Syntaxfehler oder einen Laufzeitfehler.
Copy file name to clipboardExpand all lines: web/lessons/de/22-try-und-catch.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ So eine Meldung sieht erst einmal erschreckend aus. Sie verrät dir aber genau,
77
77
|`3`| Der falsche Index. |
78
78
|`Noten.java:5`| Die Zeile, in der es passiert ist: Zeile 5. |
79
79
80
-
So einen Fehler zur Laufzeit nennt Java eine **Exception** (englisch für Ausnahme). Man sagt: Java *wirft* eine Exception. Fängt sie niemand auf, bricht das Programm ab. Deshalb erscheint „Fertig!“ nicht.
80
+
So einen Laufzeitfehler nennt Java eine **Exception** (englisch für Ausnahme). Man sagt: Java *wirft* eine Exception. Fängt sie niemand auf, bricht das Programm ab. Deshalb erscheint „Fertig!“ nicht.
81
81
82
82
::: ludwig
83
83
Lies Fehlermeldungen immer von oben: Erst der Name der Exception, dann die Zeilennummer. Die Zeilennummern stehen im Bereich Programmieren links neben dem Code.
Copy file name to clipboardExpand all lines: web/lessons/en/07-simulation-und-schreibtischtest.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ kurz: Run a structure chart step by step, work it out by hand and find mistakes.
10
10
- start the simulation, pause it, run single steps and stop it
11
11
- read the variables, the output and the last step during the simulation
12
12
- do a desk check by hand as a table
13
+
- tell syntax errors, runtime errors and logic errors apart
13
14
- find a mistake by comparing the values with what I expect
14
15
- follow Java code with Step and breakpoints
15
16
:::
@@ -65,9 +66,25 @@ Then compare your table with the simulation. Do the values under **Variables** m
65
66
66
67
> A desk check is especially useful in tests. There you have no computer, but you can still show what your structure chart does.
67
68
69
+
## Three kinds of errors
70
+
71
+
Errors are part of programming, even for professionals. There are three kinds, and you find each of them in a different way:
72
+
73
+
-**Syntax error**: The text breaks the rules of the language, e.g. a `;` is missing at the end. The program does not start at all.
74
+
-**Runtime error**: The program starts but stops at one point, e.g. when it divides by 0.
75
+
-**Logic error**: The program runs to the end, but the result is wrong, e.g. because brackets are missing: `a + b / 2` instead of `(a + b) / 2`.
76
+
77
+
This is how VisuStruct shows you the errors:
78
+
79
+
-**Syntax error:** They happen less often in a structure chart, because the boxes give you the shape. In the [Programming](#zeige-codelive) area the spot is underlined in red, the line number turns red, and you read e.g. **Line 2: Still missing here: ;**.
80
+
-**Runtime error:** The simulation stops on the box and reports e.g. **Division by zero.** In the Programming area the line number turns red, and the [console](#zeige-konsole) names the line: **Line 3: Division by zero.**
81
+
-**Logic error:** Nobody reports anything here. The computer does not know what you actually wanted. Only you know the right result, so the desk check helps here.
82
+
83
+
> A red line number shows an error. The round red dot in front of the line number is something else: a breakpoint. You will meet it below in “Now in Java”.
84
+
68
85
## Find mistakes
69
86
70
-
If a structure chart outputs something wrong, do this:
87
+
If a structure chart outputs something wrong, that is a logic error. Then do this:
71
88
72
89
1.**Write down what you expect:** What should come out for a particular input?
73
90
2.**Run it step by step:** Start the simulation with **Step** and watch the variables.
@@ -246,6 +263,7 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
246
263
- I can start the simulation, pause it, run single steps and stop it. → Start the simulation
247
264
- I can read the variables, the output and the last step during the simulation. → What the simulation shows
248
265
- I can do a desk check by hand as a table. → The desk check
266
+
- I can tell syntax errors, runtime errors and logic errors apart. → Three kinds of errors
249
267
- I can find a mistake by comparing the values with what I expect. → Find mistakes
250
268
- I can follow Java code with Step and breakpoints. → Now in Java
251
269
:::
@@ -292,4 +310,16 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
292
310
-[x] The program pauses before this line.
293
311
-[ ] The line is skipped.
294
312
> That is a breakpoint. ▶︎ or Step carries on.
313
+
? Match each error to its kind.
314
+
→ Three kinds of errors
315
+
= The semicolon at the end of the line is missing. -> Syntax error
316
+
= The program divides by 0 and stops. -> Runtime error
317
+
= The average is too big because brackets are missing. -> Logic error
318
+
319
+
? The program runs to the end without any message but prints 12 instead of 21. What kind of error is that?
320
+
→ Three kinds of errors
321
+
-[ ] Syntax error
322
+
-[ ] Runtime error
323
+
-[x] Logic error
324
+
> There is no message, but the result is still wrong. You only find an error like this with your expectation and a desk check.
Copy file name to clipboardExpand all lines: web/lessons/en/20-java.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ kurz: All elements in Java at a glance, generate code, write Java in the Program
13
13
- rebuild a short Java program as a structure chart
14
14
- type Java in the Programming area and read the structure chart that is built
15
15
- run a program with ▶︎ and use input and output in the console
16
+
- find a syntax error or a runtime error by its red line number
16
17
- set breakpoints and follow a program step by step
17
18
:::
18
19
@@ -135,6 +136,8 @@ At the top of the Programming area, [▶︎ Run](#zeige-ausfuehren) starts your
135
136
136
137
You can drag the border between code and console up or down with the mouse.
137
138
139
+
If something goes wrong, the line number turns red. With a syntax error the spot is also underlined in red, and below it you read e.g. **Line 2: Still missing here: ;**. Then ▶︎ does not even start the program. If the program stops while it runs, it is a runtime error, and the console names the line, e.g. **Line 3: Division by zero.** You know the three kinds of errors from the lesson “Simulation and desk check”.
140
+
138
141
> The Programming area understands the Java commands that also exist as boxes in the structure chart. It does not know your own classes and objects yet. Windows with Swing work anyway: turn on **Real Java (with Swing)** under the gear (lesson “Your first window”).
139
142
140
143
::: angeberwissen
@@ -143,7 +146,7 @@ Professionals call a program where you write code, run it and look for mistakes
143
146
144
147
## Find mistakes with the debugger
145
148
146
-
Sometimes a program runs but calculates something wrong. Then the **debugger** helps: it runs your program slowly while you watch.
149
+
Sometimes a program runs but calculates something wrong. That is a logic error. Then the **debugger** helps: it runs your program slowly while you watch.
147
150
148
151
-**Breakpoint:** Click a line number on the left. A red dot appears. [▶︎ Run](#zeige-ausfuehren) pauses before this line. Click again to remove the dot.
149
152
-**Yellow line:** This line runs next. The matching box is selected in the structure chart.
@@ -329,6 +332,7 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
329
332
- I can rebuild a short Java program as a structure chart. → Exercise: Java as a structure chart
330
333
- I can type Java in the Programming area and read the structure chart that is built. → Write Java directly
331
334
- I can run a program with ▶︎ and use input and output in the console. → Run the program
335
+
- I can find a syntax error or a runtime error by its red line number. → Run the program
332
336
- I can set breakpoints and follow a program step by step. → Find mistakes with the debugger
333
337
:::
334
338
@@ -368,4 +372,10 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
368
372
-[x] The program pauses before this line.
369
373
-[ ] The line contains a mistake.
370
374
> That is a breakpoint. Continue with ▶︎ or Step.
375
+
? Line number 3 in the Programming area is red. What does that mean?
376
+
→ Run the program
377
+
-[ ] There is a breakpoint in line 3.
378
+
-[x] There is an error in line 3.
379
+
-[ ] Line 3 runs next.
380
+
> A breakpoint is a round red dot, and the next line is yellow. A red line number shows a syntax error or a runtime error.
Copy file name to clipboardExpand all lines: web/lessons/en/22-try-und-catch.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ A message like this looks scary at first. But it tells you exactly what is going
77
77
|`3`| The wrong index. |
78
78
|`Grades.java:5`| The line where it happened: line 5. |
79
79
80
-
Java calls an error like this, at run time, an **exception**. We say: Java *throws* an exception. If nobody catches it, the program stops. That is why “Done!” does not appear.
80
+
Java calls a runtime error like this an **exception**. We say: Java *throws* an exception. If nobody catches it, the program stops. That is why “Done!” does not appear.
81
81
82
82
::: ludwig
83
83
Always read error messages from the top: first the name of the exception, then the line number. In the Programming area the line numbers are on the left next to the code.
0 commit comments