Wednesday, 7 April 2021

Online "tute"





Did it ever happen to you that you bought a book with the best of intentions and then you never find time to read it? Well, that was me with this book, which you can also read for free in Miguel Grinberg´s famous flask mega tutorial. At some point I went through several chapters but never really put together my own app, or deployed it somewhere.

For me the problem with tutorials is how to get really engaged. In terms of learning experience, there is a big difference between just following steps and actually trying to create something else by yourself (even if still mostly based on the tutorial steps). Because once it is your own persoanl project, you are automatically engaged. My CoderDojo is still paused because of COVID, but something I used to recommend to children (and parents) was to find something that really interests you and then work your way through the problems. A lot of the learning happens when trying to solve a problem.

A few weeks ago, someone at work mentioned pythonanywhere, which gives you the opportunity to deploy an app easily. I just needed an idea. And I had it over Easter. My father and my son often play tute when we are in Spain. However last time we were there was Christmas of previous year, so I had the idea to make an app to play tute. Oh, I hear you say, but there are plenty of web pages which already allow you to play and are way better than anything you can hack in a few days. Yes, but you don´t learn a lot playing with other people´s apps!

So after my very own (and short) Easter of Code, version 0.1 is up and running. We already played a game with my father this morning and it was a good laugh. Hope we do it now from time to time.

Things I have learned:

  • I didn´t really know all the rules of tute. Thanks to wikipedians!
  • I set up VS Code to debug flask apps.
  • SQLite is not great a choice when model changes, as dropping columns seems a bit of a pain when the model changes. I ended up restarting the database a couple of times.
  • Page reloads are good enough for us. Ajax or websockets would be better though, even more learning opportunities.
  • Know when to take a break. Impossible problems one day are magically solved in five minutes in the morning with a fresh head.
  • Styling matters. Thanks to my brother for advice.
Updated April 17th: Code available in GitHub

No comments: