How To Stay Motivated When Coding Gets Hard

Reading time: 4 minutes


The Dip Revisited

Learning to code can be hard… and painful.

In Seth Godin’s book, ‘The Dip’ Seth describes the ‘The Dip’ as the place between being a beginner and becoming a master when learning a new a skill. The Dip is the place where you realise how much you need to learn and this place is full of frustration, confusion and failure. ‘The Dip’ is the place where most people give up – and convince themselves they had no business learning that skill in the first place.


But ‘The Dip’ is not an enemy but a friend, weeding out the uncommitted and for those that get on the other side,  gives them a invaluable skillset that helps them rise to the top of their field and claim all the rewards that go with it.


I have definitely hit ‘The Dip’ in my Techdegree. Learning HTML & CSS were quite straight forward: I could make pretty little websites with relative ease. When I made my first webpage, I stood back like a proud father watching his son taking his first steps – I thought that I would be the Lionel Messi of FrontEnd Development in no time…

Then I started learning JavaScript.

Very quickly I realised like Dorothy in ‘The Wizard Of Oz’, I wasn’t in Kansas anymore. As a non-Computer-Science graduate, I found some of the terms and methods baffling: conditional statements, while loops, do while loops, functions, arguments and parameters were smacking me around like jabs from Anthony Joshua. Code challenges were no longer fun but exercises in frustration and irritation. The small voice in my head morphed into Donald Trump screaming things like “why did you think you could ever code?” And “what were you thinking? Give up NOW!”

But then I realised I was staring at my Dip. 

To enter my Promised Land, I had to cross the Valley of Death. And here I am. It’s not pleasant, but here are 3 strategies that I’m using to navigate this mother like Indiana Jones.

1) Stay Consistent 

When I first started to learn how to code, my routine was as follows

  • Watch the video
  • Do the Code Challenge 
  • Apply what I learnt to a personal project 
  • Get happy
  • Kiss my wife

 And so on. Since I’ve hit my Dip it’s become:

  • Watch the video
  • Get confused
  • Fail the Code Challenge 
  • Google the answer 
  • Get frustrated 
  • Watch Dragonball Super until I calm down

And loop. The relationship between coding and I went from ‘The Notebook’ with Ryan Gosling & Rachel McAdams to ‘The Break Up’ with Vince Vaughn and Jennifer Anniston – but not as funny. But when I started the Techdegree, I made a promise to code an hour a day, six days a week no matter what.

As my favourite book, ‘The Slight Edge’ says:

Showing up is essential. Showing up consistently is powerful.

If I start missing days, I break up the daily rhythm of learning that I have created over the year & this will make it easier to give up. Learning to code is a marathon & not a sprint & like a good long distance runner, maintaining a good, consistent pace is the key to finishing the race well.

2) Take Breaks

The other day, I was learning the difference between local and global function scopes and had to design in JavaScript, a counter based on what I had learnt. After what felts like hours working on this project, I was ready to put my red headband on & dragon punch the screen.

I had enough. In a huff and puff, I switched to a personal project to ease my frustration. Later, when I returned to the problem, I felt like I transformed into Neo and not I could see The Matrix – the answer was staring at me right in my face.


Taking breaks gives you coding super powers… Like Keanu Reeves.

This is what Dr Barbara Oakley in her book ‘A Mind For Numbers’ described as ‘The Einstellung Effect’. This is where you conscious mind becomes so focused on the problem that it narrows your thinking and your options. When stop thinking about the problem and focus on something else, your subconscious mind takes over, working on it in the background and because it’s  a lot more ‘diffuse’ can be more creative & often help you think of creative breakthroughs. 

I’m learning that rather than stressing over a really difficult problem and ranting about it like Kanye West at an awards ceremony, to switch to another easier and more enjoyable task or simply take a walk to clear my head. Breaks can lead to your breakthrough!

3) Don’t Double Down, Double Back

One of the greatest things that I have ever done is to keep a journal (No ‘Dear Diary’ jokes please – some of the greatest minds like Benjamin Franklin, Thomas Edison, Henry David Thoreau and Alice Walker kept diaries OK?) Writing about my daily professional & personal experiences has helped me improve my life greatly. One of the great advantages of journalling is that over time, is that it has allowed me to see certain patterns and habits that keep on cropping up in my life and this awareness allows me to see if I can change them.


You don’t have to be a dictator to have one…

One of the habits that I realised that I was doing was, learning exactly in the way that I was taught in school. I watched the videos and took notes about what I saw – that’s it. But over time I couldn’t… do… nada. It felt like all the info that I was learning was jumping out of my head like Jason Statham out of a burning building… I was going around in circles. But only became aware of this by reflecting and looking at my journals and through reading and experimenting, I came up with a completely new process that boosted my coding ability.

If something is not working, it’s very easy to ‘double down’, ‘hang tough’ and ‘push through the pain’. But as coding has shown me, sometimes we need to take a couple of steps back and look at how we are doing things and see if there is a way that to do them better. I try to code for 6 days a week and rest on the 7th. This gives me the time to reflect on what well, what didn’t go so well and I constantly try to look at how I can improve my systems and processes.

I hope that these suggestions will help you but I am still learning myself! Are there any strategies that help you when the going gets tough? Leave your comments below and/or tweet me @karlwebdev – as always I look forward to hearing from you!

As always, thank you for reading and I will see you next Thursday!



Book Review of “Who Moved My Cheese?” by Dr Spencer Johnson

Reading time: 3 minutes


Hello People!

Today I will be reviewing “Who Moved My Cheese?” By Dr Spencer Johnson. This book regularly appears on lists as one of the best Personal Development books of all time – so as an ever eager student, I had to grab it to steal it secrets! Let’s dive in shall we?

Of Mice and Men

The book is only 95 pages long – so this can be read literally over a long train ride (which is fine by me). The book is really two stories in one: the book opens with a group of middle aged friends who after their high school reunion, get together to catch up with each other and see how they are coping with the everyday struggles of modern life. The friends talk about everything from shaky marriages, job layoffs and raising children and agree that they are all finding it hard to cope.

In the midst of the doom and gloom, one friend starts to tell a fairytale about four characters that lived in a tiny maze: two mice called Scurry and Sniff and two ‘little people’ called Hem and Haw. These little critter’s main job, was to run around the maze, eating cheese to stay alive. All four characters live at a place called Cheese Station C, where there’s a large stockpile of cheese. Now the mice, not having advanced brains and living off their instincts, started to notice that that she supplies of cheese was falling and leave to the station to find a new supply. The little people however have grown quite comfortable at Cheese Station C and built houses next to the cheese pile and thought that the cheese will last forever. When the cheese inevitably run out, the little people panic and lament over their lost cheese. Hem and Haw argue over what to do: stay and wait for more cheese to come or venture out into the dark cold maze, on the hope that they will find new cheese. But as they start to starve, they realise they haven’t got much time left and one of them makes a bold decision…


The main theme of the book is how, we as humans, deal with inevitable, unavoidable life changes and the cheese is a metaphor for what ever is important to us: whether it’s health, money, career or relationships. The four characters represent different responses to external change: people like Sniff sense changes way before they happen and people like Scurry represents the people who act proactively with the information and make changes happen. People like Haw represent those who are resistant to change and need to be persuaded to take action and Hems will not only resist but refuse to change at all. The fairytale aspect makes the lessons easy to understand & digest.

What I thought was a nice touch from the author was that when the characters made major decisions, they would sum it up in easy to remember quotes, that were placed in large pictures (yay!) that would be placed throughout the book.


Also, what’s interesting is how each of the high school reunion friends discuss the main ideas so that we, the readers, can see how we would apply them to our lives.

How This Can Help You

If you are going through a challenging time in your life which you have no control over, you will find the overall message really valuable and positive. Unfortunately bad things do happen which we don’t see coming and which we just have to deal. This book will give you the philosophies of how to handle these changes and will show you how to respond to them. In this troubled economy, where layoffs, downsizing and increased stress are more common than ever, I welcome any books that help us handle that better. 

Also for coders, I thought the main message is really important as the industry is changing so quickly that we, like Sniff and Scurry, must daily monitor the changes & be ready to adapt with the marketplace or be left behind.


Guys to be honest, I’m really torn: don’t get me wrong I did like the book, but there were a couple things that did irritate me a little bit…

1) I found the books parable a little too childish for me… Humans are complex and will not only motivated by external things (money, status and power) but have internal motivations (purpose, joy, self-actualisation). Also it came across as too ‘American’ for me (sorry guys – I love you lot). It was at times too positive & motivational & it come across sometimes as a little patronising. (By the way, I’m a Brit & we can be miserable gits – blame the weather).

2) I didn’t like the analogy of mice and ‘little people’ in a maze. This sounded too close to the idea of the ‘rat race’ and in my humble personal opinion, feel that we have a lot more choices about what we do & when we do it. Besides I’ve had mice before & they are not friendly, lovely little creatures! You really don’t want mice in your home…

Score: 5.5 out of 10

If my mate had a copy to borrow, then I would take it but I wouldn’t go out of my way to buy it.

Thank you for reading. Are there are any books that you guys want me to review? As always dear people, please leave a comment below and follow me on Twitter @karlwebdev.

See you next Thursday!


Stop Bullying Yourself

Reading time: 6 minutes


Your ‘Best’ Friend

Hello Boys and Girls!

I want you to close your eyes and imagine something: imagine that you had a ‘best’ friend and you’ve known him/her for your whole life – in fact let’s give your friend a name: ‘Jamie’ (it’s unisex – just roll with it…).

Although you’ve known each other forever, your relationship with Jamie is… Tricky. Jamie is very opinionated and often says things at the wrong time. Jamie loves when you only do things that are “comfortable” – things that won’t rock the boat and that are routine. Jamie doesn’t like when you try anything new.

But if you go against Jamie’s wishes, and try something new – and you fail, Jamie gets vicious: Jamie becomes downright mean and opens a verbal can of whoop ass on you. All you will hear is:

“You’re a loser! I told you it wouldn’t work!”

“Everyone is laughing at you! They think you are fool!”

“I knew they would find out about you sooner or later! You’re a fake!”

Would you stay friends with that person for long? Or would you treat him like Uncle Phil did Jazzy Jeff and throw out of your house! But what if you couldn’t? What if Jamie lived in your head all the time? 


If only we could do this to the negative voices in our mind…

“My Biggest Enemy Is My Inner Me”

For most people, ‘Jamie’ or that ‘little gremlin in your head’ is a daily reality. After doing a little research, psychologists call this voice the ‘Inner Critic’. Researchers believe that Inner Critic is actually a psychic defence. The Inner Critic was birthed in our childhoods & represents all the rules, judgements and expectations of our parents, family systems and even society itself. The theory goes that the Inner Critic is there to stop us feeling anxiety, pain and shame. Now although most people have an Inner Critic, some people may have a harsher Inner Critic if they had:

  • Significant childhood trauma 
  • Being raised by caregivers who were not affectionate & did not give them positive affirmations
  • Being pushed to always achieve and be ‘perfect’

Now the inner critic is NOT your conscience. Whereas your conscience may push you to do things for good or moral reasons, the Inner Critic is out to punish and criticise you. It’s not your friend. Sometimes, if a person has had many challenges in their life & not had support, then their inner critic can lead to anxiety, depression or in the worst case scenario, suicide.

We live in the most technologically advanced period of human history, with people living longer and having a better standard of living. But there are some very worrying stats.

In the UK alone:

And the stats keep coming in. Houston, we have a problem.

What’s Going On? 

Many theories have been tossed around from the breakdown of the traditional family unit, growing individualism, globalisation & even our environment. But I can only talk from personal experience & those closest to me & the common issues are:

  • Increasing work pressure & increasing in costs of living
  • Less time with family & friends 
  • 24/7 culture & information overwhelm
  • Seeing friends & family on Facebook living more ‘successful’ lives. 
  • Because of external pressures (parents/society) feeling like a failure when they don’t hit certain life goals at a certain time (be married with kids & have purchased a house by 30).

This makes the Inner Critic goes nuts. I once heard a motivational speaker saying you should “never sleep & give 200% to your job” and I cringed. Is this good advice? 

If in my bank account, I had £100 and I went to with draw £200 – guess what? I would be £100 in debt. Likewise many of us sacrifice the good things (relationships, health and meaning) for material things (money, power, status) and we end up lonely, sick and depressed and wonder why we are so miserable. It’s bad maths and it needs to stop.

What we really need is self compassion.

What Helped Me and Can Help You

With the severe illness of one of my loved ones last year, it made me realise how much I was focusing on the things that didn’t matter. Dealing with this and the demands of modern life, left me feeling exhausted, depleted and miserable. After meeting a close friend and explaining the situation to him, he said to me plainly “you’re bullying yourself into the ground – it’s time to show yourself some TLC (Tender Loving Care). I pushed myself around and thought I had to be Superman when really, I was Clark Kent. Here are some tips to help you put down your cape and relax.



Sleeping like a baby will help you live to old age…

My relationship with sleep became like a loveless marriage: we grew apart but had to keep together for the sake of the kids. But because I wanted to improve myself so badly, I would function on 5–6 hours of sleep thinking that I was being productive but more of the time, I was groggy, irritable and I would constantly catch the flu – even in the summer. Research has shown that sleep make sure remember more, makes you sharper and makes you happier. In other words, more productive. Nowadays I aim for a minimum of seven hours of sleep and I feel so much better.

Stop Being the Hare! Become the Tortoise.


Not slow but STEADY wins the race…

As a culture, we have become obsessed with “overnight successes” – we seemingly see celebrities, entrepreneurs and other successful people parade on TVs and think that within 6 months of learning, we should become a genius, billionaire, play boy/girl, philanthropist (HT @IronMan). But we don’t see the years of dedication and perseverance that they needed to ensure. For example:

I know this might seem like some motivational mush, but we all miss the point. The point is NOT the success: these people simply endured without fuss & kept going at a steady, even pace. They ran their own race. It’s the small invisible daily actions that count & I’m learning to enjoy the journey on the way. I’ve stopped trying to leap into a happy and successful life in a single bound and now I’m happy to take the stairs.

You are NOT a machine. Turn off!


We need to turn off once in a while…

My late grandmother had a farm. She would work from sun-up to sundown and that’s it. If my grandmother had a to-do list it would go like this:

  • Wake up 
  • Water the plants
  • Remove the weeds
  • Harvest the crop

That’s it. The time she was not farming, would be spent time with her kids & grandchildren. She lived to her mid 90s & had a full life. I envy her life is so many ways & wonder whether if in my lifetime if I will ever get that simplicity.

As technology goes forward & the world moves faster & faster, we forget we are not like the machines that (for now) serve us. We humans need to rest, relaxation and times to stop everything. I’m guilty of this too. Be a friend to yourself rather than treating yourself like the Igor in Dr Frankenstein’s castle.

Be Kind.

This post was inspired by 2 things:

  • Monday 10th October was World Mental Health Day
  • I watched a fantastic documentary by Keith Dube called ‘Being Black Going Crazy’ which highlighted the mental health issues that black people face in the UK. Mental health is a global issue and one that STILL has a massive stigma attached to talking about it. We have to get a grip on this now & we must be willing to be vulnerable. 

As I leave you, there are 2 challenges I want you to consider:

1) If you are struggling with your Inner Critic or Mental Health, take the steps above & be kind to yourself. It’s easy to let our Inner Critic run our lives but I can bet my life savings that you have many talents, passions and things to be grateful for. If you still struggle, don’t be afraid to talk to someone or get professional help. 1 in 4 or us will have a mental heath issue at some point in our lives so you are not alone.

2) Show some kindness and consideration to whomever you come across in your daily life. If someone has a broken leg, we can see it & show that little bit of extra consideration, but what if someone has a broken heart? There are some people that you see everyday that are smiling on the outside but are contemplating suicide. With the stats increasing as it is, the scary thing is you may have talked to at least one person today who is suffering from a mental health issue. Your interaction with them can be life changing for good or ill.

In the words of the philosopher Jerry Springer “Be good to yourself – and each other”.

Thank you for reading. As always please leave a comment below and follow me on Twitter @karlwebdev.

See you next Thursday!


Code like A Rockstar: How Programming A Website Is Like Producing A Killer Song

Reading time: 5 minutes


JavaScript killed the radio star…


Before I got involved with coding or even teaching, I cherished music. From the age of 12, my whole world revolved around making tracks, performing and “gasp” getting signed to a record label and winning a Grammy! Marrying either Alicia keys or Beyoncé would have been the icing on the cake. (Jay-Z and Swiss Beats beat me to it! Dammit!)

Although my Puff Daddyesque dreams never came to be, I am incredibly grateful to music, for giving me the unique set of skills that have benefitted me in every area of my life. Music Production taught me how creativity and technical know-how can come together in perfect harmony: the sweet art of melody and composition meeting the cold science of audio engineering creates the stuff that becomes the soundtrack to your life. Music production taught me that creativity without knowledge, creates original but undisciplined songs that confuse the listener. But songs that are technically correct but lack that creativity sound decent but they are stale, lifeless & boring.  Getting the balance right is key.

Many people are baffled by music production. Walking into a professional recording studio can be like stepping into NASA Headquarters just before the first Apollo mission. 

But as I teach my students in music college, a great song goes through 3 important stages.

  1. Composition – creating the rough idea for the track & is usually just a riff or loop

      2. Arrangement – fleshing out the idea, adding a clear sequence & other instruments

      3. Post-Production – adding effects & sonically enhancing the track to sound ‘polished’.

The Penny Drops…

When I started to learn about Front-End Development, I really struggled to get my head around the strange concepts: variables, selectors, concatenation, attributes and refactoring were attacking my brain like Bruce Lee in a fury. I just couldn’t get my head around it and it made me miserable. But as I went further along, I realised that a website had its own framework.

  1. HTML – Forms the basic structure of the website

      2. CSS – Deals with the presentation of the website (makes it look pretty!)

      3. JavaScript – Adds interactivity & enhances to the website

The two processes were remarkably similar… and when I realised this, it just clicked for me and the same passion that I had for creating the perfect song transferred to creating the perfect website. Here’s how the two processes compare.

1) Drop The Beat! HTML Is The ‘Composition’ Of The Website

As good ol’ Kanye showed us, composition is all about the ‘big idea’ of the song. Whenever I created my best beats, it would start with me playing around with the sample, tinkling the piano keys or playing with the cool sound effect. Once inspiration caught me, I would scramble to add of a basic elements until I had a basic ‘loop’ going.

The loop acts the basic sketch of the track & the concept that the rest of the track will be built around. Creating a loop gives the producer a rough idea where every think should go i.e. where the rapper spits his bars and where singer belts the chorus. Although loops may not take long to develop, you quickly see if it has that “magic” – that feeling that the track will be special. If you get the loop right, then all the other sections will be easier to complete. As they say in the music industry “you can’t polish a turd” – if the idea is garbage, then the song will be a non-starter.

Likewise when creating a website,  HTML provides as the tools to create a structure of what the site needs to become. HTML like a loop is a rough sketch of our website – allowing us to quickly decide where all the main parts will be from our navigation menu to our search bar. Although HTML won’t create the prettiest website, like a loop, HTML allows us to see whether our site has that “magic” & will it work. The best websites are deceptively simple, clean and let you see “the big idea” straight away. A poorly structured site will chase users away.

2) “I Can Make Arrangements”: CSS As The ‘Arrangement’ Of The Website

Thank you Pharrell & JT! Once you have the your basic idea, you would move to the arrangement phase. Arrangement is turning your 30 second movie pitch into an epic motion picture with a beginning, middle and end: full of tension, twists and turns & finishing with a great climax.

At this stage, an arranger’s knowledge of music theory is absolutely key. An arranger needs to have an in-depth knowledge of his genre and ask herself questions like:

Who will listen to this track?

What additional instruments do I need?

What key is the song in?

Do I want to make it sound happy/sad/mysterious?

How many verses/choruses does it need?

