The Psychology of Money – Morgan Housel

The Psychology of Money

I read Morgan Housel’s “The Psychology of Money” towards the end of last year. I found it an insightful book that took a more personal and nuanced look at money and building wealth. It is not a “how to get rich quick book.” 
Its core advice is to take advantage of compounding and take a reasonable approach to risk — hardly rocket science. However, it explores some of the more common pitfalls and anti-patterns when people think of money. 
While I would strongly recommend everyone to read the book — it is fantastic, here is a quick summary of my notes from reading (and enjoying) the book. I hope you find it helpful!


A more personal view of money

People think of money as an abstract. We think about and are taught about money like we are taught physics. We assume that money is governed by rules and laws. Yet, psychology, with its study of emotions and nuance, may offer a better way to think about money.

Most people make financial decisions by taking the information that they have access to and plugging it into their mental model of how the world works. But these mental models are driven profoundly by personal experience.

Mr. Housel’s book takes a personal and intimate approach to understand how money works and illuminates some of the difficulties we face when making money decisions.


How to get rich and stay rich

Compound growth is the key to growing wealth. There is plenty of material available that describes viable strategies for becoming wealthy. However, Mr. Housel states that there is only one way to stay wealthy — “some combination of frugality and paranoia.”

If one can stick around for a long time without wiping out or being forced to give up, the power of compounding comes into play and helps generate wealth.

The key to a successful investment strategy is to not risk what you have and need for what you don’t have and don’t need.


The importance of sensible optimism

Successful investors take an optimistic view that, in the long run, the odds are in their favor, and over time things will balance out to a good outcome even if what happens in between is filled with misery.

But the optimism must be balanced with a healthy dose of paranoia. This means accepting nuance and understanding that the key to exploiting long-term optimism is survival.

It is critical not to get swept up in short-term momentum or get giddy about short-term gains or losses. The most effective long-term strategy is to not get overly influenced by short-term events.


Understanding wealth

When most people think about becoming a millionaire, they think of the ability to spend a million dollars. However, the true meaning of wealth is the ability to deploy money towards living a life that lets you do what you want, when you want, with who you want, where you want, for as long as you want. So, true wealth is financial assets that haven’t yet been converted into consumption.

The ability to save is also critical to building wealth. Savings are a hedge against life’s inevitable ability to surprise the hell out of you at the worst possible moment. The most potent way of increasing savings is not to raise your income but to raise your humility.


Making reasonable financial decisions

Financial decisions making is thought of as making coldly rational decisions in the light of available information and knowledge of the past. However, history is primarily the study of unanticipated events.

Therefore, relying on history as an unassailable guide to the future is risky. It is important to consider the past but to look at it in terms of generalities.

So, one must not be overly influenced by history and take a reasonable and pragmatic approach when making financial decisions. Having savings gives a buffer to absorb short-term volatility. Having a realistic and flexible approach to financial decisions makes it likely to stick with your investment strategy in the long run.


The role of skill and of luck

Money constantly changes returns. If an asset has momentum, a group of short-term traders will assume it will keep moving up. We have seen this play out in recent times with the GameStop saga.

It is not an unreasonable strategy for the short term. Executing such short term strategy doesn’t really require much skill but does need some luck in timing the strategy just right. Plenty of traders both lost and made huge amounts of money trying to time their GameStop trade. It was all about momentum.

The mistake we are susceptible to is focusing solely on what we want to do and have the ability to do. We ignore the plans and skills of others whose decisions might affect our outcomes. We also focus too much on the causal role of skill and neglect the role of luck. This makes us overly confident in our beliefs.

Less Certainty, More Enquiry

Lessons from Maria Konnikova’s The Biggest Bluff: How I Learned to Pay Attention, Master Myself and Win

The Biggest Bluff by Maria Konnikova

Maria Konnikova is a journalist, writer, and professional poker player. I came across her an interview with her on the excellent Knowledge Project podcast. She intrigued me enough to want to know more about her journey, so I picked up her book, “The Biggest Bluff: How I Learned to Pay Attention, Master Myself and Win.”

