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 0261a5a
Browse filesBrowse the repository at this point in the historyBrowse files
Web 0.14.15: Drei Arten von Fehlern, rote Zeilennummer, Glühbirne mit Vorschlägen
- L7: neuer Schritt „Drei Arten von Fehlern“ (Syntax-, Laufzeit-, Logikfehler)
mit den Meldungen der App, Kompetenz, zwei Wissenstest-Fragen
- L20: rote Zeilennummer, Glühbirne, Debugger für Logikfehler, Kompetenz, Frage
- L22: Exception = Laufzeitfehler; Glossar mit den drei Begriffen (de/en/pt)
- Bereich Code: Zeilennummer der Fehlerzeile wird rot, Konsole nennt die
Zeile des Laufzeitfehlers, 💡 am Zeilenende übernimmt per Klick den
Vorschlag (import, Scanner, ; oder ), vertippter Datentyp)
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.15, three kinds of errors, red line numbers and a light bulb with suggestions:** 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 the light bulb 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 Code area the line number of an error turns red (syntax problems and the line where the run stopped), the console names the line of a runtime error (e.g. „Zeile 3: Division durch null.“), and a 💡 at the end of the line offers a fix when VisuStruct knows it (missing `import`, missing `Scanner … = new Scanner(System.in);`, missing `;` or `)`, misspelled data type such as `Strng` → `String`); hover shows it, a click applies it. 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
:::
@@ -79,9 +80,25 @@ Ihre Kollegin Dorothy Vaughan merkte früh, dass die IBM-Computer die Rechenarbe
79
80
Katherine Johnson (1918–2020), Mathematikerin bei der NASA (Foto: [NASA](https://commons.wikimedia.org/wiki/File:Katherine_Johnson_1983.jpg), gemeinfrei).
80
81
:::
81
82
83
+
## Drei Arten von Fehlern
84
+
85
+
Fehler gehören zum Programmieren dazu, auch bei Profis. Man unterscheidet drei Arten, denn jede findest du auf einem anderen Weg:
86
+
87
+
-**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.
88
+
-**Laufzeitfehler** (runtime error): Das Programm startet, bricht aber an einer Stelle ab, z. B. beim Teilen durch 0.
89
+
-**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`.
90
+
91
+
So zeigt dir VisuStruct die Fehler:
92
+
93
+
-**Syntaxfehler:** Im Struktogramm passieren sie seltener, weil die Kästen die Form vorgeben. Im Bereich [Code](#zeige-codelive) wird die Stelle rot unterstrichen, die Zeilennummer wird rot, und dazu steht z. B. **Zeile 2: Hier fehlt noch: ;**.
94
+
-**Laufzeitfehler:** Die Simulation bleibt auf dem Kasten stehen und meldet z. B. **Division durch null.** Im Bereich Code wird die Zeilennummer rot, und die [Konsole](#zeige-konsole) nennt die Zeile: **Zeile 3: Division durch null.**
95
+
-**Logikfehler:** Hier meldet niemand etwas. Der Computer weiß nicht, was du eigentlich wolltest. Nur du kennst das richtige Ergebnis, darum hilft hier der Schreibtischtest.
96
+
97
+
> 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.
98
+
82
99
## Fehler finden
83
100
84
-
Gibt ein Struktogramm etwas Falsches aus, gehst du so vor:
101
+
Gibt ein Struktogramm etwas Falsches aus, ist das ein Logikfehler. Dann gehst du so vor:
85
102
86
103
1.**Erwartung aufschreiben:** Was soll bei einer bestimmten Eingabe herauskommen?
87
104
2.**Schritt für Schritt ausführen:** Starte die Simulation mit **Schritt** und beobachte die Variablen.
@@ -266,6 +283,7 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
266
283
- Ich kann die Simulation starten, anhalten, einzelne Schritte ausführen und stoppen. → Die Simulation starten
267
284
- Ich kann während der Simulation Variablen, Ausgabe und den letzten Schritt ablesen. → Was die Simulation anzeigt
268
285
- Ich kann einen Schreibtischtest als Tabelle von Hand durchführen. → Der Schreibtischtest
286
+
- Ich kann Syntaxfehler, Laufzeitfehler und Logikfehler unterscheiden. → Drei Arten von Fehlern
269
287
- Ich kann einen Fehler finden, indem ich die Werte mit meiner Erwartung vergleiche. → Fehler finden
270
288
- Ich kann Java-Code mit dem Einzelschritt und Haltepunkten verfolgen. → Jetzt in Java
271
289
:::
@@ -312,4 +330,16 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
312
330
-[x] Das Programm hält vor dieser Zeile an.
313
331
-[ ] Die Zeile wird übersprungen.
314
332
> Das ist ein Haltepunkt. Mit ▶︎ oder dem Einzelschritt geht es weiter.
333
+
? Ordne jedem Fehler seine Fehlerart zu.
334
+
→ Drei Arten von Fehlern
335
+
= Am Zeilenende fehlt das Semikolon. -> Syntaxfehler
336
+
= Das Programm teilt durch 0 und bricht ab. -> Laufzeitfehler
337
+
= Der Durchschnitt ist zu groß, weil Klammern fehlen. -> Logikfehler
338
+
339
+
? Das Programm läuft ohne Meldung bis zum Ende, gibt aber 12 statt 21 aus. Welche Fehlerart ist das?
340
+
→ Drei Arten von Fehlern
341
+
-[ ] Syntaxfehler
342
+
-[ ] Laufzeitfehler
343
+
-[x] Logikfehler
344
+
> 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
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ kurz: Alle Elemente in Java auf einen Blick, Code erzeugen, im Bereich Code Java
16
16
- ein kurzes Java-Programm als Struktogramm nachbauen
17
17
- im Bereich Code Java tippen und das entstehende Struktogramm lesen
18
18
- ein Programm mit ▶︎ ausführen und Ein- und Ausgaben in der Konsole nutzen
19
+
- an der roten Zeilennummer einen Syntaxfehler oder Laufzeitfehler finden
19
20
- Haltepunkte setzen und ein Programm im Einzelschritt verfolgen
20
21
:::
21
22
@@ -196,6 +197,10 @@ Oben im Bereich Code startet [▶︎ Ausführen](#zeige-ausfuehren) dein Program
196
197
197
198
Die Grenze zwischen Code und Konsole kannst du mit der Maus nach oben oder unten ziehen.
198
199
200
+
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“.
201
+
202
+
Weiß VisuStruct genau, was fehlt, steht am Ende der Zeile eine 💡. Fährst du mit der Maus darauf, siehst du den Vorschlag, z. B. **Vorschlag: import java.util.Scanner; einfügen**. Ein Klick übernimmt ihn. Lies trotzdem nach, was eingefügt wurde, damit du es beim nächsten Mal selbst weißt.
203
+
199
204
> Der Bereich Code 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“).
200
205
201
206
::: angeberwissen
@@ -204,7 +209,7 @@ Profis nennen ein Programm, in dem man Code schreibt, ausführt und Fehler sucht
204
209
205
210
## Fehler suchen mit dem Debugger
206
211
207
-
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.
212
+
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.
208
213
209
214
-**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.
210
215
-**Gelbe Zeile:** Sie wird als Nächstes ausgeführt. Im Struktogramm ist der passende Kasten markiert.
@@ -395,6 +400,7 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
395
400
- Ich kann ein kurzes Java-Programm als Struktogramm nachbauen. → Übung: Java als Struktogramm
396
401
- Ich kann im Bereich Code Java tippen und das entstehende Struktogramm lesen. → Java direkt schreiben
397
402
- Ich kann ein Programm mit ▶︎ ausführen und Ein- und Ausgaben in der Konsole nutzen. → Das Programm ausführen
403
+
- Ich kann an der roten Zeilennummer einen Syntaxfehler oder Laufzeitfehler finden. → Das Programm ausführen
398
404
- Ich kann Haltepunkte setzen und ein Programm im Einzelschritt verfolgen. → Fehler suchen mit dem Debugger
399
405
:::
400
406
@@ -455,4 +461,11 @@ Schätze dich bei jedem Punkt ehrlich ein: ☂️ noch nicht, ⛅ teilweise, ☀
455
461
-[x] C++ musst du für jedes System neu kompilieren, Java nicht.
456
462
-[ ] Beide musst du nur einmal kompilieren.
457
463
> C++ wird direkt zu Maschinencode für ein System. Java wird zu Bytecode, und den führt auf jedem System die JVM aus.
464
+
465
+
? Die Zeilennummer 3 im Bereich Code ist rot. Was heißt das?
466
+
→ Das Programm ausführen
467
+
-[ ] In Zeile 3 ist ein Haltepunkt.
468
+
-[x] In Zeile 3 steckt ein Fehler.
469
+
-[ ] Zeile 3 wird als Nächstes ausgeführt.
470
+
> 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 Code 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
:::
@@ -79,9 +80,25 @@ Her colleague Dorothy Vaughan saw early on that the IBM computers would take ove
79
80
Katherine Johnson (1918–2020), mathematician at NASA (photo: [NASA](https://commons.wikimedia.org/wiki/File:Katherine_Johnson_1983.jpg), public domain).
80
81
:::
81
82
83
+
## Three kinds of errors
84
+
85
+
Errors are part of programming, even for professionals. There are three kinds, and you find each of them in a different way:
86
+
87
+
-**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.
88
+
-**Runtime error**: The program starts but stops at one point, e.g. when it divides by 0.
89
+
-**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`.
90
+
91
+
This is how VisuStruct shows you the errors:
92
+
93
+
-**Syntax error:** They happen less often in a structure chart, because the boxes give you the shape. In the [Code](#zeige-codelive) area the spot is underlined in red, the line number turns red, and you read e.g. **Line 2: Still missing here: ;**.
94
+
-**Runtime error:** The simulation stops on the box and reports e.g. **Division by zero.** In the Code area the line number turns red, and the [console](#zeige-konsole) names the line: **Line 3: Division by zero.**
95
+
-**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.
96
+
97
+
> 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”.
98
+
82
99
## Find mistakes
83
100
84
-
If a structure chart outputs something wrong, do this:
101
+
If a structure chart outputs something wrong, that is a logic error. Then do this:
85
102
86
103
1.**Write down what you expect:** What should come out for a particular input?
87
104
2.**Run it step by step:** Start the simulation with **Step** and watch the variables.
@@ -266,6 +283,7 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
266
283
- I can start the simulation, pause it, run single steps and stop it. → Start the simulation
267
284
- I can read the variables, the output and the last step during the simulation. → What the simulation shows
268
285
- I can do a desk check by hand as a table. → The desk check
286
+
- I can tell syntax errors, runtime errors and logic errors apart. → Three kinds of errors
269
287
- I can find a mistake by comparing the values with what I expect. → Find mistakes
270
288
- I can follow Java code with Step and breakpoints. → Now in Java
271
289
:::
@@ -312,4 +330,16 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
312
330
-[x] The program pauses before this line.
313
331
-[ ] The line is skipped.
314
332
> That is a breakpoint. ▶︎ or Step carries on.
333
+
? Match each error to its kind.
334
+
→ Three kinds of errors
335
+
= The semicolon at the end of the line is missing. -> Syntax error
336
+
= The program divides by 0 and stops. -> Runtime error
337
+
= The average is too big because brackets are missing. -> Logic error
338
+
339
+
? The program runs to the end without any message but prints 12 instead of 21. What kind of error is that?
340
+
→ Three kinds of errors
341
+
-[ ] Syntax error
342
+
-[ ] Runtime error
343
+
-[x] Logic error
344
+
> 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
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ kurz: All elements in Java at a glance, generate code, write Java in the Code ar
16
16
- rebuild a short Java program as a structure chart
17
17
- type Java in the Code area and read the structure chart that is built
18
18
- run a program with ▶︎ and use input and output in the console
19
+
- find a syntax error or a runtime error by its red line number
19
20
- set breakpoints and follow a program step by step
20
21
:::
21
22
@@ -196,6 +197,10 @@ At the top of the Code area, [▶︎ Run](#zeige-ausfuehren) starts your program
196
197
197
198
You can drag the border between code and console up or down with the mouse.
198
199
200
+
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”.
201
+
202
+
If VisuStruct knows exactly what is missing, there is a 💡 at the end of the line. Move the mouse onto it to see the suggestion, e.g. **Suggestion: insert import java.util.Scanner;**. A click applies it. Still read what was inserted, so that you know it yourself next time.
203
+
199
204
> The Code 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”).
200
205
201
206
::: angeberwissen
@@ -204,7 +209,7 @@ Professionals call a program where you write code, run it and look for mistakes
204
209
205
210
## Find mistakes with the debugger
206
211
207
-
Sometimes a program runs but calculates something wrong. Then the **debugger** helps: it runs your program slowly while you watch.
212
+
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.
208
213
209
214
-**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.
210
215
-**Yellow line:** This line runs next. The matching box is selected in the structure chart.
@@ -395,6 +400,7 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
395
400
- I can rebuild a short Java program as a structure chart. → Exercise: Java as a structure chart
396
401
- I can type Java in the Code area and read the structure chart that is built. → Write Java directly
397
402
- I can run a program with ▶︎ and use input and output in the console. → Run the program
403
+
- I can find a syntax error or a runtime error by its red line number. → Run the program
398
404
- I can set breakpoints and follow a program step by step. → Find mistakes with the debugger
399
405
:::
400
406
@@ -455,4 +461,11 @@ Rate yourself honestly for each point: ☂️ not yet, ⛅ partly, ☀️ I can
455
461
-[x] You have to compile C++ again for every system, but not Java.
456
462
-[ ] You only compile both once.
457
463
> C++ becomes machine code for one system directly. Java becomes bytecode, and the JVM runs it on every system.
464
+
465
+
? Line number 3 in the Code area is red. What does that mean?
466
+
→ Run the program
467
+
-[ ] There is a breakpoint in line 3.
468
+
-[x] There is an error in line 3.
469
+
-[ ] Line 3 runs next.
470
+
> 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 Code area the line numbers are on the left next to the code.
0 commit comments