From ‘No Code’ to ‘Know Code’ — My journey overcoming my fear of programming to writing my first script with Python.

David King
5 min readAug 14, 2022

--

This is my journey of how I learned Python and some API magic to make this YouTube video that automatically plants trees when you watch it:

I recently lost my job doing web dev and marketing at a small environmental impact startup. When I say web dev, I mean I built anything we needed using Wordpress and Shopify. Occasionally there would be moments where I’d copy/paste some JavaScript to do something that we needed to do, but I didn’t really have any idea what the code meant.

I always wished I knew how to code but I neglected it growing up because I thought I was too dumb. I’m not great with anything more than basic maths and I had this silly misconception that only super-geniuses knew how to code.

However, when I lost my job, I’d been dabbling in the world of no-code platforms, using a tool called Bubble.io to build websites that connect to external APIs. I had this idea that I wanted to build a YouTube video that automatically plants trees when you watch it, by using the money from ad revenue to donate towards reforestation efforts.

After working 3 years in the environmental impact space, I felt the need to contribute to help with the climate crisis, particularly now that my wife and I also had a baby on the way.

So I set about using Bubble to do this. The plan was to connect to the YouTube API to pull a video view count, which I could then convert to a rough estimate of money earned. Once I’d estimated the revenue, I could use that data to process a donation to Ecologi — which is an organisation that supports reforestation worldwide AND to my surprise, actually offers a tree planting API!

However, after 2 weeks of trying to make everything work with Bubble and getting error after error with zero actionable feedback, I couldn’t work it out and it was doing my head in. The main issue I had was maintaining a connection to the YouTube API. I didn’t understand how to use OAuth2.0 properly and I just couldn’t get a persistent connection to the API where I didn’t need to manually sign in again every hour.

This all lead me to the verge of a mental breakdown, feeling like I was incapable. I’ve dealt with depression for a lot of my life and it’s often triggered by moments like this, where I don’t feel like I’m in control. Moments where I’m trying my best, but failure feels inevitable. And it was all just in time for the arrival of our baby…

However, something about seeing that gorgeous little bean enter the world lit a fire under me. After bubs came along, I decided that I didn’t want to continue endlessly poking and prodding this no-code platform with no sense of progress. I knew that I needed to tackle my fear and build this properly, with code.

After remembering a Tom Scott video on YouTube that updates the video title to include the view count, I stumbled on another awesome video which went into detail about how to write a Python script that maintains a connection to the YouTube API. As it turned out, this was way goddamn easier than trying to hack Bubble into doing what I needed.

So I spent a couple days working through Python tutorials by Mosh to understand the basic syntax and structure of Python. I picked it up remarkably quickly and I kept kicking myself for thinking it was too hard for all these years. Once I felt comfortable enough with the basics, I wrote the code. Well, mostly I copied and pasted pieces of the code from tutorials and the API documentation, but this time around I actually understood most of what I was copying!

As challenging as learning Python was, there were tons of resources, forums and helpful internet strangers that kept me constantly moving and I never once got stuck on a problem for longer than a couple hours.

I ended this whole experience with the realisation that in some instances, learning to code can actually be far less mentally taxing than using no-code platforms, particularly if you’re doing something quite unique. I discovered that with code, you can search errors and pull everything apart and test each piece separately. This is very different from the no-code experience, where you can’t ever be 100% sure that a bug your experiencing is a result of an error you’ve made or an error in the no-code platform.

I’ll still use no-code products, they are incredibly powerful, but now I feel much more empowered to use those tools only when they make sense, rather than using them just because I’m scared of coding.

I also need to thank all the beautiful souls in the r/learnprogramming community. I’m so thankful I finally bit the bullet and tackled my fear of coding. I’m addicted now and I can’t wait to build the next project!

If you’re keen to plant some trees and see the video I ended up making about the journey, here’s the link again: https://youtube.com/watch?v=jlBB3X5jAX8

I’ll be building more things like this in the future, so subscribe to the channel if it’s something you’re interested in!

Here’s a GitHub link to the code I wrote if you’re interested in checking it out. I know, it’s probably not the nicest looking code and I probably made many noob mistakes but it’s working and the video is planting trees, so I’m proud!

- David

--

--

David King

Hi, I’m David. I create videos and I build good things with software. https://youtube.com/gdaydk