small medium large xlarge

Stroop Effect

Try This

The table below contains a list of color names, each displayed in another color. Say aloud the color each word below is written in, rather than the word itself.

blue green yellow green green blue white green blue white yellow white blue white red yellow cyan blue cyan blue green green cyan cyan yellow red blue yellow white yellow blue green cyan red green

How’d you do?

Cover Image For The Pragmatic Programmer…

Was it difficult to ignore what was written and just read the color names?

Your brain wants to read the words, not the colors. The conflicting information makes this excercise much harder than it should be.

The same thing can happen to you when designing and writing code. You’ll have a hard time ignoring the names of classes, variables and functions. Give them good names, or things can get very confusing, very fast, as the cognitive dissonance interferes with your brain’s normal processing.

For more interesting tidbits on software development, see all of our titles.