Teach programming with JavaScript

I recently posted on how I find current computer science education lacks motivation. Today I had the pleasure to listen to a keynote by Prof. Dr. Dennis Komm on how he approaches computer science education. He should know since he is a Professor of Algorithms and Didactics at ETH Zurich and hence at the spearhead of education for computer science in Switzerland. And in his talk he made a lot of valid points – but I still feel the issues raised in my last post remain unanswered by his talk. I will use it as an anchor to refine my demands.

a person sitting in front of a computer learning to write javascript by building a nice and blinking website
DALLE-2 generated interpretation of how it fealt for me to learn JavaScript.

A very important point raised by Prof. Komm is: for a novice programmer the computer is a black box. It is really hard to figure out what it can do and can not do. Especially with consumer friendly tools and apps (Google, ChatGPT) performing better every day, one may be tricked into thinking the computer can do anything, can think along or infer automatically “what the user wants”. This is very far from true, especially when looking at the fundamentals of computers. Then again, thinking about what the computer can actually do is hard when confronted with programming languages or arithmetic basic commands.

I once challenged a friend to come up with an algorithm to compute a convex hull and she ultimately failed. She failed because she did not know that computers can do stacks – and its totally not her fault because its just really not that obvious that this kind of stuff works. After some time learning about computers I figured out that they can be assumed as “available” but its definitely not clear that this works when looking at the basic operations a computer can perform.

After all, the computer can only do very simple arithmetic. To build a computer you actually just need to be able to increment numbers and some tape. But when starting to interact with a computer, you are faced with a plethora of features. It is hard to reduce this to a level that helps understanding how a computer works. Similar to how you can observe and understand the state of a scissor (move the handles apart, scissor blades open, insert paper, move handles together, scissor blades close), Prof. Kemm recommended an approach to computer programming that makes it easy to observe the state of the computer.

For this, he chose the turtle programming language. It only offers a few basic commands (moving the turtle in a specific direction, repeating instructions a certain number of times, defining variables, changing color, …) and has a very observable state – the current position of the turtle on the screen resp. its trace from moving. And I think this abstraction certainly helps understanding how computer programming works. That is – if you are really interested in learning this in the first place.

Because frankly, the turtle will not motivate you in any way to learn computer programming. The turtle is really 100% useless. No offense, the images that can be generated are pretty. But even very motivated students will not be able to achieve anything remotely interesting with it (as in, something more complex than a drawing). It is really just a toy example. And ultimately, this will demotivate students (IMO).

Instead, I find my own introduction to computers fit very well into the motivating category. I first got introduced into writing websites in pure HTML. This is not very different to writing a word document, you even have less confusing buttons and hidden menus to use. Just a few keywords and the brackets (“<“, “>”) to remember. This also gives you a very observable state (the rendered outcome of the website) but no real programming yet.

In a second step, we learned the JavaScript basics. Yes, JavaScript is a terrible language – that’s why you should really just teach a simple subset of the language at first. It comes with everything you need, variables, loops, etc. You can observe the internal state very nicely using i.e. the Visual Studio Code debugger, which lists all the variables you defined and can show you how the computer steps through your code. And next to that you have the ultimate observable state – the website that you can watch transform according to your commands.

What’s more is that if you are keen on diving deeper (as a motivated student), there is so much depth to the programming language. You can learn a lot more details. You can build highly complicated tools. And you can easily distribute the result! I.e. It is actually useful if you want to i.e. build a nice blinking website for your parents or to show off on the internet (such as nielstron.de).

JavaScript does not inhibit motivation at all, it gives you basic tools that hint at all the possibilities of what may come. And it does not bother you to care about the insanity of types that i.e. Java brings with it, or the painstaking accuracy that i.e. C or C++ demands of you. You can just start writing, no need to compile, run and see where and why something fails. This is the beauty of JavaScript. And maybe it would have motivated more of my former class mates to study computer science. At least more than making a turtle run in circles.

PS: In our case it was a robot that moved blocks but ultimately it was just as useless as the turtle.
PPS: BTW I am not saying it was not fun for me to program them. But I don’t see how they would have motivated my class mates to learn more about programming, because for it did neither.

Die Letzte Generation hat ein Imageproblem

