The Programmer's Brain - Deepstash
The Halloween Collection

Learn more about books with this collection

Navigating and enjoying the thrill of horror and scare experiences

Historical knowledge of Halloween and its origins

Understanding and appreciating Halloween traditions worldwide

The Halloween Collection

Discover 64 similar ideas in

It takes just

10 mins to read

Cognitive Processes

Cognitive Processes

We use 3 cognitive processes while programming or reading code:

  • Long-term memory (LTM) is similar to the hard drive of the brain. It stores the things that we have learned in the past, such as syntax or an algorithm.
  • Short-term memory (STM) is like the RAM or cache memory. We use it to remember the things we have just seen, such as the type of a variable or a function name.
  • Working memory is the CPU of the brain. This is what we use for thoughts, ideas, and coming up with solutions while programming.

37

514 reads

A Chess Experiment

A Chess Experiment

In an experiment, both chess masters and average players were asked to memorize a chess board configuration, and the chess masters did way better.

That was because the experts had previously seen something similar, and they only had to store a few items in their STM, such as “Sicilian opening with a knight moved to D4”. The average players were trying to memorize the whole board. Research showed that we can only hold around 7 items in our STM.

When they ran the experiment with a configuration with pieces arranged completely random, the chess masters did just as bad as the average players.

29

468 reads

Chunking Code

The way the chess experiment applies to programming is that we should aim to split our code into chunks that make it more readable and easier to remember.

We can achieve this by using design patterns and comments. If a function’s name is enough to describe what it does, then a comment is not necessary. But sometimes a comment is needed to increase code readability.

30

385 reads

Active Elaboration

Active elaboration is the process of thinking about similar things when learning a new concept. This helps strengthen the concept in memory.

In the context of programming, you can think about similar concepts in another programming language or if the concept fits a certain paradigm, framework, or domain.

32

348 reads

Understanding Code

Since code is similar to natural language, we can apply the same techniques that we use to understand text to understand a piece of code. A great way is to try to summarize the piece of code in words, which helps you understand it better and can serve as documentation.

27

321 reads

Naming Variables

Naming Variables

It is pretty obvious that the names of variables matter. But oftentimes when we are in the middle of a hard problem, thinking about the name of a variable is too much for our cognitive capacity, so we just choose the first thing that comes to mind.

But we can increase our naming abilities while reviewing other people’s code. When you see one of their variables for the first time, take a few seconds to try to predict what it will be used for, and later evaluate how accurate its name was. Overtime, this should increase your intuition about good variable names.

29

297 reads

Choosing A Good Name

A good name must fit the natural language the variables are defined in. For example, since in English you would say “the maximum number of points”, it makes more sense to choose the name max_points over points_max.

Also, the aim should be to use 2-4 words per variable (apart from the common 1 word names).

29

310 reads

Using Memory To Your Advantage

Using Memory To Your Advantage

Since we can only hold a few things at once in our memory, this can slow us down while programming or while reading code. There are 2 strategies we can use.

  1. Automatization: Practice a concept so much that it becomes second nature. If you’ve been programming for a while, you never think about the syntax of a for-loop, so that does not take almost any brain power while writing code.
  2. Making models: a model is an abstraction you make to reduce your cognitive load, such as a diagram about a complicated codebase that helps you understand it better.

28

297 reads

One of the things I take away from this book is that confusion and feeling cognitively overwhelmed is fine, and is part of life and learning. Before I knew all I know about cognition, I used to get upset with myself for not being smart enough to read complicated papers or explore unfamiliar code; now I can be kinder to myself and say, “Well, maybe you have too much cognitive load.”

FELIENNE HERMANS

34

338 reads

CURATED BY

More like this

Clean Code

20 ideas

Clean Code

Robert C. Martin

Grokking Algorithms

3 ideas

Grokking Algorithms

Aditya Bhargava

Building a Second Brain

22 ideas

stash-superman-illustration

Explore the World’s

Best Ideas

200,000+ ideas on pretty much any topic. Created by the smartest people around & well-organized so you can explore at will.

An Idea for Everything

Explore the biggest library of insights. And we've infused it with powerful filtering tools so you can easily find what you need.

Knowledge Library

Powerful Saving & Organizational Tools

Save ideas for later reading, for personalized stashes, or for remembering it later.

# Personal Growth

Take Your Ideas

Anywhere

Organize your ideas & listen on the go. And with Pro, there are no limits.

Listen on the go

Just press play and we take care of the words.

Never worry about spotty connections

No Internet access? No problem. Within the mobile app, all your ideas are available, even when offline.

Get Organized with Stashes

Ideas for your next work project? Quotes that inspire you? Put them in the right place so you never lose them.

Join

2 Million Stashers

4.8

5,740 Reviews

App Store

4.7

72,690 Reviews

Google Play

Sean Green

Great interesting short snippets of informative articles. Highly recommended to anyone who loves information and lacks patience.

Ashley Anthony

This app is LOADED with RELEVANT, HELPFUL, AND EDUCATIONAL material. It is creatively intellectual, yet minimal enough to not overstimulate and create a learning block. I am exceptionally impressed with this app!

Shankul Varada

Best app ever! You heard it right. This app has helped me get back on my quest to get things done while equipping myself with knowledge everyday.

samz905

Don’t look further if you love learning new things. A refreshing concept that provides quick ideas for busy thought leaders.

Laetitia Berton

I have only been using it for a few days now, but I have found answers to questions I had never consciously formulated, or to problems I face everyday at work or at home. I wish I had found this earlier, highly recommended!

Giovanna Scalzone

Brilliant. It feels fresh and encouraging. So many interesting pieces of information that are just enough to absorb and apply. So happy I found this.

Ghazala Begum

Even five minutes a day will improve your thinking. I've come across new ideas and learnt to improve existing ways to become more motivated, confident and happier.

Jamyson Haug

Great for quick bits of information and interesting ideas around whatever topics you are interested in. Visually, it looks great as well.

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates