Recently, I’ve had a little bit of time to get back into coding and once again realised how much I enjoy it. Python is my language of choice, and I’m by no means an expert (though I’m pretty sure I can get there one day if I keep going). So far, I mostly focus on data collection, cleaning, analysis and visualisation. I only started coding a little over a year ago during my Masters degree; that is, if you don’t count my teenage self’s dabbling in HTML and CSS to make my first ever website look nice – yes, I was definitely one of the cool kids.
I am, however, hopelessly in love with coding, even though it doesn’t always love me back. Usually fast asleep by 11pm at the very latest, error messages are one of the few things capable of keeping me up past midnight. Whenever I’m coding, I feel like I am using so many different bits of my brain at once, there’s no space to worry or fret or get distracted by silly little things. I turn from my usual INFJ self into my INTP alter ego. I wouldn’t go as far as to say that it’s therapeutic; it’s way too frustrating a process to deserve that title. But there’s something quite special about coding – at least to me – that makes it worth dissecting.
It’s an emotional rollercoaster
Programming in Python is simultaneously the most frustrating and most satisfying activity. With many of the things that I enjoy doing in my spare time (collage art, writing, painting), there is no right or wrong, and you can work on something forever and never be quite satisfied.
This is not the case with coding. Of course, you can work on a piece of code for what feels like forever until it is beautiful and precise and fast and pythonic and all these other things that they judge you for on Stackoverflow. And yes, sometimes you have to do all these things because otherwise, it’s just not efficient enough.
But once it’s running it’s running, and you know you’re on the right track. From there on, you can only make it better. It’s so beautiful to spend three days struggling to make sense of your error messages and then you take a break and come back to your code the next day and suddenly you just know what you have to do to get it to run seamlessly.
It’s both creative and perfectly logical
If you can visualise what you need to do, you will get there in the end. If it makes logical sense, then it will probably be possible. That’s maybe my favourite thing about coding. Once you have a basic understanding of how a language works, you can trust your intuition and imagination to construct code. You have some building blocks that you can use and put together in different ways, and these basics are pretty simple – you can essentially learn them in a day. But it’s really about how you put them together in an original way to make your idea work. Once you know what to do, the devil’s in the details.
It’s problem-solving of the finest sort
There’s a satirical article called Computer Programming To Be Officially Renamed “Googling Stackoverflow”, and it’s funny because it’s painfully true. For me, coding has consisted of 95% Google search queries or copy and pasting error messages (which 95% of the time will then lead me to Stackoverflow, eagerly scrolling to the green checkmark) and 5% actually writing lines of code.
It’s frustrating, but it’s also fascinating – the DIY enthusiast in me loves it. Sometimes you will find the perfect answer to your question, even if you’re convinced you’re the first one to encounter this issue (definitely incorrect). Or you will find some hints that point you in the right direction. Other times you might be able to recycle a piece of code and adapt it to what you need. I’m quite good at googling now. It’s a skill. Is there a word for the opposite of SEO? I can do it.
It works perfectly with pen and paper
I’m a pen and paper kind of gal, and I find that this analogue way of working perfectly complements code. In my notebook, I draw out the structure that I want to build; I write down bits of code, or I highlight elements that I need to extract from a JSON response. This doesn’t just look pretty; it’s also very functional. Pen and paper are my second screen. It’s great for brainstorming ideas, capturing thoughts, and seeing if things in your head translate to Python.
It’s all about purpose
I’m not good at doing things for the sake of doing them. I need to have a purpose and a goal in mind if I am to invest time in something. I’ve never been able to complete any of these basic ‘Introduction to Python’ courses because I just can’t see the point and don’t have the discipline to do them regardless. Sometimes, this comes back to bite me. My friend Zack, for example, couldn’t believe that I made it through my thesis last year – which involved extensive use of the Youtube API, network science libraries and Python stats modules – without using functions. Once I started filling this gaping hole in my knowledge, I, too, had to admit that functions would have probably saved me a lot of time.
But most of the time, when I know where I want to get, I can learn the things that I need in order to get there. And when you can apply something you’ve learned to a project that you care about, it’s so much more likely to stick. It’s selective learning, which might not be ideal, but it works for me because it puts the purpose first and the tools second. It might be lazy, but it’s efficient.