DEV Community

Cover image for Similarities between programming & screenwriting
Marcin Kołodziejczak
Marcin Kołodziejczak

Posted on

Similarities between programming & screenwriting

This article is most of all focused on the creative process and its interdisciplinary character.
Thus, I’m not going to compare job offers, salaries, prospects and... plenty of other things.
Technical knowledge is not needed though.

Let’s FADE IN!

Collaborative character


💻
You can write a real-world application by yourself.
If you're a go-getter it may be even quite a serious password manager used by over 100,000 people.
That’s the story of Kyle Spearrin the creator of "Bitwarden"¹.

📝
The same stands for screenplays. You can write short films or even feature-length films on your own. In fact, it seems to be quite popular².
Moreover, there are people like Michael Hirst who wrote whole TV series on its own - I'm sure you've heard of the widely beloved “Vikings”.

Nonetheless, most applications and screenplays (especially TV series) are outcomes of close cooperation and that’s why it’s so easy to list the exceptions.

The importance of structure and patterns


💻
There is tons of great content about the application structure.
Flat structure, layered architecture, grouping by modules, grouping by context, hexagonal architecture³…
“Architecture” sounds serious but it mostly boils down to organizing folders and files.
Having known that you placed the files thoughtfully you’re ready to write the code and most likely use some design patterns.
They are battle-tested and well-described ways to solve popular problems. You don’t even have to recognize them, programmers tend to use them without being fully aware.
They are everywhere though.

📝
It’s also the case in screenwriting.
If you’re going to use standard three-act structure you basically know where your turning points should be. You know that you have (at best) 10 minutes to grip the film audience.
In a feature-length film you’re going to have a ~120 pages screenplay in which you’ll have ~40 scenes. You need character objectives for each of them and obstacles to make it dramatic.
However, you don’t have to use that concrete structure and probably won’t when dealing with parallel stories of multiple characters at once⁴.
Full awareness about all of this while writing a screenplay is not essential yet knowing patterns definitely helps in recognizing potential weak points and choosing the right tool for the job.

Every part should be necessary


💻
If you’re a programmer and you worked with properly configured project (actually - a tool used within the project called “linter”) you may have seen similar message more than once:

'doSomethingStrange' is assigned a value but never used. eslint(no-unused-vars)

The linter helps you in identifying unused code so you can easily get rid of it.
We don’t need code which doesn’t serve any function in the current application and only generates additional noise which makes understanding the rest of code harder.
Notice: we don’t need it so much that we’ve made tools to catch it.

📝
If you're a screenwriter I’m sure you’re familiar with the term “Chekhov’s gun”, but for the rest of readers:

If in the first act you have hung a pistol on the wall, then in the following one it should be fired. Otherwise don’t put it there.

Let’s move on.

Reading is more important than writing


💻
It’s often said that reading other people's code will make you a better programmer.
That’s so obvious for experienced ones that it may be even called a truism.
Thanks to that you may find more non-standard approaches to solve specific problems than you know from famous, SOLID books, that I’m sure you’ve read (if you’re a programmer, of course).
But doing self-reviews is not less important.
It’s a good practice to read your code before you convey it to your coworkers. You’ll probably find some room for improvement and do some rewrites.
Then this code is read by your teammates who check it and try to understand.
They may have some suggestions to make it even better or just accept it.
Ultimately, reading makes your application code better.

📝
I don’t like generalising - I know only a few professional screenwriters but they tend to be bookworms. They read a lot not only to get inspired yet to understand other people better and the context in which they live(d).
Writing a convincing story about, let’s say, a “German knight” without knowing anything about the epoch would be hard or even impossible - you need to get familiar with it.
In that case you have to rely on books, because you are probably not going to meet a German knight in upcoming weeks.
Ultimately, screenwriting is just storytelling. Storytelling is based on sharing experiences (they don't have to be ours).

In screenwriting reading also leads to rewrites. Typically screenwriters do several rewrites (presumably more than 3) before the screenplay is ready for production stage (wherein it’s very likely to be partially rewritten), but it highly depends on the way the author works.

Testing


💻
I didn’t mention that before, but during the process of creating new functionality (adding new application code) it’s a good practice to test if that code actually works. To do so, programmers write so-called “unit tests”, which looks like this:

expect(addOneTo(4)).toBe(5);

This is a painfully simple test of one function called “addOneTo” being a tiny part of an application just to show the concept. If the function works correctly this test is going to pass.
Of course that’s not everything.
The whole application is often tested manually by professionals who check all possible usage and seek for bugs.

📝
Screenwriters perform manual tests to check if particular scenes work correctly.
They read dialogues out loud to catch any artificial parts that may be noticed by future audiences.
Sometimes it’s not enough and they test it with a bunch of friends, colleagues or other people who weren’t really involved during the writing phase.

Formatting


💻
Finally! Last thing!
Formatting is crucial for reading and understanding the application code by people but it’s not really important for the computer which executes it.
That’s why it is always a programmer's job to take care of it.
Thankfully there are tools that automate this process (e.g. code is formatted after each CTRL + S by a tool called formatter), therefore programmers don’t have to think about it.

📝
Remember FADE IN from the beginning of the article?
That’s the first two words of a properly formatted screenplay.
Then there is action and dialogue (most likely) and we end everything up with FADE OUT.
There are dozens of rules on how to format a screenplay in a professional way and that’s why screenwriters often use dedicated applications which perform it automatically.
There are also tools based on plain text formatting which is something that you probably would start with if you were a Markdown fanboy (see: Fountain).

And that’s it for now. I hope you liked it! 😃
If you found something unclear don't hesitate to leave a comment - I would love to discuss.

If you like short films then I encourage you to watch the 2-minute thriller of mine.

Cheers! 👋

:qw

FADE OUT


Footnotes:

¹ Yes, Kyle is no longer alone, there is a team which is working on Bitwarden right now.
² Even if there is only one screenwriter in the credits it doesn't have to be the only one person who was writing the screenplay. So-called Script doctors remain uncredited.
³ Great talk about application architecture: https://www.youtube.com/watch?v=oL6JBUk6tj0
⁴ Classic film with aforementioned structure: https://www.imdb.com/title/tt0108122/

Discussion (0)