The Life-Changing Mysteries of Coding
Writing computer code can be so easy — and so hard at the same time
This is what coding is: You type some special words into a text editor. It probably has a black background. Some of those words turn different colors as you type them. Once you’ve typed all the special words, you save, or save and build, or press compile. And then you look at the output. If it doesn’t look right, you go to a white and orange website and hunt around until you find someone who has done more or less what you want to do and you copy and paste that.
This is also what coding is: You’re at a whiteboard. It’s covered with mathematical symbols. There are Greek letters up there. A colleague is drawing some dotted lines. Someone is talking about memory management. You all have at least one PhD.
When we talk about coding, we’re talking about everything from putting together basic HTML for a static page to creating software that runs custom embedded systems inside nuclear power stations. Coding is easy and coding is extremely hard. It contains multitudes.
I do easy coding. Strings. Strings are bits of text. That’s what I write. Computers like to know what they’re dealing with, so when you give them information, generally you tell them ahead of time what you’re going to give them: I’m going to give you some text (a string, for example, “Hello Computer, you think you’re so smart?”) or I’m going to give you a whole number (an integer, for example, 7) or I’m going to give you a decimal (a float, for example, 7.1). After a while, it all gets a bit maths-y.
In coding different types of data are referred to as “types. ” There are lots of types. Inevitably, I use most of them from time to time. But let’s be honest, most of what I do is passing around strings. That’s the case with many websites. On Twitter you type a string into a box, Twitter sends it to a database, and it shows up in a big list. On Whatsapp, you type a string into a box, and it gets sent to someone else’s screen. Obviously there is more going on (scale is a killer), but if you wanted to throw together a cheap Twitter-clone over a weekend that’s what you’d do — pass some strings around.