Everyone should learn CSS (just kidding)


At this point the “everyone should learn to code / no they shouldn’t” brouhaha has contorted and crawled so far inside itself that it’s virtually indistinguishable from parody. This isn’t about that. I pass no value judgements on the code-learning trend. I do think learning is good, and learning the right things is better, and learning the right way is important.

Imagine, if you will, a person who wishes to learn to code — a person who is “not good with computers”. What language would you recommend to them, assuming you are a savvy coding professional? (Perhaps you’re not, I won’t hold it against you.)

Like many a geeky child, my first lines of code were written in BASIC — an excellent language designed for students. I was as excited as the next guy when I first ran this little gem:

10 PRINT “HELLO WORLD”

20 GOTO 10

It took up a good deal of my time for the next few years after that, and I made it as far as designing some rudimentary graphical games before I got onto something new. The beautiful thing about BASIC was that it was, well, basic. There wasn’t too much to it, you couldn’t go too far wrong, and yet the scope of what you could do felt limited only by your imagination (and available memory). It also was a great gateway language: if you got good enough at BASIC you were bound to hit a point where you’d want to switch to something more advanced to accomplish more. It was a fantastic way to introduce a coding mindset, which, I think, is really the valid benefit behind a lot of the “everyone must code” crap.

Fast forward roughly twenty years and things are a good deal different. All else aside, unless you dig up an ancient computer, good luck running BASIC. So what’s a good replacement? C++? Java? Ruby? Python? Are you serious?

Almost all of the prevalent languages nowadays present a couple of big problems to a person who’s learning:

  1. They’re complex as hell and difficult to learn.

  2. They’re dangerous: you could really mess up your computer with any of them.

So what’s the solution? No doubt there are a lot of great languages out there for teaching people programming that I know nothing about. Here’s something I’ve noticed (and please take this with the obvious proviso that in no way is this a generality or a Deep Wisdom or world-changing insight.)

CSS is a pretty great introduction to the greater world of making computers do things on a more than basic level.

“What?!” I hear you say. “That’s not a programming language!”

No, it isn’t. However, it has a lot of the same benefits that were conferred by BASIC.

It’s easy to learn. You can’t go far wrong / mess stuff up. It’s safe. It’s fairly easy to do a few things that look really pretty cool with CSS, and that’s exactly the kind of experience that gets people hooked and keeps them learning. There’s a point at which you’ll be prodded to step beyond CSS and try something a bit more advanced (usually Javascript).

Most of all, I think it allows the learner to start adopting a helpful mentality. The way that you make small incremental changes to CSS, checking what it looks like every time, is conducive to a bolder approach to solving computer problems. Many non-technical people are scared of doing things on the computer — or see it as out-with their ability to learn — because they don’t realize that a lot of the magic is just trying different things and seeing if they work. That’s how most smart computer geeks I know solve problems: they iterate their way closer to a solution.

This is the big secret of being “good with computers”: you Google around and then you try something. Learning CSS (and some very simple HTML) follows this pattern exactly.