Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

4 June 2020

Flashcards and Microlearning

I like learning in all its aspects. A large part of software work is hands-on, so I experiment a lot and work through old and new code katas alike. For theory I rely on classic books like Clean Code. Sometimes I struggle to internalise theoretical knowledge and take notes, create extracts, mind maps or sketch notes. For material I need to memorise I like (digital) flashcards.

Applications of Flashcards
I use flashcards for a lot of different things.
  • The common case is to study tiny facts like words or numbers. IDE shortcuts and spelling alphabets are in this category. These flashcards work very well for me.
  • Then I tried visualising keys, which did not work as well.
  • I also use them to remember key points from books, e.g. The Little Schemer or Gerald M. Weinberg's Secrets of Consulting. Key learnings from books, i.e. phrases or sentences, are more difficult to remember. I am still experimenting with these - maybe flashcards are not ideal here.
  • In the past I created decks of cards to accompany some of my training workshops, e.g. Design Patterns. While participants were enthusiastic about them, I am pretty sure they did not use them to deepen their newfound knowledge. People use different phones, so the availability of flashcard apps is also an issue.
  • Even when I fail to study the cards later, creating them is a learning experience on its own. I have to collect and structure the material, formulate the questions and find precise answers. For example I created cards around Coupling and Cohesion which helped me understand more of these two concepts.
Micro GardenMicrolearning
By researching flashcards, I came across Microlearning. This is kind of a buzz word - everything is micro today, e.g. Micro-Workouts. (You practice for five minutes a day and then the exercise gear folds under your bed ;-) Wikipedia says that Microlearning deals with relatively small learning units and short-term learning activities. [...] In a wide sense, Microlearning can be understood as a metaphor which refers to micro aspects of a variety of learning models, concepts and processes. It is a new concept and there is no clear definition. It contains a lot of things. Besides the obvious reading, listening or watching short pieces of information, Microlearning activities include flashcards, quizzes, answering multiple-choice questions, micro games and more.

Conclusion
I was surprised to learn that sorting and organising learning content like tagging it (e.g. Social Bookmarking) is considered Microlearning. I like sorting and connecting information, I even sort my code katas. The most fun activity listed on Wikipedia is composing a haiku or a short poem. I did compose a poem in the past but never considered it a tool for learning. I like the idea. Maybe I will write a poem about TDD or Micro Services in the future.

I do not consider a whole deck of flashcards Microlearning. A whole deck is so much more as it contains all the aspects and details about a certain topic. In addition, creating it takes several hours. I am seeing that because I create most of my decks myself. Probably I am putting too much information into them as well. Sometimes I am overwhelmed by my own questions. For example my Design Patterns deck contains more than 360 questions including class diagrams and all. On the other hand, learning a few cards now and then - especially from an unknown deck - is fine.

Listening and watching short audio or video recordings is Microlearning, too. I like to listen to podcasts, especially if each episode is focused and not too long. That means it is shorter than ten minutes. Short episodes are easy to consume between other activities, e.g. when commuting. It is easier to stay focused. (Yes, maybe I am getting old. I have less time and energy for prolonged learning.) That is the reason I plan for episodes of eight minutes in my own podcast on Coderetreat Facilitation. Short episodes are easier to produce, which allows me to publish more often.

Bonus Material
The German Wikipedia entry on Microlearning contains a paragraph on Microlearning in the context of software development. It lists Test Driven Development as an example. This is an interesting angle. When the test - an assumption - goes green, the implementation moved forward a micro step and the developer knows a tiny bit more about the system.

6 May 2020

Learning yet another Programming Language

In 2000 Andrew Hunt and David Thomas wrote their influential book The Pragmatic Programmer, which is listed as second single most influential book every programmer should read. (I listed it in my book recommendations both 2012 and 2006.) Chapter one, tip eight Invest Regularly in Your Knowledge Portfolio says: Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.

Filled Tool Box (licensed CC BY-NC by hmboo Electrician and Adventurer)I started out as Java developer. Since than I have studied XSLT, Ruby, Scala, Forth, JavaScript, Scheme, Python, TypeScript, Go, C# and C. Out of these I even ran trainings for developers teaching them Python and TypeScript. In addition I had a glimpse of Visual Basic, Dart, Clojure, R, PHP, NATURAL, PowerShell, Kotlin and have relearned Assembly. I still need to learn Smalltalk, F#, maybe Haskell, J and of course Prolog.

I like programming languages and my learning approach is driven by curiosity and fun. Today I will describe my "standard", step by step way to get into a new language. I will assume you are an experienced developer, able to code in Java or C# who understands basic programming principles. I believe this approach is not suitable for programming newbies. I never use all these steps and sometimes change their order - like starting with the last one. Feel free to reorder or skip any steps not adding knowledge or fun.

1) Get an overview of core language features.
I start reading Wikipedia about the programming language I want to dive into. I am looking for the core features, used concepts and paradigms in the language. Code examples of these features provide a first idea of the language's syntax. The idea is not to know everything, just to be able to write some code. Writing code is the fun part, not reading. The more languages you know the easier and faster this step is. When learning Go one hour on Wikipedia during commute was enough. On the other hand for TypeScript I spent several hours reading the language reference (Handbook). For C# I skipped this step as I had seen most of the language features while facilitating Mob Programming sessions. You are done with this step when you have some idea what the language can do.

2) Figure out the usual setup and get it working.
Most programming languages come with their own ecosystem of runtimes, documentation, dependency and packaging mechanisms, testing frameworks, editors and other tools. When starting with a new language I try to use its typical tooling. Or at least I look for a decent IDE plugin to keep some level of comfort and productivity. Often this is painful and full of compromise. E.g. when working with Scheme I should have used Emacs but started with a basic editor and used VS Code in the end. For Go I needed 2 to 3 hours to set up the command line tools and VS Code integration. For C it took me 2 hours to compile and run a sample test alone - due to incompatible architecture binaries, sigh. I am still staying away from make tools due to the additional complexity. Eventually I will have to work through them if I want to use high level IDEs like Eclipse or CLion. If your interest in the language is purely educational, a simple editor might be enough to get started, like I used for Forth. You are done when you are able to edit, compile, test and run a Hello World application, e.g. in Windows Assembly.

3) Port small pieces of code (from a similar language if possible).
This helped me when learning C. I knew its basic features and had figured out how to compile and run a single file. And then I ported some small (refactoring) code katas. Porting code katas was easier than coding them because the solution and its code were already there and all I needed to deal with was syntax. If there is a similar language to start from, e.g. Java to C#, Java to PHP, C++ to C, even Java to C, then some of the syntax is proper right from the start. There was a lot of Google and StackOverflow involved and I managed to convert a small kata in around one hour. In the end I had ported several code katas to C. Emily Bache keeps inventing fun and interesting refactoring katas, which always need ports to other languages. For example I have ported her Parrot-Refactoring-Kata to TypeScript, Go and recently C. I have also contributed a Scheme version, but that was after I had learnt the language. You are done when you have contributed at least two ports of small refactoring katas.

4) Work through koans of the language.
Koans are an effective way to learn new programming languages. Programming language koans are a progressive sequence of little exercises, starting with basic things and building on each other to move to more advanced topics. The goal is to learn the language and core libraries. Usually the exercises contain failing test cases, where tiny pieces of code have to be filled in to make them pass. (I have used this idea to teach unit testing in Java and PHP as well as Python and C#. Porting the koans from JUnit to xUnit also helped me to get into C# - see the paragraph on porting small pieces of code.) Koans are awesome and I use them regularly. I worked through some Python koans, two third of Kotlin koans and all C Koans. The koans vary in size. While Kotlin contained 6 lessons, Python had 39 and JavaScript even 78. Working all these 78 exercises took me more than three full work days in total. You are done when you have completed (almost) all of the koans for the new language.

Ninety-Nine Problems
In case there are no koans for your language, look for "Ninety-Nine Problems". The idea is based on Werner Hett's P-99: Ninety-Nine Prolog Problems. These are little problems with different levels of difficulty. Sample solutions are available in Java, Scala, Haskell, Kotlin, F#, OCaml and probably others.

scratches - What is the connection between this image and item 6? (licensed CC BY-NC-ND by Sue)5) Watch some recorded talks and online presentations.
This is the most obvious step. I like to watch recorded presentations, during my commute. Sometimes some extra (passive) information helps me understand a language, or even this specific weird feature. Depending on time and interest this can be a few talks, or whole months of commute.

6) TDD some code katas from scratch.
Now is the time to write some code from scratch. I recommend starting with simple exercises. There is no point in getting frustrated right at the start. Manage the difficulty of your exercises: Use simple katas like FizzBuzz, Prime Factors, Roman Numerals or Word Wrap to get started. For example I used FizzBuzz to practice some XSLT and Prime Factors when revisiting old languages I used to know many years ago - like BASIC. I reuse these katas - and know their solutions - I just want to try them in a new language. Later I move to more complicated assignments like Bowling, Minesweeper (when I revisited Assembly after 20 years), Bank OCR (when I studied Scheme) or Conway's Game of Life. You are done when you have implemented a few code katas from scratch including tests.

7) Write more code, e.g. tackle a larger code base.
There is no other way of getting deeper into a programming language than using it. This calls for a larger side project. It can be a complex code kata, a little video game like Pong or Tron (Nibbles) - including graphics of course - or whatever comes to your mind. As I am fond of Scheme, I have build several Scheme interpreters in new languages. You could even implement your own unit testing framework, which is also recommended by Kent Beck as an exercise to get into a new language. (And I did that for Pascal, Assembly and Scheme.) Depending on the time invested into the previous steps, a side project includes more or less trial and error. If there is too much hassle, I stop and go back to previous steps to learn more about the basics. There is no point in being stuck. For example when studying Go, I went for the side project after 3 hours of researching the language, which was too early. So I spent some more time on theory and then continued working on my idea. My usual learning side projects take around 15 to 20 hours - or that is the time when I lose interest. You are done when you have worked on a larger code base for at least 15 to 20 hours.

8) At last get *all* the details.
Now that I am familiar with the basics of the language and its ecosystem, it is time to dive deeper. After some month of experimenting and hands-on practice - steps 2, 3, 4, 6 and 7 all involve writing code - I am drawn back to theory. I like to balance my learning between theory, experiments and practice. To conclude learning a new language I might study a classic book about that language. It should cover the language and its features completely and I read it from cover to cover. At that time I am already familiar with many parts of the language, reading progress is fast. I am interested in the all the details, the bits and pieces I did not encounter during my experiments. Language specifications are usually dry and perfectly suited for this step as well as classic titles like the "Pickaxe book", K&R and SICP (although SICP is so much more than a Scheme book...) You are done when you read a classic book on the new language from cover to cover.

Conclusion
I like programming languages and learning new ones is adventurous and fun. I try to learn a new language every year. Not all learning goes deep. Not all languages stick. Unless you are working on real projects in all of these languages at the same time, it is natural to forget some details. And that is perfectly fine. It is all about incorporating new paradigms and widening your perspective. So keep learning!

21 November 2019

Promotion Service Kata

In September I attended a small, club-like unconference. The umbrella topic of the event was katas and their use in teaching and technical coaching. A kata, or code kata, is defined as an exercise in programming which helps hone your skills through practice and repetition. We spent two days creating, practising and reviewing different exercises. I came home with a load of new challenges for my clients.

Kata Factory
One session, run by Bastien David, a software crafter from Grenoble, was named Kata Factory. Bastien guided us to create a short exercise with a very small code base, focused on a single topic. In the first part of the session we created small tasks working in pairs. Then we solved a task from another pair in the second part. A total of four new coding exercises was created, tried and refined. It was awesome.

Promotion Service Kata
I worked with Dmitry Kandalov and we created the Promotion Service Kata. It is a small refactoring exercise, based on Feature Envy, a code smell listed in Martin Fowler's book. (Did you know that there is a second edition of this great book? No, so get it quickly.) The code base contains a single service, the promotion service, which calculates discounts for promoted items. It is a bit crazy because it also reduces the tax. The data is stored in a classic DTO and its fields are not encapsulated. The task is to make it a rich object and encapsulate its fields. There are existing unit tests to make sure things are still working.

After the Kata Factory, I spent some time on porting the kata to different languages. Currently the code is available in C#, Java, Kotlin, PHP and Python. Pull requests porting the code to other languages are very welcome. Check out the code here.