Die Letzte Generation (LG) hat ein Problem. Und dieses Problem ist nicht nur die Klimakrise, gegen die sie so leidenschaftlich kämpft, sondern auch die Art und Weise, wie sie diesen Kampf führt. Die Aktionen der LG, die sich durch zivilen Ungehorsam auszeichnen, stören zunehmend die Bevölkerung und zwingen damit die Regierung, nicht auf sie einzugehen, sondern sie zu zerschlagen. Um das zu ändern, muss die LG die Regierung stören und bei der Bevölkerung beliebter werden.

Als Außenstehender, der die LG und ihre Ziele schätzt, fällt es mir schwer, diese Kritik zu äußern. Aber gerade weil ich die Notwendigkeit ihres Kampfes gegen die Umweltzerstörung sehe, ist es mir wichtig, auf die Probleme hinzuweisen, die ihre aktuelle Strategie mit sich bringt.

Stop teaching “Programming”

User: please write convincing blog post about why we should not teach programming anymore (especially not as “Introduction to Programming”) The reason is that programming is just a tool and never useful on its own. Teaching it without context is easily frustrating. Instead, recommend teaching applied courses like “Introduction to Webdesign” where users can learn programming in a context and appreciate its usefulness

Docker and DB WiFi Hotspots

TL;DR: Are you riding trains in Germany (brought to you by DB) and having trouble to connect to their WiFi Hotspot? Try uninstalling docker.

I am recently riding the train a lot. In particular, I was riding the ICE type of train by Deutsche Bahn (DB). In theory, these trains feature WI-Fi hotspots, but I am used to the fact that Wi-Fi on trains is not avilable. Either there is no signal at all or the hotspot does not offer a sign-in screen. Alternatively, the sign-in screen shows, and the screen is blank or logging in fails. You get the idea.

Recently I stumbled upon a very peculiar issue. My phone was able to connect perfectly fine but my laptop was not. I could connect to the WiFi but the login screen would not prompt. I tried restarting and the screen showed (after some restarts) and gave a weird error message – the host can not be reached. I googled how to force the login screen to show. Usually you type the default gateway address in your browser and it works fine. In this case said host-could-not-be-reached message popped up. How can that host not be reached? It is literally the first IP address in this network my laptop would know of and try to reach.. wait a minute.

Chiatura – Sachkhere via Bus and Train

Chiatura is a place that is famous for the fact that there are many cable cars throughout the city. Now that the cable cars from the soviet era are not operational anymore you might be wondering if you should still go. Let me ask you another question: Are you curious about a city where public transport includes cable cars? Are you interested in a former miner city full of soviet-style high-rise buildings in a super hilly area?

Soviet era high-rise buildings and abandoned cable car station

Waking Up with IoT Lights

If you watched my github page, you know I like to integrate everything with the home automation platform home-assistant. Still, I find it really hard to make effective use of IoT devices in my home. Honestly speaking, I found exactly one practical use case of my WiFi-capable ceiling light, which is to turn on a few minutes before my phone alarm goes off.

Why should I care?

This might be a personal preference, but I feel being woken up by light is much more comfortable than by some alarm sound. However, this advantage is usually level out by the fact that setting up a light alarm and maintaining it is much more inconvenient than using the stock smartphone alarm. This is especially the case if you need to wake up at a different time each day.

What’s the idea?

The default Android Alarm app displays a notification, roughly 15-20 minutes before an upcoming alarm goes off. The core idea is to use this notification as a trigger to turn on a light. This way, without any additional configuration, you just need to set an alarm on your phone and the DIY “light alarm” will adjust automatically.

This idea may be transferred to a variety of applications and lights. As an example, I include a short tutorial on how to turn on a light using the android stock alarm app, the automation app Automate and Home-Assistant. The app Tasker might work just as well.

Encrypted WhatsApp Backups in 5m

*it might be more than 5 minutes, but is worth it anyways.

Why should I care?

I know you’re first reaction to this title. “Isn’t WhatsApp already E2E-encrypted and stuff?”. It is. That’s nice and all. But WhatsApp messages are also stored in backup files. Of these there are two types, local encrypted backups and cloud backups.

As long as your chats are stored in the default WhatsApp backup files, they are stored nice and safe. Since they are encrypted, only whoever has the key to these files may access your chat messages.

But here is the thing: Your chat messages are not only backed up in these encrypted files. WhatsApp also asks you to upload all messages a cloud service. On Apple that is iCloud. On Android it is Google Drive. And these backups are plain text, even the iCloud backups. That means any institution with access to the data stored at Google or Apple may easily read all your messages. This of course also includes Google and Apple themselves.