“What is programming? What makes it so interesting for you?”
In the last few years, I have been more actively taking part in preaching the virtues of writing code. Be it coaching at Rails Girls workshops, organizing Tech Sisters’ events or lecturing to first-year IT students, I have had to answer these questions more than once.
Just saying it’s a fun and exciting way to express yourself, simply does not suffice when you are trying to persuade people to try out something that from a distance looks cryptical and very complicated. So to sound convincing, I first had to find a better answer for myself.
Something out of nothing
I’ve never dreamt of becoming a programmer and did not start to code in my infancy. The fact that I’m a programmer is the consequence of practical reasoning and not being able to decide on anything else when I finished high school. What I dreamed about was being a writer; a writer of stories, plays, movies. And the thing that most compels me in writing is that you can create worlds and alter realities using only your mind. It’s the same thing with writing code and what’s more – I have realized that writing a web application is not so far off from writing, for example, a screenplay.
You can create worlds and alter realities using only your mind. It’s the same thing with writing code.
When you start writing a screenplay, you first have to have an idea – the essence of your story, the most basic form. If you know that, you can build up from there.
You start writing the scenes – what happens first? Or, perhaps the climax of the story. You can decide what will be shown on the screen, what happens in the background and how all this makes the story go on.
All this also applies to programming.
You have to have an idea – it can be ambitious, but the simpler it is, the better. Try to put it into one sentence and be as specific as you can. Reduce your idea to the minimal possible version. The small steps you now take are functionalities, not scenes. You should start with the one necessary for the function of your application. Decide what will be shown on the screen, what happens in the background, what part will this functionality play in your program.
If you make the first one work, add more.
For me, the best stories are compact and precise. Every scene should progress the story. Every sentence should have a meaning. The plot has to be tight and support itself in every aspect. Loose ends and unnecessary functionalities distract and confuse users.
You don’t want to end up with something like Star Wars Holiday Special – a set of storylines, which may seem exciting and fresh on their own, but all in all is just 2 hours of pure torture.
No horror movies!
Unlike the audience in the movie theater, the user of a program is not a passive spectator. What makes programming a bit more compelling and also complicated is that the user is also the actor. Mostly the actors will improvise and click around randomly, insert weird data and do a lot of stuff the author wouldn’t even dare to dream about. But the force is strong with the programmer.
You can direct the actor with clear and straightforward paths that they are compelled to follow. It’s all about how you organize your functionalities – decide what goes with what, are the labels clear, what is important and is it understandable to the user, how the program reacts to user actions.
When you show users things they can’t do, something broken or a cryptic error message, you are basically writing a horror movie. You know what happens when a character finds a door to a dark cellar with creepy noises coming from or a gate with a sign Do Not Enter? All hell breaks loose. Writing a program is all about creating the illusion of freedom of choice. This makes the users happy, and they will not rebel against the program.
Writing a program is all about creating the illusion of freedom of choice.
The leading role
Every movie needs a central character around whom everything revolves. Every person wants to be the leading actor in their life. As there are more and more programs and technologies that cry for our attention and clutter our minds with information, we tend towards simpler and clearer applications. Being in control of your life means not having to spend time on reading long instructions or manuals. We want things to work intuitively.
If a program frustrates me as a user and makes me feel stupid, I feel like a sidekick and not being in control. I don’t want to use the program again. I want to be Clint Eastwood in a spaghetti western – I want the program to make me feel capable, cool and smart, overcoming obstacles with the ease of a mouse click.
My comparison of screenwriting and programming may be a bit arbitrary, maybe even a little arrogant, but as far as I have talked about it with people who have minimal experience in programming, it seems to have a more uplifting effect on them than just saying “Programming is fun!”.
It’s good to remind yourself, that programming has something magical about it, more to do with creativity and imagination
What is more important, it has an inspiring effect on myself. Routine, deadlines, stress and scrutinizing code too close can have a numbing effect. It’s good to remind yourself, that programming has something magical about it, more to do with creativity and imagination than being good with numbers or awesome at math. After all – you have to have a pretty good imagination to see how your code fits together with all the rest of the virtual world. There’s a lot of hidden power in writing code.