The arranger takes that 30 second loop & takes the listener on a 4 minute journey adding the instruments, melodies & soundscapes that bring out the emotional content. As the track evolves, the arranger is not afraid to remove parts of the original composition if it is no longer useful & may find themselves troubleshooting sections of the song as some instruments or melodies may clash together. An arranger must be patient, borrowing from all the knowledge of music history but allowing for new ideas.

Likewise CSS takes your basic HTML website that you have created on with the use of colours, layout and design, turns it into a beautiful website that takes the user on a visual journey. CSS uses the HTML structure to target specific elements to make the site pretty! Like an arranger, a web developer must draw from a bank of technical and design experience to know what is worked in the past but also keep an eye for future design trends and stay ahead of the curve. A great designer constantly asks questions about what is the site’s target audience, the overall theme and how the design compliments with the overall goals of the creators and more.

Like an arranger, a great developer be brave enough to add elements if needed or take away elements if they distract from the overall experience. This is especially critical as a designer must use “responsive design” techniques to factor in screen sizes & may have to change different elements around for the site to be viewed from mobile devices all the way up desktop computers. Sometimes the design will not render how it should and a web developer will often have to troubleshoot parts of their CSS & work around the problem and making sure that the user has a great experience on whatever device that they use.

3) Flipping The Script! How JavaScript is the ‘Post-Production’ of our website

Bruce Swedien was the Quincy Jones’ main sound engineer to mix Michael Jackson’s Thriller – the greatest selling album of all time! His mixes are legendary!

Whoa… We’ve arranged the track but it still sounds…off. Parts of the track sound too loud or too soft. The track when played on a boombox sounds radically different when played on an iPhone and although it’s finished it sounds like a demo & doesn’t have that ‘polish’. This is where Post-Production comes in. The track will be passed to a sound engineer who will take the track through the process of mixing & balancing the levels, adding effects to enhance the most important parts & sonically sculpt the track so it sounds more dynamic & enriching to the listener.

At this point, a sound engineer may introduce a fixed like delay or reverb to make the vocal sound more ‘epic’ and standout against the instruments. He may use a tool called an equaliser to cut or boost certain harmonic frequencies (pitches) in a sound i.e. make the trumpet sound ‘less bright’ so that it doesn’t smother the piano and may place the lead guitar and keyboard sounds in the left and right speakers respectively (panning) which helps create a sense of ‘space’. The sound engineer has to decide what file format to export the song to, as the different compression rates have a drastic effect on the sound & try to balance the track so that it will sound as good on as many different devices as possible. Some argue that this is the least musical stage, but is no less important than the others.

Likewise JavaScript takes your beautifully designed yet static website and makes it a fully interactive experience that you are users will rave about. A JavaScript programmer on and take parts of the website and bring them to life for more personalised experience for the user such as creating interactive timetables, ever changing photo galleries or forms that will ask you to complete different parts depending on the user.

A good JavaScript programmer, like a sound engineer, must have in-depth knowledge of the language & decide what would be the correct tools for the job. She may use JQuery to execute a variety of common JavaScript tasks, which make the code easier to run in the browser. Or she may use AJAX which can allow you to update individual parts of he page for ease and speed & must continue to learn about the ever changing frameworks & libraries & how it will effect future websites.

To a newbie, JavaScript seems mysterious & unworldly. But like sound engineering, with a bit of practice and dedication, newbies will discover that their sites will become more polished and take user experience to a higher level.

You Matter

So what is the point of all of this? Is creating a website really like making a song? A metaphor can only stretch so far and this piece is far from perfect.

But the real point is that, as a newbie, even though you may not have a computer science background, you have picked up a variety of skills that with a bit of imagination & creative thinking can be used to help you learn to code better. For me, it was music but for you it could be cooking, rock climbing, sewing or playing badminton. Nothing is wasted. Technology & society, needs your unique viewpoints to help us solve the tremendous problems that face us in the future. Go ahead. Lean in and create your own song whatever it maybe and rock the world.

Thank you reading! Leave some comments below and let me know what you think. Follow me on twitter @karlwebdev!

See you next Thursday!