So this coding thing... How do I start?

Originally published on CodeDay Blog.

Hi there, I’m Mingjie, and I’ve been working with CodeDay for almost 3 years! During the past three years of running events, mentoring students, and hearing from different mentors, I found out that one of the most frequently asked questions by beginner students is... “Which language should I learn first?” While this article won’t answer that question completely, I’d like to share how I got started with this programming thing.

This could be a very long piece to read... but please bear with me (obligatory “go bears!”) as I tell my story.

Contrary to what a lot of people who know me personally believed, I didn’t grow up thinking that computer science is my destiny. Thanks to my mom who was getting her accounting certificate online — yes, online, and that was like more than a decade ago — at the time, I had access to a very old IBM Aptiva computer when I was 8. I didn’t do much with it, though, mostly because my parents didn’t want me going online so the only “toys” on that computer that I can play with were PowerPoint 2000 (Word, Excel, and Access didn’t look as fun as PowerPoint), Windows Media Player (mostly for the visualizer), and Paint. But even though I had almost zero access to online resources (not that there were a lot of those back then), I still somehow managed to create a little maze game with PowerPoint animations and events. It was janky, and it took me about summer to get almost everything I wanted working.

IBM Aptiva, from the Computer History Museum

And then my parents decided that since I was “very good” at computers, what better are there than sending me to an after school class that taught me how to write programs? (I wrote briefly about this culture in China in my blog about my education.)

Little do they know, that course almost completely destroyed my interest in computers at all. Every Saturday, I would sit in a small computer lab with 20+ other kids of my age, looking at one of those boring, 8-bit colored screens. We were taught how to program in Pascal, and since there obviously wasn’t VS Code or Repl.it at the time, we had to code inside a very boring looking compiler called Turbo Pascal.

Turbo Pascal 7.0 from Wikipedia

I hated that experience. Of course, I was too young to start thinking about my career choices, but I just knew that I would’ve hated my life if this is what I have to do all day. I even wonder if my teacher, a mid-aged man who almost seems to be living in that computer lab, actually liked programming at all — to me, it was too boring of a task for anyone.

Things didn’t get better for the computer-nerd side of me even after I went to middle school when a “helpful” friend pulled me into creating a tech club that failed miserably. But one thing I did like was writing, so as I wrote more and more things, I wanted to have an online blog where I can keep records of my random pieces of journaling.

Initially, I was just like everyone else — I wrote on commercial platforms like Weibo (literally “microblogs”, a Chinese combination of Twitter and Facebook). But as I wrote more and more things, I figured that these platforms were really bad at keeping track of my work. There was no tagging, no categorization, and I can’t even search for something I wrote unless I knew exactly when I wrote the piece.

So I started looking for alternatives. Honestly, there weren’t many of those because of the limited internet access in China (anything that uses Google APIs is off the charts, so that leaves... nothing). And as I looked more into self-hosted solutions, I found WordPress, the platform with way too many installation tutorials on the internet.

And me being me, instead of starting to write and publish more articles right away with the default theme, I found myself in the middle of a dark corner in WordPress’s theme development documentations. And you know what happens next — after an entire year of trialing different themes, attempting to modify small chunks of PHP here and there, breaking the site completely, re-installing WordPress completely, and starting all over again, I wrote a total of zero pieces, but I fell back in love with making custom things with code. It felt cool — a few lines of non-human-readable code can generate a webpage that can be published to anyone on the internet. This is something that math, sciences, music, or anything they’ve been teaching at school can’t do.

Here’s a picture of happy me

Since then, I started learning to write websites bits by bits — starting from using frameworks like Bootstrap and writing static sites, to learning how to render things on the client-side with JavaScript, then to NodeJS and databases... And these things became handy to me, as I have always found myself working for and with very small teams who need software solutions that everyone can access everywhere.

So now that I am finished telling my cliché story, let’s go back to the question I posed first — what should you learn first?

Programming isn’t just a simple course like algebra that you learn at school. Unless you explicitly learn it the conceptual way — which is what I am doing now, but not everyone has to do that — it is always heavier on the application side. Languages, on the other end, are like the tools you use to tackle the specific problems that you face now and then.

There is a very common metaphor that I really liked — that programming languages are like various forms of sharp tools. Think about it this way — when were you taught how to use a knife? Did you learn how to use a bread knife, steak knife, and a Swiss knife all separately, or did you learn them all the same way?

Then think about this: if you already knew how to use a chainsaw, are you going to cut a loaf of bread with it? Well, it accomplishes the same task, doesn’t it? And are you going to chop down a tree with a bread knife? Or filet down a fish with a screwdriver (idiot sandwich warning)?

Devrant summarizing my entire blog in a picture

Programming languages work the same way. Once you’ve fully mastered one language completely, you’re going to know something about every other language there is. Some languages may have an extra handle, an electric motor, or even a screwdriver attached to it at its bottom, but it won’t take much effort to go through all these extra features. But some languages are also very specific at their uses: Python is like a chain-saw, as it works very well chopping down large trees; JavaScript is like a pair of scissors, as it has very specific targets and works very well for these tasks yet no other; C is like a Swiss Army knife, as it can sometimes drive through hardware if you need it to...

And every now and then, you’re going to encounter some tasks that you’ll have to solve with a specific language. For me, my first task was to cut open a blog with a pair of scissors. But very obviously, I couldn’t use the same pair of scissors to analyze large chunks of data like I’m doing now with my research project, nor can I use that for traversing through databases extensively. So as time passed, I started learning how to use more specific knives like Python and SQL.

XKCD

So, one last time, in case you haven’t been figuring out where I’m going with this... What language should you learn first?

It really depends on what you want to do with your programming skills. I’ve seen people having incredible success starting off with learning to write JavaScript on websites, and there are also developed college courses like Berkeley’s CS 61A and Harvard’s CS50 starting beginners off with Python, C, or SQL.

But you should always start with something you’re comfortable with — I was forced to start with a Swiss Army knife that I can’t properly handle, and that almost made me want to quit using knives forever (and to be honest, I still don’t quite get how to use all the tools... I’m talking about a Swiss Army knife). If all the object-oriented programming stuff is getting you less and less oriented, or if React.js is just making you react like you’re having a brain-freeze (hehe)... try something simpler. Read a project’s documentation and source code on GitHub, build something simple like a personal website that randomly generates memes with your pictures, a link shortener that rick rolls people by chance, or a todo list that consistently remind you how much more work you have left in the week... In the end, you’re learning how to use a tool, so don’t stress too much if you aren’t’ able to lift a heavy chain-saw yet.

Now that I think about it, I could’ve written this one much more concisely so I apologize if you were forced to read about my incredibly boring life. But if you have any questions, feel free to chat with me at any time! Just shoot an email to [email protected].

Happy hacking!


Permalink: https://mingjie.dev/blog/learning-to-code/