Video Summary and Transcription
Cognitive load is the thinking load that can lead to cognitive overload. Disabilities can increase cognitive load, and reframing tasks can reduce it. Information presentation affects cognitive load, with intrinsic, extraneous, and germane cognitive load. Focus and context switching should be managed to optimize workflow and reduce cognitive load. Opening a PR can be simplified with task automation, and optimizing workflow involves reducing distractions and utilizing tools. Prioritizing personal coding skills and reducing cognitive load are key to success.
1. Introduction to Cognitive Load
Hi, my name is Abby, and I'm here today to talk to you about Cognitive Load and your development environment. Cognitive load is basically your thinking load. Cognitive overload is triggered by a task or tasks requiring more cognitive load than you can sustain. Many factors determine how much cognitive load you can sustain before hitting cognitive overload. Aspects of the task itself, the way information is presented, the amount of information, and the complexity of the information all affect cognitive load. External factors like lack of physical resources, physical discomfort, emotions, chronic stress, disabilities, chronic pain, and memory-related conditions also influence cognitive load.
Hi, my name is Abby, and I'm here today to talk to you about Cognitive Load and your development environment. I have a blog that has all the information in this talk and more, so if you're looking for more information about something I say, like documentation or just more detail, it's probably in the blog, as well as how the people who study this apply it to real day life and more. So I have the QR code here with the link to the slides, and I'll drop all of this in the Discord during the Q&A session as well.
So what is cognition or cognitive? These are fancy words for thinking. Cognition is the noun and cognitive is the adjective. So cognitive load is basically your thinking load. In other words, the amount of available memory and cognition resources you have. In other words, you only think about so many things at once, and you can only remember so many things at once. Cognitive load is also the term for the amount of memory and cognition resources a task requires, because in psychology, we can't make things easy.
Cognitive overload, on the other hand, is triggered by a task or tasks requiring more cognitive load than you can sustain. You are probably thinking, wow, this is a lot of fancy terms, but you're probably familiar with the sensation, which is when I would play this video for about 40 seconds of constant notifications. So after hearing all those constant notifications, you may be thinking things like, which notification would I even respond to first? How am I going to break down all of those notifications so I even know what I need to respond to? And those are the kinds of questions you start asking yourself when you enter cognitive overload.
Many factors determine how much cognitive load you can sustain before hitting cognitive overload. Aspects of the task itself affect how much cognitive load a task requires, so how long you have to focus. The way information is presented to you, the amount of information, and the complexity of the information itself are all going to determine how much cognitive load a task requires. External factors affect cognitive load that is available to you. Lack of physical resources, if you need food, sleep, water, you're probably going to be dedicating at least a portion of your cognitive resources to getting those things rather than dedicating all of your cognitive load to the task at hand. Physical discomfort, like pain, very similar. If you are in pain, you are probably thinking about it, which means those resources are not resources that you can dedicate to the task at hand. Emotions, on the other hand, the relationship is very complex. We all have that coworker who loves spite-driven development, and we have the coworker who can only focus and go deep when everything is calm and copacetic. Chronic stress, on the other hand, over time, decreases your available cognitive load. If you've been stressed for multiple weeks, you may notice that it's a little bit harder to think, a little bit harder to go deep on problems, and that's because your stress is affecting your available cognitive load. Disabilities can decrease your available cognitive load. Anxiety, basically chronic stress. Post-traumatic stress disorder, also chronic stress, but PTSD has symptoms that will take you out of the present moment. You'll have to dedicate all of your cognitive load to dealing with them, making doing menial tasks difficult. Chronic pain, another type of chronic stress, but your nerves will be firing off sensations that you are almost guaranteed to have to focus on. So chronic pain, over time, will decrease your available cognitive load, just like chronic stress. Dementia, Alzheimer's, and amnesia are all affecting your memory.
2. Disabilities and Cognitive Load
If you have less memory to use, then you have less available cognitive load. Disabilities can also increase the amount of cognitive load a task requires. Sensory processing disorder, auditory processing disorder, dyslexia, traumatic brain injury, executive dysfunction, attention deficit hyperactivity disorder, and autism spectrum disorder all affect cognitive load.
If you have less memory to use, then you have less available cognitive load. Disabilities can also increase the amount of cognitive load a task requires. So sensory processing disorder. I have an auditory sensory processing disorder, so if people are talking to me, I'm usually a few seconds behind. It takes me a little bit more time and cognitive resources to understand what people are saying, and that requirement only goes up the more people are talking at once.
A learning disorder, like dyslexia, on the other hand, someone with dyslexia would prefer to hear things spoken to them. Reading something in text is going to take more cognitive load than hearing it spoken aloud, which is why a lot of people with dyslexia use a screen reader to navigate websites. They are able to get through that information much faster. Some disabilities both decrease your available cognitive load and increase the cognitive load that tasks require. A traumatic brain injury really depends on which part of your brain is affected. If it's your language processing center, then the it will probably present much like an auditory processing disorder. If it's the part of your brain that allows you to keep track of time, then tasks requiring keeping track of time are going to take more cognitive resources. If the part of your brain controlling executive function, which is the big front part, is affected, then your ability to plan, control your impulses, and direct your attention are the things that are going to be affected, which is why attention deficit hyperactivity disorder is the worst possible name for this disorder.
I have plenty of attention. It's directing the attention that is the problem. It's an executive dysfunction. That's what I struggle with. The popular joke is, you know, ADHD, look, squirrel. That's because I have a hard time directing my attention away from things that are interesting, but also a hard time directing my attention towards things that are very boring. So if you give me an interesting task, such as in a video game, I can do that all day long. But if you need me to wash the dishes, that's going to be a little bit more of a struggle. It's so boring. It happens every single day. It's because we have an interest-based nervous system. If you give us things that are novel or interesting, we're going to have a great time. But just because it's important, like a neurotypical importance-based nervous system, doesn't really register the same for us. Autism spectrum disorder is a little different. There's some research showing that the verbal working memory, so how many words someone with ASD can hold in their brain at once, is lower to start. But also sensory information comes in at the same level of importance as every other stimulus. So they have to dedicate cognitive resources to filtering out that information.
3. Cognitive Load and Development Environment
Someone with ASD would have to dedicate resources to ignoring sensory stimuli. Reframing tasks or information with the audience in mind can reduce cognitive load. Instructional design studies how the design of learning materials affects information consumption. Three ways to describe how information presentation affects cognitive load are intrinsic, extraneous, and germane cognitive load. Intrinsic cognitive load in learning a code base is readability. Reduce function in JavaScript is debated due to its cognitive complexity. Extraneous cognitive load in learning a code base is affected by documentation. Germane cognitive load in learning a code base is understanding the whole system. Development environment extends beyond the computer and includes physical and mental well-being.
Whereas someone who is neurotypical would have an easy time ignoring the air conditioning blowing over their skin. Someone with ASD would have to dedicate resources to ignoring that. So as we saw with a sensory processing disorder or a learning disorder, if you reframe the task or information with the audience in mind, that can reduce required cognitive load. So if you give a person with ADHD or ASD a task in a calm, quiet room where they can control the soundscape, they're going to have a much better time than somewhere like, I don't know, an enclosed children's playground, where not only are the children screaming, but the screams are bouncing off the walls.
Instructional design is an area of study that studies the way the design of learning materials affects the consumption of information by learners. In other words, how people absorb information. It's not just for school. It's also for things like training for employees. And they came up with three ways to describe how the information is presented affects the cognitive load of trying to learn that information. So intrinsic cognitive load would be how difficult the concept is to understand. We have a saying in American English that it's not rocket science, because we all understand that rocket science is pretty complicated compared to something like addition. Extraneous cognitive load is how difficult the presentation of the information is to understand. We talked about spoken word versus text, but there's also, like, how much is it? Like, how much text, and how is it presented? Is it broken up? Things like that. Germane cognitive load is how much cognitive load is required to process the information and store it in memory. So are you able to understand the concept as a whole and remember it later?
Intrinsic cognitive load, when it comes to learning your code base, would be readability. G. Anne Campbell has a white paper called Cognitive Complexity, a New Way of Measuring Understandability. And the tool Code Climate took that and allows you to scan your code base to get a level of cognitive complexity. If you've ever been involved in the debate in JavaScript about whether or not people should be using Reduce, you have been having a discussion about cognitive complexity and intrinsic cognitive load. If you haven't been part of this debate, basically, the idea is that Reduce itself, like something like recursion, is difficult to understand on its own. Then you add in the function that you're passing to it. So is it so cognitively complex that you should just avoid using it in order not to force someone else to learn this huge concept when they're just trying to fix a bug?
Extraneous cognitive load and learning your code base would be documentation. Is it easily findable? Is it reference documentation or a guide? Is literally the way that your documentation stored and presented making it more difficult to absorb that information? Germane cognitive load, when it comes to learning your code base, would be understanding the whole system, which is why we want to provide diagrams and mental models in multiple ways to consume information about your code base and how the system works as a whole and what problem you're trying to solve with your product. Finally, we get to your development environment, and unfortunately, I'm here to break it to you that your development environment extends beyond your computer. It starts with your body. Your body needs things, food, water, sleep, at a minimum. You need to take physical breaks. My physical therapist loves to tell me that sitting is the new smoking. If you sit for a long time, you're eventually going to start getting pain, and as we know, pain takes some cognitive resources to deal with and takes it away from the task that you want to focus on, which is probably coding. You also need mental breaks.
4. Focus and Context Switching
You cannot focus for eight hours straight. The costs greatly outweigh the benefits. Reduce the amount of information you're taking in while trying to focus. Close your tabs, turn off notifications, and keep things simple. No one is good at context switching. Reduce your context switching. Split up your tasks so you can concentrate on one area. Task batching, day theming, and time blocking are recommended ways to do this. Set times for responding to notifications and emails. One task is usually multiple tasks.
You cannot focus for eight hours straight. Believe me, I have tried. The costs greatly outweigh the benefits. It includes your physical environment. Reduce the amount of information you're taking in while trying to focus. If you don't have a bunch of things going on in the background, you'll find that waiting for the server to load will become a lot easier because there's nothing that you want to get distracted by.
It also includes your virtual environment. Do as I say, not as I do, and close your tabs. Turn off your notifications. Keep things simple. Don't have like a background that's a rave that you can see out of the corner of your eye when you're trying to focus on something else. This may also mean for you, reducing the number of screens that you have to look at. You don't need 20. You probably suffice with one, maybe two.
I'm also here to break it to you that no one is good at context switching. It takes you longer than you think it does. It stresses you out, and it prevents you from going deep on one topic, and you may be thinking, Abby, I'm great at multitasking, and unfortunately, multitasking is not real. It's a lie. What's actually happening is you're getting involved in one task. You're thinking about it, so you're taking your mental whiteboard, and you're writing notes about that task, and then you switch to the other task, so you erase your mental whiteboard, and then write all your notes about the second task, and then you erase those notes and switch back to the other task and write your notes again, and then you erase it, and then you go back and write your notes again, and it may seem like it goes faster than I just described, but it really doesn't. You are just switching between two tasks, and that's taxing on your brain. So, reduce your context switching. Split up your tasks so you can concentrate on one area.
This may mean switching out a fetch handler in three files and not fixing everything about one file, fixing everything about the second file, and fixing everything about the third file. At a larger scale, for all your tasks for the day, there are three recommended ways to do this. Task batching, day theming, and time blocking. You can also set times for responding to notifications and emails, because every notification and every email is a context switch. This one's for my neurotypicals. One task is usually multiple tasks. The way that it's often explained is, the first step in doing the dishes is not washing a dish.
5. Opening a PR and Task Automation
Opening a PR involves multiple steps, from writing code to filling out forms. Declutter your mental whiteboard and use apps or organizational systems to store future tasks. Document your standards to avoid issues after opening a PR. Automate tasks with linters and formatters, and rely on tests and checks to catch errors. Take advantage of features like IntelliSense in your text editor or IDE.
It's stepping up to the sink. The second task is identifying what cleaning materials you need. The third task is getting those cleaning materials. The fourth task is identifying which dish you're going to wash first.
Similarly, opening a PR is not one task. First, you've got to write all the code and do all the commits and get it ready. And then once you hit the PR button, you've got to fill out a whole form. And you may have the easiest form and the easiest code review, but that's still multiple steps. A lot of places, you have to fill out multiple sections of a description, make sure your title works, and every time you have to remember one of those things, that's an extra task.
So my recommendation is to declutter your mental whiteboard. Don't try to remember everything. Store future tasks somewhere other than your brain. Use apps and organizational systems. There's literally an organizational system called Second Brain for this reason. Document your standards. Nobody likes finding out about a standard that they totally would have followed if they had known about it before the PR after they've opened the PR. After they've opened the PR, that's like 15 things they have to fix. Everyone will appreciate the standards being documented clearly so that they can do it in their own time before they ask you to review it instead of wasting everybody's time.
Automate as many tasks as possible. I love to say that I am the litmus test for whether or not your process will be forgotten. So I love linters and formatters. Don't make me remember styling formats. No. Tests and checks running at the time of PR, perfect. I will always forget to run the test script before I push it up. So automatically failing a PR if it's not passing something is great. Also, learn your text editor or IDE. The best example of this is IntelliSense. You don't ever have to remember how you spelled that variable name ever again. IntelliSense will remember for you.
6. Optimizing Workflow and Reducing Cognitive Load
Learn keyboard shortcuts, customize your UI, and reduce distractions. Use tools like VS Code's command palette and Zen mode to streamline your workflow. Take advantage of features like workspace and settings sync, code snippets, automated tasks, and source control GUI to save time and mental effort. Avoid relying too heavily on AI-generated code and prioritize your own coding skills. Set yourself up for success by reducing cognitive load and allowing your brain breaks. Remember the importance of focus and minimizing context switching for yourself and your team.
Learn your keyboard shortcuts, use the defaults, or even make your own, and edit the UI so you have fewer distractions. I use VS code. So my examples from VS code are the command palette and Zen mode. Command palette allows you to enter commands instead of doing things manually. And Zen mode is one of those commands where it'll hide everything except for the file that you're currently working in.
You can use workspace and settings sync, which will mean you don't have to remember your favorite settings every time you go to set up your development environment. They also have usable code snippets, code actions and quick fixes, automated tasks, and the source control GUI, which means you don't have to remember git commands, and use buttons. And we know VS code has plenty of extensions for things like showing whether or not your tests passed or failed, so you don't have to remember to run that script and find out once you've started opening the PR.
You'll notice AI is not in here, and that's because I cannot think of a thing that involves more cognitive load for me than looking at a big paragraph of, well it's not a paragraph in code, but a big chunk of code that has been generated for me and checking it for errors. I would rather just write the code myself. I'm sorry.
Basically, we are setting ourselves up as developers for constant learning. That requires setting your brain up for success. You're already asking your brain to be uncomfortable and learn new things on a regular basis, so don't stress it out if you don't have to. Let it have its breaks. Let it not context switch as much as possible. Here's a quote from Matthew Skelton that I really love. When cognitive load isn't considered, teams are spread thin, trying to cover an excessive amount of responsibilities and domains. Such a team lacks bandwidth to pursue mastery of their trade and struggles with the costs of switching context.
I don't know about you, but I've been on teams where I was expected to cover multiple products, and the result was I didn't go deep on any of them. When I'm allowed to focus on one product, I will know that thing inside and out and start coming up with even better solutions for problems. When you are leading a team, make sure that they are allowed to go deep on things. Give their brains breaks. Don't make them context switch as much as possible.
That's all I've got. Here's the QR code for the slides. Again, here's a link to that blog. Thank you so much for coming out and listening to me talk about brains.
Comments