Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

Commit bce4c09

Browse files
Web 0.14.11: nur ein Angeberwissen pro Schritt in Lektion 8 (#242)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ugz28TUvYQdhvdA4FcsREf
1 parent c4105f8 commit bce4c09

12 files changed

Lines changed: 103 additions & 102 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The format is loosely inspired by Keep a Changelog.
1515

1616
### Added
1717

18+
- **Web 0.14.11, one Angeberwissen per step in lesson 8:** the „goto fail“ box moves from step „Jetzt in Java“ (which keeps Duke) to step „Lückentext: Gerade oder ungerade“, right after its explanation about curly brackets (de/en/pt).
1819
- **Web 0.14.10, Struktogramm area in green:** the colour of the Struktogramm area (top edge, slim strip, name on the exercise card) is now green #2b8a3e instead of blue, so it stands apart from the blue buttons and links; Code stays violet. The Struktogramm area now has a heading „Struktogramm“ in green above its tools, like „Code“ in violet.
1920
- **Web 0.14.9, Margaret Hamilton and Hedy Lamarr with photo:** lesson 22 (try and catch) gets an Angeberwissen box on Margaret Hamilton: during the Apollo 11 landing in 1969 the onboard computer raised the alarms 1202 and 1201 but did not crash, because her team's software recognised the overload and kept only the most important jobs running; she called her work „software engineering“. Photo 1969 next to the printed Apollo programs (Draper Laboratory, Commons „Margaret Hamilton - restoration.jpg“, PD-US-no notice, 300×400). Lesson 15 (arrays) gets an Angeberwissen box on Hedy Lamarr: 1942 patent with George Antheil, sender and receiver hop through the same list of 88 frequencies in the same order (like a loop through an array), today's frequency hopping e.g. in Bluetooth; worded as an important forerunner, not the sole inventor. Publicity photo 1944 (Commons „Hedy Lamarr Publicity Photo for The Heavenly Body 1944.jpg“, PD-US-no notice, 300×400). de/en/pt.
2021
- **Web 0.14.8, Katherine Johnson with photo:** lesson 7 step „Der Schreibtischtest“ gets an Angeberwissen box: „Computer“ used to be a job; in 1962 John Glenn asked Katherine Johnson to check the IBM computer's orbit calculation by hand before he flew (a real desk check); the toilet scene from „Hidden Figures“ is marked as exaggerated by the film; her colleague Dorothy Vaughan taught herself and her team FORTRAN. Followed by her portrait (NASA 1983, public domain, Commons „Katherine_Johnson_1983.jpg“, 300×400) (de/en/pt).

‎web/lessons/de/08-verzweigung.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,6 @@ tipp: Die Bedingung lautet `punkte >= 50`. In den Zweigen steht `System.out.prin
145145
lösung: l08-java-bestanden-loesung.visustruct
146146
:::
147147

148-
::: angeberwissen
149-
Steht im Zweig nur eine einzige Anweisung, darf man in Java die geschweiften Klammern sogar weglassen. Wir machen das trotzdem nie, und zwar aus diesem Grund:
150-
151-
```java
152-
if (alter >= 18)
153-
System.out.println("Du bist volljährig.");
154-
System.out.println("Du darfst den Film sehen.");
155-
```
156-
157-
Ohne Klammern gehört nur die erste Zeile zum if. Die zweite läuft immer, auch für Zwölfjährige. Die Einrückung täuscht, denn Java achtet nicht auf Leerzeichen.
158-
159-
Genau so ein Fehler steckte 2014 in iPhones und Macs, bekannt als **„goto fail“**. In der Sprache C stand unter einem if ohne Klammern die Zeile `goto fail;` aus Versehen zweimal. Die zweite lief immer und übersprang die Prüfung der Sicherheitszertifikate. In einem offenen WLAN hätte sich ein Angreifer so zum Beispiel als deine Bank ausgeben können. Mäh, Klammern kosten zwei Zeichen, eine Sicherheitslücke kostet viel mehr.
160-
:::
161-
162148
## Lückentext: Gerade oder ungerade
163149

164150
::: lückentext
@@ -179,6 +165,20 @@ int zahl = scanner.nextInt();
179165
erklärung: `zahl % 2` ist der Rest beim Teilen durch 2. Ist er 0, ist die Zahl gerade. Zum Vergleichen brauchst du `==`, ein einzelnes `=` ist eine Zuweisung. Beide Zweige stehen in geschweiften Klammern.
180166
:::
181167

168+
::: angeberwissen
169+
Steht im Zweig nur eine einzige Anweisung, darf man in Java die geschweiften Klammern sogar weglassen. Wir machen das trotzdem nie, und zwar aus diesem Grund:
170+
171+
```java
172+
if (alter >= 18)
173+
System.out.println("Du bist volljährig.");
174+
System.out.println("Du darfst den Film sehen.");
175+
```
176+
177+
Ohne Klammern gehört nur die erste Zeile zum if. Die zweite läuft immer, auch für Zwölfjährige. Die Einrückung täuscht, denn Java achtet nicht auf Leerzeichen.
178+
179+
Genau so ein Fehler steckte 2014 in iPhones und Macs, bekannt als **„goto fail“**. In der Sprache C stand unter einem if ohne Klammern die Zeile `goto fail;` aus Versehen zweimal. Die zweite lief immer und übersprang die Prüfung der Sicherheitszertifikate. In einem offenen WLAN hätte sich ein Angreifer so zum Beispiel als deine Bank ausgeben können. Mäh, Klammern kosten zwei Zeichen, eine Sicherheitslücke kostet viel mehr.
180+
:::
181+
182182
## Fehler finden: Eintritt
183183

184184
::: übung l08-java-fehler

‎web/lessons/en/08-verzweigung.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,6 @@ tipp: The condition is `points >= 50`. One branch has `System.out.println("passe
145145
lösung: l08-java-bestanden-loesung.visustruct
146146
:::
147147

148-
::: angeberwissen
149-
If a branch holds only a single statement, Java even lets you leave out the curly brackets. We never do that, and here is why:
150-
151-
```java
152-
if (age >= 18)
153-
System.out.println("You are an adult.");
154-
System.out.println("You may watch the film.");
155-
```
156-
157-
Without brackets only the first line belongs to the if. The second one always runs, even for twelve-year-olds. The indentation is misleading, because Java ignores spaces.
158-
159-
Exactly this kind of mistake was hidden in iPhones and Macs in 2014, known as **“goto fail”**. In the language C, the line `goto fail;` accidentally appeared twice under an if without brackets. The second one always ran and skipped the check of the security certificates. On an open Wi-Fi network, an attacker could have pretended to be your bank, for example. Baah, brackets cost two characters, a security hole costs much more.
160-
:::
161-
162148
## Fill in the gaps: even or odd
163149

164150
::: lückentext
@@ -179,6 +165,20 @@ int number = scanner.nextInt();
179165
erklärung: `number % 2` is the remainder when dividing by 2. If it is 0, the number is even. To compare you need `==`, a single `=` is an assignment. Both branches are in curly brackets.
180166
:::
181167

168+
::: angeberwissen
169+
If a branch holds only a single statement, Java even lets you leave out the curly brackets. We never do that, and here is why:
170+
171+
```java
172+
if (age >= 18)
173+
System.out.println("You are an adult.");
174+
System.out.println("You may watch the film.");
175+
```
176+
177+
Without brackets only the first line belongs to the if. The second one always runs, even for twelve-year-olds. The indentation is misleading, because Java ignores spaces.
178+
179+
Exactly this kind of mistake was hidden in iPhones and Macs in 2014, known as **“goto fail”**. In the language C, the line `goto fail;` accidentally appeared twice under an if without brackets. The second one always ran and skipped the check of the security certificates. On an open Wi-Fi network, an attacker could have pretended to be your bank, for example. Baah, brackets cost two characters, a security hole costs much more.
180+
:::
181+
182182
## Find the bug: admission
183183

184184
::: übung l08-java-fehler

‎web/lessons/pt/08-verzweigung.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,6 @@ tipp: A condição é `pontos >= 50`. Num ramo fica `System.out.println("aprovad
145145
lösung: l08-java-bestanden-loesung.visustruct
146146
:::
147147

148-
::: angeberwissen
149-
Se um ramo tiver só uma instrução, o Java até deixa tirar as chavetas. Nós nunca fazemos isso, e é por esta razão:
150-
151-
```java
152-
if (idade >= 18)
153-
System.out.println("És maior de idade.");
154-
System.out.println("Podes ver o filme.");
155-
```
156-
157-
Sem chavetas, só a primeira linha pertence ao if. A segunda é sempre executada, até para quem tem doze anos. A indentação engana, porque o Java não liga aos espaços.
158-
159-
Foi exatamente um erro destes que estava escondido em iPhones e Macs em 2014, conhecido como **“goto fail”**. Na linguagem C, a linha `goto fail;` aparecia por engano duas vezes debaixo de um if sem chavetas. A segunda era sempre executada e saltava a verificação dos certificados de segurança. Numa rede Wi-Fi aberta, um atacante podia, por exemplo, fazer-se passar pelo teu banco. Mééé, as chavetas custam dois caracteres, uma falha de segurança custa muito mais.
160-
:::
161-
162148
## Preenche os espaços: par ou ímpar
163149

164150
::: lückentext
@@ -179,6 +165,20 @@ int numero = scanner.nextInt();
179165
erklärung: `numero % 2` é o resto da divisão por 2. Se for 0, o número é par. Para comparar precisas de `==`, um `=` sozinho é uma atribuição. Os dois ramos ficam entre chavetas.
180166
:::
181167

168+
::: angeberwissen
169+
Se um ramo tiver só uma instrução, o Java até deixa tirar as chavetas. Nós nunca fazemos isso, e é por esta razão:
170+
171+
```java
172+
if (idade >= 18)
173+
System.out.println("És maior de idade.");
174+
System.out.println("Podes ver o filme.");
175+
```
176+
177+
Sem chavetas, só a primeira linha pertence ao if. A segunda é sempre executada, até para quem tem doze anos. A indentação engana, porque o Java não liga aos espaços.
178+
179+
Foi exatamente um erro destes que estava escondido em iPhones e Macs em 2014, conhecido como **“goto fail”**. Na linguagem C, a linha `goto fail;` aparecia por engano duas vezes debaixo de um if sem chavetas. A segunda era sempre executada e saltava a verificação dos certificados de segurança. Numa rede Wi-Fi aberta, um atacante podia, por exemplo, fazer-se passar pelo teu banco. Mééé, as chavetas custam dois caracteres, uma falha de segurança custa muito mais.
180+
:::
181+
182182
## Encontra o erro: entrada
183183

184184
::: übung l08-java-fehler

‎web/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎web/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "visustruct-web",
33
"private": true,
4-
"version": "0.14.10",
4+
"version": "0.14.11",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)