Developers January 19, 2021

Write Ugly Code

Justin Hunter @polluterofminds

I wrote about this a while back on Dev, but with the rise of no-code solutions and the continued sense of gatekeeping I see with some developers, I thought it was worth revisiting this topic.

Learning to code is fucking hard. Don’t let anyone tell you differently. My first brush with coding came in 1996 when I took a computer class in junior high and learned about the ability to view a page’s source. I quickly converted Yahoo!’s homepage into my own custom Justin! Search page just by editing the existing HTML.

I loved it, but I was never able to latch on to coding. Not even HTML. In college I took a web design course (which, interestingly, consisted of the no-code tool Microsoft Front Page), but that course wasn’t what I was looking for. For the next 10+ years, I tried off and on to learn to code. I read programming books, I took courses here and there, but it all felt so abstract.

Even as I started thinking up and launching business ideas I had, I didn’t learn to code. I hunted for developers to build things for me. Learning to code was clearly a mountain too high for me.

That is, until I started thinking about the app that would be Graphite. Because I never intended for it to be a business but it was something I desperately wanted for myself, I had no choice but to learn to code. So, with a passion project in hand (which gave me a concrete goal) I dove into YouTube videos, Udemy courses, and Stackoverflow. I learned by writing some of the shittiest code you might ever find.

But guess what? It was functional. By the time I had the app in a working state, people had heard about what I was building and encouraged me to launch it. So, I did. Shitty code and all.

That spaghetti code version of Graphite was on the front page of Hacker News for two days and was one of the top products on Product Hunt the day it launched. But more importantly, it proved to me that I could code.

If I had tried to write elegant code, if I had tried to be super DRY, I never would have finished. I never would have proven to myself that I could code.

That means I never would have gotten my first developer job, my first development contract. I never would have shipped the products I’ve shipped. And I never would have started a new passion project. Perligo deserves a chance. And because I stuck with the learning process and wrote shitty code way back when, I can now write “good” code as I build my newest project.

I am very happy with the advancements of low code and no code tools, but learning to code is empowering on a completely different level. And anyone can do it. As long as you don’t get so bogged down in the details of what you “should do” and instead focus on what you can do. You can always learn to write better code and refactor the bad code you wrote, but only if you get over the learning hump in the first place.

  1. 3

    The advice I usually give developers is to write "good enough code". I went through multiple mentality stages in my tech career, and one of those was "obsess over the code quality" until I realized that the perfect code and abstraction does not exist. It has to be good enough, do what it needs to do and micro-performance boosts don't matter if you don't ship (eg. I always sight when I stumble upon a thread where people praise spending days to reduce the bundle size of a JS application by 4kb).

    Of course, the code you ship, in my opinion still needs to be quality code, because after all, coding projects most often end up with multiple people working on them. But the ability to write high quality code comes with experience. If you are a newbie, don't spend too much time learning all the design patterns. You will eventually learn them over the time when you encounter the need for them (a lot of frameworks already use them, and stumbling upon design patterns being used in the wild will be a more powerful learning experience than reading about it in a textbook).

Recommended Posts