The Biggest Bluff is Ms. Konnikova’s account of going from being a complete poker novice to a tournament-winning pro. The book is not a “how-to” guide to making millions in Vegas. It is instead a meditation on learning, paying attention, and making decisions.

I enjoyed following Ms. Konnikova on her journey. Here are some things I took away from the book.


Paying Attention to the Present

Poker is a game of simple rules but complex behaviors. Success relies on luck and the ability to understand and predict what other players on the table might do. Ms. Konnikova had to pay attention to the cards on the table and how the other players had played throughout the day and tried and figured out what their tells were.

She also had to learn to pay attention to herself and identify when she was fatigued, and take appropriate action when going off course.

John Von Neumann describes poker as the perfect game of incomplete information. But, by paying attention, it is possible to identify when emotions get in the way of sound decision-making and to try and predict your competitors’ actions and consequences.

In life, just like in poker, paying attention to the present is table stakes.


Intuition vs. Process

Ms. Konnikova is dismissive of intuition or “gut feeling.” She says we have intuitions all the time, but we are terrible at telling the right ones from wrong. She suggests that we trust our intuition only if we are an expert in the area.

As a novice poker player, she had to work hard to identify and suppress false confidence. She did this by learning to distinguish the action and the outcome from the thought process. In the short term, it didn’t matter if she won or lost a hand provided she was thinking through things correctly. In the long run, this focus on process meant that she would have better inputs and eventually the right conclusion with more experience.

I agree with the author that we are terrible at linking outcome to process. Luck, both good and bad, always adds noise. But by having a thought-through strategy, we can avoid false confidence and learn to avoid the pitfalls of relying on unreliable intuitions.


Avoiding going Full Tilt

In poker parlance, “tilting” is when a player lets irrelevant emotion cloud their thinking. You start tilting when another player or an aggravating circumstance gets under your skin and makes you emotional.

As one of very few professional female poker players, Ms. Konnikova dealt with misogynistic behavior from her fellow players. From being called “little girl” to being propositioned on the poker table — these unpleasant experiences did end up getting under her skin and affected her game.

She came up with techniques to become mindful of her emotions. She wanted to experience them but be self-reflective and not let them affect her thought process.

Humans are emotional. We experience life through emotions and can never be purely rational. Ms. Konnikova says the key is to identify irrelevant feelings and develop strategies to ignore them — avoiding going full tilt.


Making Good Decisions

Poker forces a player to place a monetary value on the opinions driving decisions at the table. Having a flawed decision-making process makes going broke a likely outcome.

As she became a better poker player, Ms. Konnikova became less confident in her opinions. This may seem counter-intuitive — surely becoming more experienced means becoming more confident in your opinions! But Ms. Konnikova made better decisions when she forced herself to question her assumptions. Her decision-making process relied on paying attention, not relying on flawed intuition, and having a well-practiced process.

Judging the success or otherwise of a decision-making process is more straightforward in poker than in real life. If you lose money consistently, you might want to either stop playing or take a close look at how you are playing. Judging success in other domains may not be easy, but having a clear decision-making process remains crucial.


Conclusion: Less Certainty, More Inquiry

We often end up making decisions on auto-pilot. We take received wisdom and our intuitions for granted. When bad things happen, we attribute them to bad luck, crappy circumstances, or other external factors.

But, as Ms. Konnikova’s mentor advises her, it is better to be less certain about things and always inquire, ask questions, and to think through things for yourself.

To have any chance of success in complex domains, it is essential to be aware of blind spots, pay attention to what is happening, and have a deliberate and well-understood decision-making process.

The Biggest Bluff is an entertaining, well-written, and thought-provoking book. Ms. Konnikova’s journey pushed me to take a closer look at how I make decisions and to ponder where my blind spots lay.

Cultivating Range: Lessons for Startups in a Wicked World

Introduction

I recently read David Epstein’s book Range: Why Generalists Triumph in a Specialized World. The book focuses on how to cultivate broad thinking strategies to learn effectively. Epstein’s focus is on individuals. As I made my way through the book, I saw that the points made in this book apply equally well to teams.

Range by David Epstein

I work with and advise early stage technology startups. I learnt a lot while reading “Range”. In this post, I explore how the lessons from “Range” can benefit technology startups or teams looking to launch a new product.


Thriving in Wicked Environments

Epstein introduces the concept of Kind and Wicked environments. A chessboard is a kind environment: the rules are clear, and actions are deterministic. Strategies that work in one situation should work well in similar cases. However, in the real world there are feedback loops and second-order consequences that are difficult to predict. It is a rapidly changing Wicked environment. Strategies that worked well in the past can stop working due to changes to the external environment or the market’s reaction to your previous actions.

We see this pattern repeatedly in the world of startups. Ideas that seem destined for success fail because they attempt to solve a problem that is no longer important or serve a market that no longer exists.

To thrive in a Wicked environment, a team may need to take conceptual knowledge from one problem domain and apply it to an entirely new one. The ability to think broadly and to be able to deploy flexible solutions to complex problems could be the difference between a successful product launch and complete failure.


Creating Innovative Products Through Analogical Thinking

Epstein describes Analogical Thinking as —

“The practice of recognizing conceptual similarities in multiple domains or scenarios that may seem to have little in common on the surface.”

Barriers to entry in the information economy are low. While anyone can launch a software product or service, successful companies frequently bring together ideas from different fields to build a compelling product.

Uber brought together logistics, mapping, mobile experiences, and access to an entirely new labor market to create a transformational service. Snowflake’s recent success is another example of a business built on the convergence of industry and technology trends. They successfully executed a simple, in hindsight, idea — cloud-only data warehouses.


Building a Successful Team

In Superforecasting, Philip Tetlock quotes the Greek poet Archilochus: “the fox knows many things, but the hedgehog knows one big thing.” Hedgehogs are specialists — they love to focus on one problem and usually work within their specialty’s confines. Foxes tend to work across various disciplines and work under ambiguity and contradictory conditions.

Epstein cites Tetlock’s research in forecasting and shows that in the face of uncertainty, individual breadth is critical. Similarly, teams that were open-minded and embraced a wide range of experience outperformed teams of narrow specialists.

A Team of Foxes may be more effective in a startup

Early-stage teams need to be open-minded and willing to change their assumptions and pivot when circumstances demand it. As a company matures, it may become useful to include specialists to refine a product and idea. However, having too many specialists at an early stage could lead to tunnel vision.


Choosing a Technology Stack

Gunpei Yokoi was a legendary video game designer at Nintendo. He designed the Game Boy. In Range, Epstein talks about Yokoi’s concept of “Lateral Thinking with Withered Technology.”

The heart of his philosophy was putting cheap, simple technology to use in ways no one else considered. If he could not think more deeply about new technologies, he decided, he would think more broadly about old ones.

You can still see this philosophy in play at Nintendo today.

The Nintendo Gameboy — A Lateral Application of Withered Technology

This lesson is of particular importance for startups with technical founders. It is tempting to be on the cutting edge of technology. But few customers will pay to use a product because it uses a fashionable technology stack. The ability of the company to solve the customer’s problem is way more important.

It may be more productive and faster to build a product using battle-tested, well-understood technology that is quickly and cheaply available. Just like Nintendo, a startup must cultivate a relentless focus on delighting the customer. Technology choices should come second.


Deploying Data Carefully

Startups are encouraged to be data-driven. They optimize for metrics such as customer behavior metrics, sales funnels, infrastructure costs, etc. The danger for the startup here is relying too much on data to make decisions without considering the market or whether the data is relevant to the vision of the company. As Epstein says — the critical question to ask is:

‘Is this the data that we want to make the decision we need to make?’

A dogmatic data-driven approach may lead to doing the same thing in response to the same challenges over and over until the behavior becomes so automatic that it is no longer recognized as a situation-specific tool.

