“What is programming? What makes it so interesting for you?”
During 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. 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.
The essence of the story
When you start writing a screenplay, you first have to have an idea – the essence of your story. Most economical telling of it. If you know that, you can build up from there. You start writing the scenes – what happens first or what is the most brilliant part of the story. Decide what will be shown on the screen, what happens on 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 other functionalities or with the most attractive one. Decide what will be shown on the screen, what happens on the background, what part will this functionality play in your program. If you make the first one work, add more.
Clear and compact
For me the best stories are compact and clear. Every scene should make a progress in 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 interesting and cool 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 simple paths that he is compelled to walk on. It’s all about how you organize your functionalities – decide what goes with what, are the labels clear, what is most 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 to rebel against the program.
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 very little experience in programming, it seems to have more inspiring effect on them than just saying “Programming is fun!”. What is more important, it has the 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 accused of “being good with numbers and 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 virtual world. There’s a lot of hidden power in writing code.