Skip navigation.

Human Context Switching

programming languages
I'm not talking about CPU Context Switching, I am talking about the similar phenomenon your brain does to switch between what it is focused and has in memory.

Say you are working on more than one project at a time... Every time you have to shift focus to something different, your brain does something analogous to a context switch. Sometimes you have all of the details stored in your memory and you can quickly switch to many sets of tasks and be able to recall full details quickly (like a cache hit). Other times you have to go back to some research or previous notes (like a disk read) before your brain's processing fully begins.

The reason I am writing about this is within the context of programming languages. Each language you work with has its own syntactic rules, style, standard library, best practices, etc. In the past, I had a hard time keeping more than one language in my head at any given time. It would generally be my comfort language, and writing code in any other language was a very lengthy context switch where I had to dive back into old code, use online resources, and re-read books.

Lately I have found myself in the precarious situation where I am using four different languages regularly (as in extended time writing code in each; most days of the week)... Java, C#, Python, Perl. As to why, thats outside the scope of this :)

I have finally got to the point where I can context switch immediately form working in one language to the other within this set.

Which begs the question, how much can your brain handle? If you think about the numerous tools, frameworks, libraries, API's, shells, utilities, design patterns, markup languages, meta languages, programming languages, etc. that an average developer keeps on tap, it is pretty immense!

How big is your cache?

-Corey Goldberg