Promotion Service RetrospectiveNotes from first run
I already facilitated the exercise with a small team of C# developers. Here is what they said about the kata:
  • It is a good exercise.
  • It is a short exercise. It is small, so there is no need for context.
  • Encapsulate all the things!
  • I learned to separate concerns.
  • I learned about string.Format (a C# specific function).
  • I did not know the goal of the exercise.
  • Maybe rename the Persist() method to Save().
  • The Item class should be in its own file.
Conclusion
Bastien's approach shows that it is possible to create a brand new and highly focused coding exercise in a short time. As with most development related things, pair work is superior and it is easy to come up with new code katas when working in pairs. Small exercises - I call them micro exercises - are easy to get started because there is little context to know. Context is part of what makes coding assignments difficult. I am very happy with this new exercise.

Give it a try!

31 July 2018

Strong Opinions

As Code Cop I meet a lot of developers and I have to tell some of them that their code is crap and that they need to drive down their technical debt. Others need to test more, maybe start doing TDD. There are a few who would not listen. Some of them are even proud of stubbornly not listening, they say that they have strong opinions about the topic. They do not seem interested in in another view on their code or design? Why is that? I have some ideas.

GorillaDunning Kruger Effect
The Dunning Kruger Effect is a cognitive bias in which people of low ability have illusory superiority and mistakenly assess their cognitive ability as greater than it is. In other words, beginners believe themselves senior and think that they know better. There is no need to listen to an outsider.

I know this effect myself: When I learnt my first programming language(s), as soon as I could write a few lines of code, I felt invincible. (I thought that) I could do everything. I ruled. I knew how to do it and I knew I was right and that there was no other way to do it properly. Today, after writing code for 20 years in more than 25 languages, I do not feel like that any more. Sometimes I would like to go back to my state of mind of the late nineties and I try to look at new languages like a child - with a beginner's mind - but I know too much details. I know there will be nasty details, even for that newest and hottest languages of today.

Expert Beginner
An expert beginner has quickly reached (what looks like) expert status. He or she voluntarily ceases to improve because of a belief that expert status has been reached and thus further improvement is not possible. (I recommend reading the whole series of Erik Dietrich, How Developers Stop Learning: Rise of the Expert Beginner and further posts of his series.) Expert beginners make up defending arguments because they are the experts.

I have met some of these. I vividly remember two senior developers who had been with one of my clients for more than 16 years. They were opposing me on everything I said. Sure they had a superior knowledge of the application they had built and maintained for so many years, and they knew the domain they were working in pretty well. I am sure they were adding value to the product. They both were strong influencers. As soon as they would speak their mind, all other team members would just agree. But, but, but... Sigh. They were still using Ant, did not know Maven, did not write unit tests, did not care for clean code and so on - they made me very unhappy.

Quadrants of Knowledge
The quadrants of knowledge seem connected to my previous points. The four quadrants are
  1. Known Knowns: What you know that you know
  2. Unknown Knowns: What you do not know that you know
  3. Known Unknowns: What you know that you do not know
  4. Unknown Unknowns: What you do not know that you do not know
When we advance our career in software delivery, we learn: We collect concrete knowledge (quadrant 1), we gain experience which allows us to have gut feelings about some things (maybe quadrant 2) and we hear about things that we have no idea about (quadrant 3). There are gazillion things in software that I have no idea of: ANTLR, APL, AWS, Category Theory, Distributed Computing, Elm, Gradle, Guava, Haskell, HBase, J2EE, Kubernetes, Mongo DB, Networking, Node.JS, Prolog, Security - these are just the first few that come to my mind. It is easier to list things which I do not know in areas that I do know. I have been Java developer for 15 years and there are so many things in the Java ecosystem which I have no clue about. On the other hand there are not many things I can say about C#, because I only know it little.

So the more we learn, the more we know that we do not know, increasing our Known Unknowns (quadrant 3). The philosopher Confucius (551–479 BC) even said, Real knowledge is to know the extent of one's ignorance. Like the Dunning Kruger Effect, beginners have no idea about the vast size of Known Unknowns quadrant and do not expect surprises or potential improvements.

Strong Opinions, Weakly Held
The ideas of the Dunning Kruger Effect, Expert Beginners and Known Unknowns offer some explanation why some junior developers are not open for discussions. I have also met senior and expert level developers who are the same. When attending Software Crafting unconferences, e.g. SoCraTes, attendees are eager to learn and open for discussion. After all, that is the idea of unconferences, right? Still, many of them have strong opinions about almost everything, e.g. Spring Boot is cool. No, Spring Boot is hell. ;-) Different from beginners, all of them know the problems of strong opinions and claim that they only hold onto them weakly.

Deal with itWeakly Held, what is that supposed to mean? Isaac Morehouse explains in These Four Words Will Help You ‘Hold Strong Opinions Weakly': You act as if they [your opinions] are true unless and until it is proven they are not. Maybe people like strong opinions because they give them the power of definiteness. Choices are much easier and life is more predictable with definiteness and absolutes. Holding opinions weakly also gives the power of openness. This sounds hard: Basing one's actions on some definite "truths" and re-evaluating these truths whenever they are challenged. Seems like a difficult balancing act, if not a contradiction. For sure that state of mind is not easy to get into. I still need to see someone with strong opinion - weakly held or not - to change his or her mind,

Rant
When I started this article, it was supposed to be a rant. As usual, writing down my thoughts helped me to structure the material in a better way. (I consider writing an act of learning.) So where is the rant? Here it is:

Person with strong opinion == arsehole who does not want to listen.

That is a bit harsh, I agree. Obviously beginners need to listen more and due to Known Unknowns I expect experienced and expert developers to be open to discussion on any topic at any time. The strong opinion itself is not the problem, but the resulting behaviour, especially if strong opinion is used as warning or justification of some sort. I witness strong opinion mainly as excuse to not discuss or challenge existing views.

What about me?
Of course I had strong opinions during my professional life. I did not earn the nick name of Code Cop for nothing. Someone even called me Code Nazi. And my opinions were definitely not weakly held. I like absolutes. (Now I see - as I just learned above - the power of definiteness.) I guess I still have some strong opinions, and they are not just opinions, they are dogma: a system of principles proclaimed as unquestionable.

I have changed and it seems that the Code Cop is getting soft. ;-) The extended experience and discussions have weakened my definiteness. There is always some special case, the almighty it depends. And since I am working with people, and try to help them, I am more compassionate. I understand their problems, the difficulty to get time for quality and the pain of legacy code. Sometimes I catch myself not recommending what I believe the technically best course of action because it will be a lot of unpleasant, hard work for the team. No, that is too soft. If they made a mess, they have to fix it. Time to fall back on dogma. (Sound of firing cannons in the background ;-) All the time these balancing acts...

30 October 2017

Managing the Difficulty of Coding Exercises

There are different scenarios when we might want to change the difficulty of coding exercises. This depends on our skill and the topic we want to practise. If an exercise is too easy we get bored. There is still value in repeating the very same exercise, e.g. internalising certain patterns or improving keyboard navigation, but boredom does not help learning. Here is an unsorted list of options to increase (and decrease) the difficulty of coding exercises:

Most DifficultMaking it Harder: Constraints
A constraint, or activity, is an artificial challenge during an exercise. I have discussed some of them in the past. Some constraints like No If, Cyclomatic Complexity One or Only Void Methods are easy to follow but make it hard to write your usual code. To have more challenge chose constraints that work against the assignment, e.g. use an algorithmic challenge together with Only Void Methods. Algorithms are often functional in nature but void methods are no functions. Win!

To make things more interesting, constraints can be combined. For example, Object and Functional Calisthenics are constraints that combine several rules. When creating combined constraints, it is important to make sure the constraints work together. There is no point in forcing a functional style with No Void Methods and an object oriented style with Only Void Methods at the same time. When Martin Klose and I combined the Brutal Coding Constraints we spent around 20 hours experimenting and fine tuning them. By the way, these Brutal Coding Constraints are probably one of the most challenging.

When the list of constraints gets long, it is easy to make a mistake and forget to follow one or another. In these situations you need a reviewer, e.g. Coding Dojo facilitator, pair programming partner or static code analysis tool, who checks for violations of constraints.

Harder: Changing Requirements
Another way to spice up an exercise is to introduce requirement changes. This is particularly useful for groups, e.g. Coding Dojos, when participants do not know which requirement is going to change. For the usual Coderetreat exercise Game of Life, several interesting changes have been proposed, e.g. Hex Life, Vampire Cells and the toughest constraint (Wormholes) by Adrian Bolboaca.

I witnessed Martin Klose taking this to the next level: In his exercise Wind of Change, he puts on a tie (because he is the product owner now) and keeps changing the requirements every few minutes. This is a lot of fun and adds some time pressure as well.

Requirement changes is useful to verify a design, usually used in double sessions on software design during Coderetreats. When you are on your own, as soon as you finished the exercise, you think of changes to the requirements and how they would affect your current design.

Harder: Algorithmic Challenges
Algorithmic challenges vary from easy to impossible. Project Euler even has a difficulty rating on each exercise. Often algorithmic challenges are based on mathematics, which makes them not useful for people with less academic background. Also, as soon as you found a solution, the exercises get boring. Using additional constraints can make them fun again, but that would be different exercises then.

I have seen senior developers being more interested in algorithms than XP practises like Pair Programming or TDD. Algorithms are a perfect way to "lure" them into attending Coding Dojos. After a few dojos, people understand the value of practise and will agree to do basic katas with focus on TDD.

If you need a challenge, go for an algorithmic kata and chose a difficult exercise like Potter, Searching or one from Project Euler above number 20.

Harder: Try to be Faster
I do not like to apply time pressure during exercises, because people get sloppy when under pressure. On the other hand, this is what needs to be trained to not get sloppy. Houssam Fakih explains this with a short video (where three people throw basket balls. One is a beginner and fails from time to time, one is experienced and wins repeatedly and one, a "master", is doing the same, but much faster.) Houssam's suggestion is to do the same, but try to be faster. I did that once because I wanted to squeeze an one hour life refactoring demo into a 45 minutes presentation slot. It was hard work, exactly what I wanted.

BalanceWarning
When using constraints and other techniques I describe above, it is easy to go over the top. The exercises become too difficult and working on it is frustrating and eventually we stop doing it. While this might be OK for yourself, it must not happen when working with a group. Exercises like Brutal Coding Constraints are very difficult and not - I repeat - not suitable for a general audience. People tend to overestimate their skill and get frustrated easily.

When facilitating a Coding Dojo, I want to stay in control of the difficulty of the exercise for all participants. I aim for easier, simpler exercises and keep the difficult ones for myself. In rare cases, when I meet very skilled people, I assign them individual constraints, because I know them and I am confident that they will handle. I also make sure everyone understands that it is difficult what they want to do.

Making it Easier: Simpler Assignments
Start with a simple problem. There is always a smaller assignment, The smallest kata I know is FizzBuzz, it is just a single function. There is nothing wrong with FizzBuzz and its friends. I do it from time to time when I explore a new language or try different constraints (or when it is very late and I feel tired). Some function katas like Prime Factors are small too, but algorithmic in nature, so stay away from them. These katas are called FizzBuzz or Function Katas.

Easier: Use Well Known Problems
Solving a programming assignment includes many steps: e.g. understanding the problem, finding a solution, implementing the solution, testing it, etc. The assignment is easier if we get rid of some of these steps. If we use a well known problem, e.g. a ticket machine or a game everyone knows, we already know what is expected.

Easier: Clarify/Understand the Problem
Often the problem with an exercise is that people do not understand the problem. We are eager to get into the code, but we need to understand the assignment first: Take time to analyse the problem you want to solve. Google it. If it is a game like Tic-Tac-Toe, Minesweeper or Pac-Man, find an online version and play for a while. Draw some sketches or diagrams of what needs to be done. Create an list of initial acceptance criteria. To find them, you have to think about the problem. In Coding Dojos I ask people to spend the first ten minutes on creating a test list. This forces them into thinking about the problem.

If you practise with a partner, which I highly recommend, try Adi's pair programming game Solution Seeker. Solution Seeker makes you find at least three different solutions to your problem before you are allowed to implement one of them. This forces you to think hard about the problem and different options to solve it.

As a facilitator, make sure you fully understand the problem so you can answer any question about it. Give more explanations and discuss the problem from different angles. Provide posters or handouts of the problem for participants for later reference.

EasierEasier: Repeat the Same Exercise
Repeating the exactly same exercise is considered boring, but it helps. You will understand the assignment better after working on it once. After implementing it several times, maybe even in different programming languages, more and more aspects of the implementation are known and you can go deeper. (This why we run Game of Life in a Coderetreat six times. We do not want to fight with a new problem each session.) This is especially true for hard problems or if you are not satisfied with your process or final solution.

Easier: Focus on One Thing
After repeating the same exercise one or more times, the problem is sufficiently known and you can shift your focus to something else. Using a well known problem is also a way to focus on one thing, in this case you do not focus on solving the problem. There are exercises that isolate different aspects of development: For example, if I want to focus on finding test cases and designing unit tests, I go for the Gilded Rose. If I want to practice refactoring, I do Tennis or Yatzy. Both code bases contain ugly code which is more or less fully covered with tests, making it safe to refactor. There are exercises isolating other things, like incremental development, emergent design, SOLID principles, etc.

Koans belong into this category. Koans are series of little exercises, starting with basic things and building on each other to move to more advanced topics. They are useful to learn programming languages. They contain a list of failing test cases, where tiny pieces of code have to be filled in to make them pass. The idea is not only applicable to programming language constructs. For example I have created Unit Testing Koans to teach xUnit assertions and life cycle to junior developers.

All these exercises require prepared code. For example Gilded Rose is available in 26 languages, including lesser common ones like ABAP and PL/SQL. Trivia even contains COBOL and VB6 - which is very suitable for a legacy code exercise. Obviously prepared code limits the number of languages which can be used. If you want to practice in a new language like Elixir, Elm or Swift, you might need to port the code base first. Although, if the new language is trending, chances are high that someone already ported it.

Easier: Prepared (Helper) Code
Prepared code is useful in many situations, especially outside the core of the practise. Even code snippets or cheat sheets help. For example when I run the Data Munging exercise with focus on functional programming in Java, I show participants code snippets how to read the text file. File IO is not related to the exercise and I want them to spend time working with Lambda expressions and Stream.

Prepared code allows us to focus on one thing, but we need to understand the code first. Unfortunately this adds extra complexity. Unless you want to practice working with unreadable code, prepared code must be simple and super clean. Try to make it more expressive, maybe even verbose, than your usual code and use very descriptive names. Describe the code in the assignment. If there are more methods or classes, visualise their relations. For example in my Test Double exercise, I added a simple diagram of the prepared classes and their collaborators.

Easier: Guide Step by Step
Alex Bolboaca once told me that as facilitator of an exercise it is most important to manage participants' frustration. When I notice that most of the participants are unable to move forward, I take control of the group and guide them step by step. I am not giving them answers, but moderate the necessary process. Maybe we need to discuss the problem before hand on a white board. Or we discuss potential solutions up front. To get an initial test list, I keep asking how we will verify our product until we have a reasonable number of test cases. Sometimes I switch to Mob Programming where the whole group works on the assignment together and I am able to support them best (a.k.a. micro manage).

Conclusion
There are many options to make coding exercises easier or more difficult. I recommend starting easy. There is no point in hurting yourself or others. ;-)

Thanks to Kacper Kuczek and Damian Lukasik for discussing this with me.

8 April 2017

33 Days of Education

Empty OfficeIT is a fast moving industry. Heinz Kabutz says that "we are in an industry with a knowledge half-life of at most 18 months. [...] Half of what you knew 18 months ago is worthless today, so you need to keep learning new things." We need to learn a lot, fast and continuously. Today even traditional companies recognise the need for professional development, also - or especially - for senior and expert level employees. (I could argue that senior tech people need more training than junior ones, because their time of dedicated learning in school or university has been longer ago, but I am digressing.) All companies I have seen, offered five days of professional training by year. (Unfortunately, not all employees take the opportunity to use this training budget, but that is another story.) A few companies have a stronger focus on self-development. For example the Swiss Zühlke Engineering offers ten days of professional training. (At least they did in the past, as confirmed by several Zühlke employees I met.)

Obviously ten days are twice as much as five, but I believe we need more. A few companies allow Research or Lab Fridays from time to time, following the idea of 20% time, made famous by Google Friday. While slack at work is focusing on innovation, the time is also available to learn. In the end, exploring new ideas is related to both. One of my clients runs a "Basteldonnerstag" once a month, which adds another ten days. sipgate runs Open Fridays every second week. So we are up to 20 or even 30 days for your professional development each year, I like that.

My Personal Development
As Code Cop I am working with my clients on different things. Some clients use technologies I have never seen before. Still my goal is to help them to improve. It could be as simple as writing unit tests with a xUnit styled testing framework - or as alien as modularising a legacy application written in an old, purely procedural language.

I learn a lot and need to learn more. I am conscious of the time I spend on learning. I think about learning methods and try different approaches, e.g. flash cards. I am still performing code katas, on my own and together with others.

2016
When reflecting about last year, I think that I could have done better. I had interesting work and got a lot of new experience, but I did not attend all training that seemed necessary and I did not visit as many conferences as I needed to visit. I worked full time and had to squeeze in the occasional learning. Out of curiosity I counted the days spent on learning last year. I was very surprised when I found 33 full days spent on professional training:
  • 9 days of conference presentations. Last year I attended 5 traditional conferences, e.g. GeeCON, full of great talks and coding demos.
  • 6 days of classic training like training courses or workshop days before conferences.
  • 2 days of unconference sessions. Unconferences like SoCraTes are less structured than traditional conferences and enable discussion and deliberate discovery of new ideas. Usually I am hooked up with a new topic after attending.
  • 9 days of personal workshops. These include Journeyman Visits, Code Camps and meeting with other people to work on a research topic for a whole day.
  • 2 Coderetreats. While some unconferences include Saturdays, Coderetreat happens on Saturday by design. I am attending them rarely because usually I am facilitating them.
  • approximately 5 days of pair programming practise. I remember 18 sessions either remote pair programming or attending Coding Dojos. Usual sessions last 2 to 2.5 hours.
This list does not include books I read, user group meetups, side projects or writing blog posts - all these activities are an essential part of learning, too.

After seeing these numbers, I am impressed with myself. ;-) 33 days are a lot, and one third of them was spent on evenings and weekends.

Previous Years
So 2016 was a good year for my personal learning. How about the previous years?

Days of Learning by Year
2015, shown in the orange bars, is pretty similar to last year (blue bars). Surprisingly I spent 33 days on professional development, too: one workshop less and no Coderetreats, instead more remote pairing sessions. In 2014, shown in yellow bars, I fell a little short. I did not attend any training or unconferences and did fewer workshops. Becoming independent enabled me to visit (paid) training and I just discovered the opportunity of unconferences and workshops back then. Still I had more than twice as many pairing sessions, summing up to 27 days of professional development.

Conclusion
While I felt bad about my personal learning earlier, these numbers satisfy me. 33 days sounds much and I am starting to pride myself on them. I have no way to compare, I know people who attend at least one conference each month, which already sums up to 24 days at least. So maybe 33 days are not that many after all. So I might/ should/ could do more (MOAR PROFESSIONAL DEVELOPMENT!!1!), but I am pretty sure that I will not. I did not aim for 33 days in the past and I will not do so now. I am very busy, both with my work and my major ongoing side project. On the other hand, this year was full of opportunities and I already spent 12 days professional training in the first quarter.

20 February 2016

Memorising Keyboard Shortcuts

Two months ago I found a set of flashcards with IDE shortcuts and started learning them. After using the cards for some time, I noticed that memorising all the shortcuts is really hard for me. While many key combinations are sort of mnemonic, e.g. Ctrl-Alt-m to extract a method, some are not, e.g. Ctrl-Alt-l to format the source. I struggled to remember the shortcuts, mixing up the modifier keys all the time. It was frustrating to answer a card wrong for the n-th time and I had to reduce the number of cards I studied each day.

There is not much information in a key sequence like Alt-F12 to make it a reasonable entity to remember. There is no story around it, nothing to relate to. I have heard of people being able to remember huge numbers by translating them into sequences of pictures - a story, which is much easier to keep in memory.

Old KeyboardOn my German QWERTZ keyboard there are 105 keys. Ignoring the number block and a few other keys, there are up to 70 keys which might be used in shortcuts. There are three modifier keys which can be combined into eight combinations. (I ignored the Windows and Menu keys and till now have not seen an IDE that made a difference between left and right Shift or Alt.) Not all combinations of keys are special, e.g. Shift-a is just an A - I counted 400 potential shortcuts to activate IDE functions. Further some shortcuts mean (hopefully similar but) different things in different contexts, e.g. inside the editor window or navigator.

Modifier Keys
I do not know how translating the shortcut into a story might help, but I will experiment with hints for modifier combinations at least, because I never seem to get them right. Changing the order of modifier keys between shortcut descriptions makes things more difficult and I have not found an order which is easier to remember for me. Any ideas anyone?

Maybe some research is needed: The Control key was created to zero the leftmost two bits of the generated ASCII character. This created values below 32 which controlled where the next character would be placed on the display device. Its symbol is the helm, U+2388 (⎈). The Alt key was used to set the high bit of the signal generated by the other key. Its symbol is the alternative key, U+2387 (⎇). The third modifier is the Shift key, shown as an upwards white arrow, U+21E7 (⇧). It is the oldest of the three keys as it was used in typewriters to shift up the case stamp to change to capital letters.

By position on the keyboard and their prior usage, I sort Control before Alt, as in Ctrl-Alt-Delete. I am not sure where to put the Shift. JetBrains' Help puts the Shift between Control and Alt. The question for me is if Shift is a part of the character, e.g. uppercase A. I will have to experiment with Ctrl-Shift-Alt-something and Ctrl-Alt-Shift-something.

Visual Hints
I noticed that I take visual hints from the question, i.e. the typeface and text describing the shortcut, e.g. "Switch between views". Maybe that is how the brain works but this is not the kind of memory link I want to establish between the desired action in the IDE and the shortcut that activates it. Maybe I need a more visual representation to remember the shortcuts. The symbols (helm, alternate, upwards arrow) are very different and could be useful.

I experimented with Anki and it is possible to add pictures to the flashcards. I plan to create a new deck of cards containing a picture marking the actual keys on a keyboard. I hope that the visual representation of the keys will help me remembering them. Unfortunately images if keyboards make some shortcuts layout specific, e.g. Ctrl-z is in a different location on an US/UK layout than on my German one. As I plan to master both layouts, I will have to create and study the visual layouts of the relevant shortcuts twice.

Muscle Memory
Knowing the list of available functionality and their key combinations can only be the beginning of my "I know all shortcuts journey". There is no doubt I will need to practise typing them. I hope that knowing them will shorten the actual practise needed. Using flashcards allows me to study a few shortcuts whenever I have an extra minute, e.g. on the subway or when I am early for an appointment.

Going Crazy
I am already working on my "absolute mastery" deck. It will contain all the shortcuts of Eclipse, IDEA, Vim and possibly other tools like Word or Firefox, using both pictures of the US and German keyboard layouts when necessary. Creating all these images will take some time - coding time of course, as I will not draw them manually ;-)

6 January 2016

IDE Shortcut Flashcards

From time to time I need to look up certain keyboard shortcuts in IntelliJ IDEA or PyCharm. (This would not be necessary would I use my proper keyboard always.) While there are official productivity guides, I usually just google the shortcut. There are plenty of pages listing the basic and more useful ones, nothing special indeed. But the one Google showed me the last time was special: 69 things you should know about IntelliJ IDEA by Krzysztof Grajek.

Remember theseThe list of IntelliJ IDEA commands was as expected, but at the end Krzysztof had put something new: flashcards. Flashcards are a great way to learn short facts. While I am aware of flashcards, I have not thought about nor used them since many years. I got curious and immediately downloaded them.

The package was an apkg, a file format used by Anki, a free flashcard application. According to Wikipedia Anki is most feature complete and available on many platforms, including smart phones. The apkg file is just a zip including a SQLite database, so it is pretty light-weight.

Unfortunately Krzysztof's original deck was created for the Mac version of IntelliJ, so I had to translate and verify it. Some shortcuts did not map to Windows keys (or were not available any more), so my IntelliJ IDEA shortcuts for Windows flashcards just contain 59 cards. There were several keys I did not know and a few I had never heard about. I recommend you instal the mobile version of Anki and start learning more shortcuts today!

There is also a community sharing Anki decks and I immediately looked for Eclipse shortcuts. I found a large deck of 91 cards for Eclipse, which - again - was created for the Mac version of Eclipse. I translated and verified them as well, which was much easier because I have been using Eclipse for more than ten years. Here are the Eclipse shortcuts for Windows flashcards.

Download 59 IntelliJ Shortcuts Win.apkg here. Download 91 Eclipse Shortcuts Win.apkg here.

24 September 2015

What I Learned on Tour

When you think about doing your own Software Journeyman Tour I guess the most interesting questions is what you will learn. After all such a tour is mainly about learning and seeing how other people work. The time (and money) put into such a tour should be worth it.

My Expectations
To be fair I need to discuss my expectations first. In retrospect my expectations were not clear. I did not follow Daniel's rule and had not defined an explicit learning goal. (See my previous discussion on how to go on tour for details.) I had expectations that I would pair with fantastic masters of our craft, who are much superior to me, and see astounding things. That was not measurable and definitely not clear enough. There was no goal and I did not align my plans accordingly. Obviously my expectations were too high, sigh.

When starting my tour I knew TDD well and had been developing professionally since more than a decade. In contrast to that many of my pairing sessions were basic. I helped developers to create their first unit test. Maybe I should have done the tour five years earlier. Daniel even proposed that the perfect time for a Journeyman Tour might be for young developers with two to three years of experience.

Lina Bo Bardi, SESC PompéiaA friend called me a master and remarked that masters do not go rounds any more. They do not learn like that (Smi's rule). I am no master but there seem to be diminishing returns for a learning tour if you are already advanced in some areas. Some coder friends have also expressed this concern.

Concrete Learnings
To give you an impression here is a list of all concrete learnings of the first and second week. I spent ten days pair programming with four different people in this time. While it is hard to express the real learning, here are the things I found interesting enough to write down during the sessions:
  • Learned about little HTML5 games and their way of publishing and making money.
  • Brushed up my IntelliJ IDEA short-cut knowledge.
  • Improved my Mechanics of pair programming, how to deal with exhaustion and zoning out.
  • How to handle dependencies with local and shared lock files.
  • Startup developers are "poor" creatures because they support their customers, do operating, fix bugs, help less technical co-founders and have very little time for actual development.
  • I coded Python for the first time - or more accurate - paired on Python code.
  • oh-my-zsh with plugins is an useful shell extension.
  • I relearned Vi as it had been many years since I had last used it.
  • I paired on existing C# code for the first time.
  • The "Rename Overloads" is a nice function of Visual Studio (or Resharper) that I had not seen in Java yet.
  • When the current Pomodoro finishes, run the tests.
  • I learned more about dependencies of OSGi bundles and their problems.
  • Deploying OSGi bundles in an OSGi aware server is a real pain.
  • It is possible to create a cash flow calculation and business plan in a pair as well.
If I multiply these items with the total of 13 weeks, I get around 80 to 100 interesting things I saw. So yes, a Journeyman Tour is a great way to see many things. I worked on many things for the very first time in my life, e.g. I had never even seen Python, C#, VBA or Typescript code or developed for Google App Engine or opened Netbeans etc. I gained lot of experience on many different things in a short time. Maybe the experiences lacked depth. For example how much learning can you expect from two days Typescript? I spent a maximum of three days in a company working with one or sometimes with two different developers. Maybe I should have worked at least a full week on one topic to get deeper insights. Daniel spent a whole week at each host and considers it the perfect length for a Journeyman visit.

Practice
The tour gave me a lot of practice in different areas, maybe I had even more practice than learning new things. I had little pair programming experience before. On my tour I pair programmed all day, each day for almost three months. That improved my pair programming skills by far. In the end of the tour I was able to get in sync with a new pairing partner quickly. Since my tour I love pair programming. I feel stupid when working alone, so I rarely do it nowadays.

Next I practised getting productive in a new project. By running Hackergarten in Vienna for more than a year I was already comfortable with that. On my tour I figured out how to ask for the right amount of context without slowing down my pair with too many questions. Today I am confident to be productive in a new project or technology within a few hours - with the help of a pairing partner who knows the area of course. This conforms to Corey Haines' observation that he learned most how to start with an unfamiliar code base immediately. While this is very helpful for my current occupation as Code Cop and Freelance Code Mentor, I do not know how much this would help you during regular development, where you stay in the project for months of even years.

Luxury Gold Ring Designs For Golden JewelryValue
I understand the value of practice and like working on code katas and other practice exercises. Still my improved IntelliJ IDEA short-cut-fu feels less valuable than working in Typescript because there was nothing new in the former and everything new in the later. I know that my feeling is wrong. The mastery of IntelliJ short-cuts is important and helps even when working in other languages (as long as I stay with JetBrains products) while the basics of another static, object orientated, main-stream language are forgotten soon (unless I get into a real project, which I did not).

Some of my learnings were not interesting, e.g. creating an Excel cash flow calculation was not what I expected to do nor had ever wanted to. Working with my pair on the tasks he or she had chosen forced me to a few boring things, that I hated and would have never done on my own. It was painful but definitely broadened my horizon. Maybe these are the most valuable experiences because I would never get them otherwise. Or maybe these experiences are useless because I will never do such things and I wasted a few days of my life. I am unable to decide.

Satisfaction
My expectations partly fulfilled by learnings and practice, which both have a vague value, result in a certain feeling of satisfaction. Still many questions remain. Am I satisfied with the outcome of my tour compared to the time and money involved? What is the value of the things I learned? Could I have learned more useful things in a shorter time? And even if, would I have learned it (or done something else instead)? Maybe more interesting to you is if you would be satisfied with such a tour?

So let us look at some hard facts again. Before my tour I got in touch with 32 companies. During the 60 days of my tour 16 companies hosted me and I paired with 26 people. I further attended two conferences and 15 user group meetings in the evenings. My overall statistics shows me 40% of great pairing sessions which were awesome and where I had insights into TDD or a lot of fun. Then there were 40% of tolerable pairing sessions which were sort of OK. The remaining 20% were bad sessions, where I did not learn much or even felt like crying. It is true that you learn from everybody, even from very beginners, but e.g. handling difficult people was not on my list of learning goals.

Conclusion
Even with some of my expectations not satisfied, my Code Cop Journeyman Tour was one of the most interesting and most intense times of my life. Its overall experience was awesome. Half of the time I did great work while pairing with amazing people. I learned around a hundred new things and had a lot of practice. In comparison, had I stayed with my previous employer I would have experienced a few great days and learned a few new things during regular work. The tour made a massive difference for me and I am glad I went for it. Until today I plan for single Journeyman visits from time to time. Last year I spent three days pair programming for food. While this is less than 2% of my total work time, I am still proud of myself that I kept the spirit of the tour.

just do it.Final Recommendation
If you came here to check if it is worth to go on tour then my answer is yes. A Pair Programming Tour is a great thing to do. Even if you go for a single month, visiting only four companies for a few days each, you will see a lot of new things and work with people you never worked with before. It is the right thing to do. Now go and do it!

18 April 2014

How to divide learning time

As software delivery professionals we constantly need to learn and practice to keep our skills sharp. Last year I even spent three months pair programming to do exactly that. Possible activities required for learning and related to the sharing of knowledge are:
  • (a) studying, e.g. reading technical books or blog posts, watching (recorded) presentations as well as any form of consuming knowledge.
  • (b) practising, e.g. doing code katas, attending Coding Dojos or working on fun (but otherwise useless) projects.
  • (c) experimenting, which includes creating prototypes or trying out new frameworks or ideas.
  • (d) creating something real, e.g. hobby projects or maybe contributing to Open Source.
  • (e) documenting and sharing, e.g. creating how-to documents or writing blog posts.
  • (f) teaching, e.g. preparing presentations and talking at user group meetings.
Why are documenting, sharing and teaching considered learning activities?
Obviously sharing is no learning activity by itself but the process of analysing and describing things improves our understanding similar to Rubber Ducking. For example writing an article about some topic is a great way to bring one's thoughts into order and learn more about it. Documenting and sorting knowledge is also part of PIM (Personal Information Management) which is related to learning as well. Teaching is considered a learning activity by most people. Teaching is a great way to perfect the understanding of an idea. This is sharing on steroids as you are forced to dig deep into the topic to be able to explain it to others.

Piano LessonsHow should I divide my learning time into activities (a) to (f)?
With the start of 2014 I came back to (sort of) regular work and obviously my personal time for learning became limited again. I was not sure if I spent the available time in the most efficient way and looked for guidelines how to divide my learning time into these activities. All activities (a) to (f) seem vital, but likely do not have the same priorities. For example there are so many important books to read, I could spend all my time on reading alone, which does not feel right to me. Sören Kewenig pointed out that items (a) to (f) might be seen as the phases of a project: a -> [c,d,b] -> e -> f, which also indicates that all these activities are important and related.

This question is subjective ;-)
As usual when I have a question I ask StackOverflow. In this case I asked on Programmers. Unfortunately the question was closed in less than 19 minutes as being off-topic. (Many of my questions I ask on StackOverflow get closed but 19 minutes is my personal record so far ;-) While it is true that learning is a subjective process, there might be some research that gives clear advice how to optimise learning activities.

Comments suggest that practice is the key.
Nevertheless I was able to harvest at least some comments from my StackOverflow question. Robert Harvey wrote "if you're not writing code that illustrates the principles being taught, they won't stick. [...] I am saying that, without practice, the other stuff won't matter." I conclude that there needs to be a strong focus on (b) or (d) until the newly acquired material is incorporated into the daily work and applied every day. Then I asked my fellow craftsmen of the Softwerkskammer, the Software Craftsmanship Communities in Germany, Austria and Switzerland. Sören answered me that he used 50% of his free time for Coding Dojos (b) and 50% for working on Open Source (d). Jan Sauerwein spends his time on code katas (b) and preparing a lecture (f). Franziska said that she liked learning with others and therefore favoured (b), (c) and (f). Ulrich Merkel said that developing skills needs as much practice as possible - (b), (c) or (d), but probably he was talking about real work - together with discussion and feedback as corrective. So all answers agree that practice, either by real work or (b), (c) or (d) is important.

How I divided my learning time till now
Franziska asked me how I divided my learning time till now. Yes I should have checked my own time before asking ;-) So I started tracking my learning time. For several weeks I spent an average of 10 hours on learning activities.
  • (a) studying: 20%. I spent some time reading. I am participating in an online book club which forces me to keep up reading and allows for discussions afterwards. I read the book while commuting. Further I browse my feeds of blogs and news to get an overview about what's going on and to stay aware of new trends.
  • (a) studying: 30%. I watched presentations. This includes user group presentations as well as recorded ones.
  • (b) practising: 20%. Once a week I meet online with a friend to do remote pair programming. We schedule the appointment up to one month in advance, to make sure it even happens when workload is high - and it usually works.
  • (d) creating stuff is still part of my job, although recently I am not doing as much development as I used to do.
  • (e) documenting: 10%. I used some time to look up slides of seen presentations and to take notes about what I have learned.
  • (e) sharing: 20%. An average of two hours went into writing blog posts, which was not enough to publish a full article but I worked on fragments of posts which eventually will be published.
  • (f) teaching is part of my new profession and I prepare a presentation now and then. Sometimes I also present something at user group meetings.
My Learning Time % Till Now
This looks pretty balanced, there are no huge gaps. I am surprised how much I do read because I always feel like I should read more but then I am too tired most evenings. Maybe I should watch more demonstrations though. Also 20% practice might not be enough compared to the previous comments by Robert and Sören.

The Learning Pyramid
Not all learning activities are equally effective. For example I remember a vivid discussion about something much better than just reading about it. Edgar Dale summarises these findings as Learning Retention Rate which ultimately leads us to the Learning Pyramid. In the Learning Pyramid, the learning activities are ordered by how much they pay off.

Learning Retention Rate % by Edgar Dale
When looking at these rates I see that I need to add another activity to my list: discussion, which might happen during user group meetings, practice with others or teaching. So let me revisit my tracked learning time and distribute it according to the pyramid.
  • Lecture, 5% retention. Next to real lectures that I sometimes attend, I consider some user group meetings to be in this category. Sometimes presentations are of mixed quality and there is not much discussion. 15% of my learning time (a) goes here.
  • Reading, 10% retention. I spend 20% of my time reading (a).
  • Audio-Visual, 20% retention. To be fair, not all presentations I see are boring, so I consider some of them to be of this category. Here I spend another 20% of my time from (a).
  • Demonstration, 30% retention. It is difficult to assign one of these categories to a typical user group talk or conference presentation. Some presenters give high quality demonstration, but I see this rarely, maybe 5%.
  • Discussion Group, 50% retention. Especially in the reading group (a) there is much discussion. Maybe 10% of my time is of this category.
  • Practice by doing, 75% retention. With two hours of pair programming code katas (b) each week I score 20% here.
  • Teaching others, 90% retention. As I teach as part of my day job (f), I did not track the time. Also I am left with two hours documenting and blogging (e) which do not fit into the pyramid. To make things easier I will just award myself honorary 10% here.
When multiplying my learning time by the retention rate I end up with a weighted learning time, let's call it my "effective" learning time:
My Effective Learning Time %
  • Lecture 2%,
  • Reading 5%,
  • Audio-Visual 10%,
  • Demonstration 4%,
  • Discussion 14%,
  • Practice 40%,
  • Teaching 24%.

How I (maybe) should divide my learning time
It is time for a conclusion. I have spent some time analysing the topic - and this made some things clear to me - call it meta-learning. I do not know if the final distribution of my effective learning time is well balanced or not. On one hand the activities with smaller retention rate obviously do not pay off, so there is no point in doing more of them. On the other hand - maybe - there would be some benefit in spreading the learning across all activities. As the retention rates (5, 10, 20,...) look (sort of) exponential, the effective learning would also look exponential for equally distributed learning times.

Now I see that my feeling about not reading enough comes from the fact that I do not learn enough while reading, which is obvious when looking at my effective learning time for reading. Even if I would add another hour of reading each week, it would not make much difference. But I still believe that it is important to read technical books, because it is a good way to cover a topic in depth. So I will stick to my reading routine of one to two hours each week. I will continue watching presentations, because I usually watch them during cardio-workout. I will add demonstrations, but I am not sure where I could find these. Maybe I will look for user group meetings with live coding. I am doing a lot of practice already, and it is dominating my learning. I will have to think about this. Just half an hour moved from practice to teaching each week might improve my effective learning. So even if I give presentations as part of my day job, I will look for user groups willing to listen to me ;-)

As others already pointed out, different people have different learning styles. Learning styles might even change for the same person over time. I am very interested in your take on dividing learning time and how you think the few hours of personal learning could be spent best.