An over-reliance on data can lead to actions that may improve the metrics the team relies on, but may not help the company in the long run to achieve their strategic objectives.


Making the most of External Advisors

Formal or informal advisors can play a critical role to the founding team in a startup. The most effective advisors are outsiders who may be removed from the company’s problem but may help reframe the problem that unlocks the solution.

Epstein notes —

‘A key to creative problem solving is tapping outsiders who use different approaches so that the “home field” for the problem does not end up constraining the solution.’

An outside advisor may offer solutions to a problem the founding team may not even consider because they are too close to the problem.


Knowing when to Give Up

Thirty percent of startups will go under within two years. Fifty percent will fail within five. Running out of money is the most common reason for failure. If a startup keeps trying to execute the same plan despite not gaining traction, it will fail.

Startup culture venerates hard work and not giving up. But here, Epstein provides an essential quote from Seth Godin:

‘We fail when we stick with tasks we don’t have the guts to quit.’

The best, most thought-through plan may fail when it comes up against external conditions — like a global pandemic. Persevering through difficulty can be a competitive advantage, but knowing when to quit can also be a significant strategic advantage. As a startup, it is vital to define and understand the conditions in which it is clear that Plan A has failed, and it is time to try something else.


Conclusion

Building and running a startup is exciting, scary, and can be extremely challenging. It rewards being able to adapt to complex, changing environments. It is vital to pick the right problem to solve, identify the correct tools to solve the problem, and build a team that learns how to make the most of diverse skill sets. Leveraging data and being metric driven can help guide, but must not constrain decision making. Leaning on external advisors and investors is essential to help keep the team grounded and provide different perspectives to solve tricky problems.

Finally, success is not just about persevering through difficult times; it also involves knowing when to quit and when to pivot. A battle may be won simply by disengaging at the right time.

Range is a fantastic book and one that I strongly recommend. The lessons in the book are important not just for individuals but also for teams.

BioWare & Anthem: A Cautionary Tale

I love playing video games. My favourite game series is called Mass Effectmade by a game studio called BioWare.

I am a huge fan of BioWare’s games and I was looking forward to trying out their new game Anthem.

Anthem came out in early 2019 to universally poor reviews. The game was half finished, had poor gameplay and did not respect the player’s time. I ended up giving it a miss.

This week, Kotaku’s Jason Schreir has an excellent article about what went wrong with Anthem. It turns out Anthem’s development was troubled, and the development team faced the same sort of problems (some self-inflicted) that I have seen a few times in my career. I suggest you take some time to read the excellent article linked above. It is a wonderfully researched and well-written piece.


So what went wrong? Schreir’s article talks about game studio politics, financial pressures and many other contributed factors. I want to focus on what went wrong with Anthem as a software project. Here are some of my thoughts on this cautionary tale that I think may apply to many software development teams.


Building a product for a market you don’t understand

BioWare is famous for making role-playing games (also know as RPGs). The core team for Anthem had made well-loved games such as Mass Effect — single player, immersive, story-driven experiences. They were asked, by their owner EA, to build a multi-player, online, loot-driven shooter such as Destiny.

These games made money through micro-transactions; charging players small amounts of money to buy in-game items. The Anthem team did not understand the fundamentals of the product they were being asked to create. Basic mechanisms such as loot drops (where players get rare items for completing missions) did not work well. YouTube is full of players ranting about Anthem’s lack of loot.


Not being clear about the scope of the product

The Anthem lead team were slow in making decisions about critical features. Flying: a fundamental gameplay feature was added and removed multiple times. The team was only aware that flying was in scope following a demo to an EA executive who decreed that the game must allow it. This is like building a desktop app and not being sure whether mouse input should be enabled. It makes things difficult for the design and development teams.


Being forced to use a technology stack by decree

Most modern games are built using game engines such as Unity or Unreal Engine. EA mandated that all its games, including Anthem, must be built using the in-house Frostbite engine. They wanted to cut costs and re-use resources by not having to pay a licensing fee. Apparently, the Frostbite engine, while used successfully in games like the Battlefield series, was poorly documented and not suited to a game like Anthem. The development team struggled to make it work, and productivity suffered.

The same team that had made the Mass Effect series using the Unreal engine.


Shipping before being ready

A YouTube reviewer I follow mentioned that the game played as if the developers hadn’t even bothered playtesting their own game. The article talks about unstable builds and unavailable test environments. There was no time left for a thorough quality assurance process. When the game did come out, players complained about interminable load times and repetitive missions. There were also hard crashes and un-usable inventory systems: a big problem for a looter shooter.


In conclusion..

Anthem is a failure and has resulted in Bioware losing credibility as a game studio. I think it failed because it was a poorly managed software project. It was a poorly thought out product released in a broken state by a confused and stressed development team. This pattern is not unique just to the video game industry. I am sure software engineers of a certain vintage have seen this play out in a variety of industries.

4 Waves of AI – And why they matter

I can’t open a newspaper or visit my friendly local bookstore without coming across a think piece about why AI is a *BIG DEAL* and how it changes everything. The tone of most of the material that I have come across is aptly summed up in this classic xkcd panel.


Classic xkcd panel on AI

In January 2019, I read Kai-Fu Lee’s fantastic book “AI Super-Powers: China, Silicon Valley, and The New World Order.” Mr. Lee is a thoughtful, even-handed guide to what is going on in the field of Artificial Intelligence (specifically Machine Learning) and how it may impact our future. The book is also an eye-opening account of the Chinese startup eco-system — but perhaps more on that another day.

Early in the book, Mr. Lee talks about how the spread of AI is happening in four waves. These waves are:

  1. Internet AI
  2. Business AI
  3. Perception AI
  4. Autonomous AI

Let’s take quick a look at each of these waves.


Internet AI

We deal with Internet AI every time we shop online, scroll through our social media feeds or Google something. From AI Superpowers:

Internet AI is mainly about using AI algorithms as recommendation engines: systems that learn our personal preferences and then serve up content hand-picked for us.

Examples of Internet AI include online advertising optimization, personalized news feeds, and algorithmic content recommendation.


Business AI

Advances in machine learning have allowed businesses to take advantage of labeled, structured data that resides in data repositories and train algorithms to outperform humans on clearly defined optimization tasks. Some examples here include automated credit scoring, fraud detection, algorithmic trading, and supply chain optimization. While not the most exciting topic, in the short term, Business AI has the potential to have a significant impact in the way we work and more potently, what *types of work* make sense to automate.

Business AI is about optimising and generating value from structured data.

Business AI has the potential to make what were once stable professions like accountancy, insurance, and medicine obsolete in their current form. It also has the potential to generate vast and lucrative new opportunities. More on this later.


Perception AI

Perception AI is about the “Digitisation of the physical world.” It is about using real-world data captured from IoT devices, cameras, smartphones, and other devices to blur the lines between the online and offline worlds. We already see applications of facial recognition and machine translation technology enhance offline experiences such as shopping and travel as well as enrich experiences such as education.

Perception AI is about blurring the lines between the online and offline world

Augmented reality (AR) devices and applications increase merging of the offline and online world. Perception AI also has worrying implications around surveillance, privacy and data protection.


Autonomous AI

Autonomous AI represents the culmination of the three preceding waves of AI. What was once science fiction is slowly becoming mundane. Autonomous AI is about fusing the ability to optimize from extremely complex datasets and integrate them with powerful sensory abilities resulting in machines that can understand and shape the world around them.

Autonomous AI results in machines that can understand and shape the world around them.

We already see some limited applications of Autonomous AI in the fields of self-driving cars, automated factories and pollinators.


What does it all mean?

Ben Evans, a partner at the storied VC firm Andreessen Horowitz, talks a little about the implications of advances in AI in the November 2018 presentation “The End of the Beginning”. He says:

“Tech is building different kinds of businesses, and so will take different shares of that opportunity, but more importantly change what those industries look like.“

He says further that a combination of high internet penetration, changing consumer expectations and a general “unbundling” of supply chains are creating business models that in turn are enabled and accelerated by AI. The breaking apart of tightly coupled logistics supply chains is just one example of this phenomenon.

At my work with Jeavio’s portfolio companies, I can already see this in action. We support entrepreneurs who are working in diverse fields such as customer experience analytics, construction and high tech agriculture. In each of these various fields, we see applications of Business AI that have the potential to disrupt existing models and generate tremendous value.

In my previous career working in high-frequency algorithmic trading, I have seen technology disrupt financial markets. Advances in AI are now doing the same in a wide variety of fields.

While AI cannot by itself generate new business models, it is already a potent force multiplier, which when deployed effectively, can increase efficiency and help businesses capture more value. We may not worry about our Robot Overlords just yet; we should keep an eye on the disruption and opportunities presented by the four waves of AI.

Do you know your dependencies?

A contributor on GitHub finds an abandoned, but popular JS library and commits code that targets a Bitcoin wallet made by a particular company. Hundreds of other libraries use this library making this vulnerability affect thousands of applications since it is a transitive dependency.


Photo by Bryson Hammer on Unsplash

NPM (and npmjs.com) provide a valuable service in hosting JavaScript dependencies. By blindly upgrading to latest version of libraries, developers can open themselves to malicious attacks similar to those described below.

I would recommend developers understand how npm’s package lock mechanism works. This will ensure that your dependencies are reproducible and force the use of known and trusted modules instead of downloading the latest version.

This is not a problem just with the JavaScript eco-system. Python (via pip or conda) and Java (via maven & gradle) have similar issues. However my, totally subjective and un-scientific, observation is that JavaScript libraries tend to have way more dependencies (see the “left-pad” debacle for example)..

Ars Technica has a good write up about this particular issue: https://arstechnica.com/information-technology/2018/11/hacker-backdoors-widely-used-open-source-software-to-steal-bitcoin/

Computer Says No

Photo by Andre Hunter on Unsplash

Everyone has dealt with a “Computer Says No” situation. You call up a customer services agent hoping for a quick resolution to a perfectly reasonable query. But “computer says no”. You go through a convoluted questionnaire, answer the questions as best you can, but “computer says no”. The customer service agent shrugs saying that they can’t do anything because the system won’t let them.

It is tempting to call the customer service agent a jobsworth, or someone who doesn’t care about their job. To hang up in frustration and curse the status of the customer service industry.

So why is modern customer service so bad? Why do we dread calling up a help line or deal with an online customer support agent (who may or may not be a bot)?

Atul Gawande’s recent New Yorker article on why medical professionals hate their computers may have an answer. Dr. Gawande is a surgeon. In the article, he talks about how the medical informations systems used in his hospital make it difficult to really look after his patients.

Hospital systems in the US (much like the NHS in the UK) have spent billions of dollars to make medical care more efficient. But when we go visit our local general practitioner, we find them struggling with their PC more than talking to us. Instead of empathy, we get distracted clicks and frowns while the doctor tries to figure out how to massage the conversation into a bunch of drop downs and radio buttons. It is a terrible experience for everyone involved.

I am an engineer, I like efficiency. I like measuring the performance of the code I write and love reading articles about how to optimise software. In this pursuit of perfection, I fear that we have optimised ourself into a corner. Our systems are optimised, everything is measured — except the misery that they inflict on those who actually have to use the system every day. Human conversations and problems cannot be modelled so easily into a workflow. Improved throughput and the need to be more efficient drive design decisions more than the need to solve a problem. So we end up systems that their users hate. These systems and workflows lead to dis-engaged employees and ultimately to terrible customer service.

The next time that someone talks about having poor customer service, don’t blame the agent. Blame the analyst who designed the convoluted workflow in the software they use and the engineer who implemented it.

On Mental Models

A poorly illustrated guide to mental models

I had come across the term “mental model” before, but I could never really articulate or understand clearly what that term met. Today, while listening to an excellent podcast on Farnam Street with Venkatesh Rao (RibbonFarmBreaking Smart), I came across this passage which made a lot of sense:

I don’t think, really, mental models are so much about how the world works as much as they’re about internal consistency. Think of the world, the universe we live in as an extraordinarily confusing place that’s throwing huge amounts of information at you in an extremely high bandwidth way.

The Knowledge Project – Venkatesh Rao

So far so good — we all are familiar with information overload. But it’s not just the information in a particularly dense book or a John Oliver segment on chicken farming, even the very act of perceiving the world involves dealing with a huge amount of sensory input. Anyway, back to Venkatesh..

There isn’t enough processing power in the brain to handle that input raw. Our brain is basically layers and layers of processing that throw out most of it and map it to a sort of toy universe inside our head. It’s this toy universe that we actually play with. The only thing we ask of this toy universe inside our head is that it be much, much simpler than the world itself, and that it be internally consistent.

The Knowledge Project – Venkatesh Rao

So this “toy universe” is the mental model of the world. And the consistency of that mental model is what keeps us sane. When faced with external stimuli that don’t make sense or that does not map to the internal mental model, weird things happen. When faced with rapid societal change, some people turn to religion to try and make sense of the perceived chaos, or perhaps to make things simpler. Some choose nostalgia and the comforts of a simpler time and we end up with religious extremism and nativist politics.

What I took away from the podcast was the importance of tending to your mental model of the world. To let enough stimuli in to refine the mapping form the external to the internal and to be confident in getting rid of models that no longer map well to the external world. Easier said than done!MOSTLY HARMLESS

13 years of mistakes and what I learnt from them..

In 2004, I graduated from University with a degree in Computer Science and a graduate job at a large investment bank. In the years since, I have worked as a technologist in some of the world’s biggest banks and as of 2017, at a startup in London.

I have had many titles: business analyst, project manager, team lead; but I have always written code.

Earlier this week, I came across this thread on Hacker News. It is an “Ask HN” thread: “What habits make a programmer great?”. Go ahead and read it, it has some great advice.

It got me thinking about what I could add to that discussion. I am not a great programmer, but I get things done and I have had many years of mistakes to learn from.

So here are my 2p..


You will get frustrated, and it’s OK

Our field worships productivity. We hear about amazing applications built over a weekend. There is always someone who gets things done faster.

The truth is that programming is hard, sometimes lonely and often frustrating. Some of us work long hours, face challenging deadlines and difficult clients. Getting stuff done can be a long and arduous grind.

Getting angry and frustrated is perfectly normal. However, if not managed properly, it will lead to burnout and disillusionment.

Find out what coping strategies works best for you. When I feel like things are getting a bit too much for me, I go for a walk. Others grab a coffee and vent to a friend, some even talk to rubber ducks..

Be kind to yourself. Programming is mentally taxing, and your effectiveness depends on a number of factors that may be outside your control. Some days will suck, and you will feel like you got nothing done. It’s OK.


Know and love your tools

Our field moves fast, and every day there is a new tool, package manager or framework that will solve all your problems and make you a 10X programmer. This is a trap.

Take IDEs for example. I use IntellIJ IDEA for Java, Python, and JavaScript development. It is probably the most complicated application on my computer. It has taken me years to just get to the point where I can navigate the interface, understand the capabilities and am productive using the IDE. If I switched to something else, my productivity would plummet immediately.

You have already sunk hours into learning the tools you are using currently. Think of the return on investment (ROI) for all the time you have spent before moving on. Learn and love the tools that you use, and strive for max ROI.

Tools and frameworks come and go, but time moves only in one direction.


Don’t dive right in

Go on, fire up that IDE, you know you want to..

I am biased towards action. Given a choice between just getting started on doing something (anything..) or spending a few minutes thinking and planning, I tend to choose action over contemplation. I see this same tendency in many other programmers.

