Deliberate Practice and Coding

Deliberate practice applied to coding offers some unique opportunities. Unlike other skills, like learning to play the cello (to pick one that I have some experience with), you can go very far without a personal mentor. The feedback from the computer is about as objective as it gets. It will let you know exactly how good your code is.

This also helps remove the emotional component – positive and negative – that can sometimes impede progress with an in-person mentor. This doesn’t remove all emotion, however. Just about everyone who’s worked in a professional coding shop has witnessed the rare occurrence of a coder cursing at or even physically attacking their computer because their code isn’t working as expected. Those are surreal moments when an avalanche of cognitive biases and unconscious behavior become visible to all but the coder. That’s a topic for for a different post. Suffice it to say, learning how to control your emotions, channel frustration, and ignite curiosity is part of what distinguishes good coders from great coders.

Which gets met to finding quality feedback. While I’ve made a good living writing mountains of proprietary code for various business and corporations, I earned my coding chops by working on or authoring open source projects. This was the best source I found for getting feedback on my code. It also taught me another important lesson: Do not attach your identity to the code you write. Like any noob, I had a lot of pride in my early code that was pretty much untested outside my little work environment. In the open source world, the feedback was often swift and harsh. Or, at least is was when my identity was attached to it. Learning to separate work product from identity revealed just how much emotional spin I was putting on what was in hindsight reasonable feedback. I have concerns that the current climate in the coding world is opting for soft feedback and good feelings over legitimate and reasonable feedback. This, too, is for another post.

It’s worth giving some thought about the the pros and cons of working with an actual person for mentorship. Along with good instruction, a single mentor will pass along their own limitations and biases. Not necessarily a bad thing, just something to be aware of. So multiple mentors are better than just one, which starts to move down the path of actively participating in open source projects. By “actively” I mean not just contributing code, but studying the code (and it’s history) of existing successful projects. There are usually many ways to solve a problem with software. Work to understand why one approach is better than another. Insights like this are best gained, in my experience, by studying good code.

Somewhat related, if you are working from a book or a training program, actually type in the examples – character by character. Don’t cheat yourself by copy-pasting code examples. This is the muscle memory component to coding that you will find when learning other more physical skills (like playing the cello.) If you really want to experience the gnarly edge, ditch the IDE and code with at text editor. I still do all my coding in vim and this keyboard.

Another approach to deliberate practice is the idea of coding “katas.” This never clicked with me. I attribute this to having studied martial arts for 25 years, most of that time at the black belt level. Mapping the human psycho/physical world and the purpose of katas in the dojo to the machine world is too much of a mis-match. Much is lost in the translation, in my experience. The katas in the dojo, regardless the art form, translated easily to other styles and practices. The coding “katas” are more tightly coupled to the coding language in which they are written. In my view, it’s yet another example of swiping a cool sounding word and concept and force-fitting it to another domain. A software version of cargo cults – expecting form to create function. “Black belt” or “Ninja” coder are other force-fits. Yet again, something for another post.

But those are my limitations. Your experience will no doubt be different. As learning exercises and proficiency tracks, many of the coding “katas” look to be very good.

(For related thoughts on how building your own tools can deepen your understanding of a skill, see “Tools for Practice.” The examples in the article combine software development and cello practice.)

 

Image by Robert Pastryk from Pixabay

The Path to Mastery: Begin with the Fundamentals

Somewhere along the path of studying Aikido for 25  years I found a useful perspective on the art that applies to a lot of skills in life.  Aikido is easy to understand. It’s a way of living that leaves behind it a trail of techniques. What’s hard is overcoming the unending stream of little frustrations and often self-imposed limitations. What’s hard is learning how to make getting up part of falling down. What’s hard is healing after getting hurt. What’s hard is learning the importance of recognizing when a white belt is more of a master than you are. In short, what’s hard is mastering the art.

The same can be said about practicing Agile. Agile is easy to understand. It is four fundamental values and twelve principles. The rest is just a trail of techniques and supporting tools – rapid application development, XP, scrum, Kanban, Lean, SAFe, TDD, BDD, stories, sprints, stand-ups – all just variations from a very simple foundation and adapted to meet the prevailing circumstances. Learning how to apply the best technique for a given situation is learned by walking the path toward mastery – working through the endless stream of frustrations and limitations, learning how to make failing part of succeeding, recognizing when you’re not the smartest person in the room, and learning how to heal after getting hurt.

If an Aikidoka is attempting to apply a particular technique to an opponent  and it isn’t working, their choices are to change how they’re performing the technique, change the technique, or invent a new technique based on the fundamentals. Expecting the world to adapt to how you think it should go is a fool’s path. Opponents in life – whether real people, ideas, or situations – are notoriously uncompromising in this regard.  The laws of physics, as they say, don’t much care about what’s going on inside your skull. They stubbornly refuse to accommodate your beliefs about how things “should” go.