Diving right in feels good, feels productive, however I have learnt that this is merely an illusion. This approach has let me to dead ends, wasted time and frustration.

When faced with a feature to build or a problem to solve, I ask myself these questions:

  • What is the goal?
  • Will doing this move things (the product, project or company) forward?
  • How does this problem relate to what I know already? Do I know enough?

Once I have processed the problem, I work on outlining a solution. This can be a doodle, a user story or sometimes just a bunch of comments in an IDE. This exercise makes writing code the easy part of the whole process.

“Start projects by measuring the current state of the world. This goes against our engineering instincts to start fixing things. But when you measure the baseline, you will actually know whether you are fixing things.”

Kent Beck

Refactor vs rewrite is a false dilemma

We should rewrite everything in Elixir!

Everyone comes across a codebase that is so convoluted, so messy, so gnarly that the first instinct is to just want to bin it and start all over again. In some cases, this may be the right thing to do, for example if your client is willing to pay for a feature that would not be possible to implement given the current codebase.

However, in most cases looking at ways to clean up the legacy codebase by refactoring it is the more productive approach. Modern IDEs and code coverage tools make it easy to refactor a large codebase. This combined with a pragmatic approach to unit testing will take you a long way towards quickly and safely delivering value.

Refactor vs. rewrite is not a binary choice. It is a continuum that is heavily biased towards refactoring.

I have and have been a team member of numerous projects that were ground up rewrites. Most were abject failures. We spent weeks (sometime months) delivering functionality that already existed. By the time we got to adding value, the projects was behind schedule and over budget.


Don’t ignore the context

Then there was the grim reaper of Git, and then there was the koda of Kotlin, and then we decided to write everything in Haskell..

Nobody wants to write terrible code. The messy codebase you inherited is the result of battles wons and lessons learnt. It may give you a headache, but there is always something to learn.

It is worth spending some time to understand what problems the codebase is trying to solve and why it ended up the way it did. In most cases, it is the legacy codebase that is being actively used by your customers and paying your salary.

By ignoring the “why” and focusing on “how”, we are doomed to repeat the mistakes of the past. If the codebase is messy and broken, try to understand what caused that situation and try not to repeat the same mistakes or adopt the same patterns.


In conclusion

I have been part of more projects that have been qualified successes and unqualified disasters than those that have been unqualified successes. I am a mediocre programmer, but I keep striving to learn from my mistakes and make small improvements everyday.

What have you learnt from your mistakes?

Books of 2016

I had a target of reading 50 books in 2016. I didn’t quite manage to make it. I managed to only read 24. A dismal performance indeed. I read a couple of wonderful books and discovered some great new writers. I also managed to break out (well a little bit) from the cozy comforts of science fiction.

Perhaps I will make 50 in 2017!

BEST BOOK READ IN 2016

Paul Kalanithi’s memoir “When Breath Becomes Air” is lyrical, inspiring and heart breaking. Without a doubt the best book I read last year.

FICTION

I loved “Death’s End“, the epic, satisfying conclusion to the “Three Body Problem” trilogy by Cixin Liu.

Kenneth Liu’s short story collection “The Paper Menagerie” is excellent. You can read the titular story here.

NON-FICTION

Katherine Boo’s “Behind the Beautiful Forevers: Life, Death, and Hope in a Mumbai Undercity” is an unflinching, honest account of a year spent in a Mumbai slum.

Jacky Vance’s “Hillbilly Elegy: A Memoir of a Family and Culture in Crisis” is a memoir of growing up poor and white in the midwest. It made me think again about the assumptions I made about American politics.

DISAPPOINTMENTS

I disliked the much hyped “Chaos Monkeys: Obscene Fortune and Random Failure in Silicon Valley” by Antonio Garcia Martinez. The author’s overblown, sarcastic style really put me off an otherwise fascinating topic (for me).

HONORABLE MENTIONS

I enjoyed Neil Stephenson’s “Seveneves” and Alistair Reynolds’ “Revenger“. Both excellent science fiction books.