The same applies to Agile practices. If something doesn’t seem to be working, it’s time to step in front of the Agile mirror and ask yourself a few questions. What is it about the fundamentals you’re not paying attention to? Which of the values are out of balance? What technique is being misapplied? What different technique will better serve? If your team or organization needs to practice Lean ScrumXPban SAFe-ly than do that. Be bold in your quest to find what works best for your team. The hue and cry you hear won’t be from the gods, only those who think they are – mere mortals more intent on ossifying Agile as policy, preserving their status, or preventing the perceived corruption of their legacy.

But I’m getting ahead of things. Before you can competently discern which practices a situation needs and how to best structure them you must know the fundamentals.

There are no shortcuts.

In this series of posts I hope to open a dialog about mastering Agile practices. We’ll begin by studying several maps that have been created over time that describe the path toward mastery, discuss the benefits and shortcomings of each of these maps, and explore the reasons why many people have a difficult time following these maps. From there we’ll move into the fundamentals of Agile practices and see how a solid understanding of these fundamentals can be used to respond to a wide variety of situations and contexts. Along the way we’ll discover how to develop an Agile mindset.

Photo by simon sun on Unsplash

The Novice and the Master

When coaching people in a new skill, there are several things I watch for in their development from novice to master. Insuring they have the requisite foundational knowledge can be considered a given. Tightly coupled with this is a demonstration of working from first principles. If neither of these are in place than it can be said the learner has yet to begin their journey toward mastery.

Beyond the basics, I look for signs of what’s happening behind the curtain. I watch for how they respond to challenges and conflict. And how they work through difficult decisions.

How a difficult decision is handled is an important indicator for whether an individual is a novice, a master, or somewhere in between. Where novices struggle trying to figure out what to do, masters resolve quickly. Certainly a common issue in play would be doubts about the outcome of any particular action and the probability of recovering from any associated consequences. It is also possible that the issue – either instead of or in addition to – is that the novice has become stuck at a decision node that has an uncomfortable degree of uncertainty associated with it on the front end and they are unskilled at thinking through the “disjunction,” as Eldar Shafir1 calls situations like this.

With the former issue, the tack taken by the novice is to plan out as many details as possible so as to account for every contingency and squeeze out as much doubt as possible regarding the outcome. In the later, the novice simply doesn’t have the information needed to make the decision and lacks the skill to play out n number of scenarios leading up to the decision node such that they can then evaluate subsequent paths.

An example given by Shafir has to do with a student that has just taken a rather important exam (say, for graduate school) but doesn’t yet know the results. If they’ve passed, they move forward. If they’ve failed, they have to retake the exam in a couple of months after the end-of-year holidays. On the same day, they are presented with a incredibly sweet deal for a 5-day Hawaiian vacation over the end-of-year holidays. The vacation deal is good for today and grades won’t be released until tomorrow. What does the student do?

Notice that the outcome of the exam will be known long before the vacation begins. Thus, the uncertainty characterizes the present, disjunctive situation, not the eventual vacation. Additional, related versions were presented in which subjects were to assume that they had passed the exam, or that they had failed, before they had to decide about the vacation. We discovered that many subjects who would have bought the vacation to Hawaii if they were to pass the exam and if they were to fail, chose not to buy the vacation when the exam’s outcome was not known. The data show that more than half of the students chose the vacation package when they knew that they passed the exam and an even larger percentage chose the vacation when they knew they they failed. However, when they did not know whether they had passed or failed, less than one-third of the students chose the vacation and the majority (61%) were willing to pay $5 to postpone the decision until the following day, when the results of the exam would be known.

A solution to this simple example of disjunction (Shafir provides many other examples) is for the student to ask themselves two questions:

  1. “Would I take this vacation deal if I passed?”
  2. “Would I take this vacation deal if I failed?”

If the answer is “Yes” to both or “No” to both, then the decision about the vacation deal is easy. If the answer is still mixed, then I suppose the student will have to dig a bit deeper to get at a level of leading criteria that will shake out the decision. (When I was a student, I would have had to consult my financial adviser – a.k.a. my wallet – first. The answer to everything beyond beer was “NO!”) In the experiment described above where students remained uninformed as to the outcome of the exam, they didn’t have a skill or strategy for resolving the uncertainty and were even willing to pay to make it go away!

Shafir’s work was instrumental in helping me tap into new skills for developing mastery in several areas of interest (specifically, martial arts and woodworking). Disjunction has a distinct visceral sensation for me. It gives me pause to ask questions not about potential future events, but about past events leading up to the present. I find I’m usually missing something about the history of events that either help sort out the indecision once known or cause me to think through better scenarios on emerging events that will influence the decision I’m trying to make.

References

1 Eldar Shafir’s chapter in “Cognition on Cognition” titled “Uncertainty and the difficulty of thinking through disjunctions”

Photo by Motoki Tonn on Unsplash