Experiencing The Stroop Effect With a Ruby CLI
Tags: ruby, sideprojects, cli, psychology
Published: 2020-06-24 18:58:26

---
title: Experiencing The Stroop Effect With a Ruby CLI
published: true
description: 
tags: #ruby #sideproject #cli #psychology
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/wabc51ezl4y9uyabk0un.png
---

You’ve probably seen these weird lists of color words before. Words whose text color does not match their content. Maybe you’ve even tried to read the text colors out loud quickly and have struggled to do so?

These lists are part of psychological tests to demonstrate the so-called [Stroop effect](https://en.wikipedia.org/wiki/Stroop_effect). It is named after the American psychologist John Ridley Stroop, who first published the effect in English in 1935. 

Wikipedia tells us: 

> "The Stroop effect is the delay in reaction time between congruent and incongruent stimuli."

But what does that actually mean? :thinking:

---

I built a tiny command line interface with Ruby – just because it was fun and so that you can experience the Stroop effect yourself. You can install and run it with:

```bash
gem install stroop
stroop
```

---

# Congruent? Incongruent?

A Stroop tests consists of a small task, like reading color words. This task can be done with different kind of stimuli, namely: neutral, congruent, and incongruent.

Let’s take a list of color words with a neutral stimulus, which means that all words are written in the same text color:

![Color word box - neutral stimulus](https://dev-to-uploads.s3.amazonaws.com/i/azglsspg2ikyan4gcbe1.png "Neutral mode")
<figcaption>Neutral Stimulus – All color words are written in a neutral text color (black, or here gray)</figcaption>

Reading all words out loud should not be hard to do.

Next let’s take the same list of color words, but let’s print them in a color that matches the respective text. That’s a congruent stimulus:

![Color word box - congruent stimulus](https://dev-to-uploads.s3.amazonaws.com/i/flew8kbqozksivva35zd.png)
<figcaption>Congruent Stimulus – The word content matches the text color.</figcaption>

If you read he words again, it might even be easier than with the neutral stimulus.

Last, let’s print the same word list again, but this time we use another text color than the color that is represented in the text. That’s an incongruent stimulus:

![Color word box - incongruent stimulus](https://dev-to-uploads.s3.amazonaws.com/i/7j0hfha6i88b1cklog4s.png)
<figcaption>Incongruent Stimulus – The word content and the text color are different.</figcaption>

Reading the colors words might feel a bit slower now. However, the Stroop effect is much more apparent, if we slightly change our task:

*Instead of reading out loud the color words, try saying the text color for each word as fast as possible!*

With the incongruent stimulus you probably need much longer now and you might even make one or the other mistake. 

And that's the Stroop effect: the delay that appears if we speak the text color out loud for the incongruent word list compared to the congruent word list.

Isn’t it fun – and really exhausting?

---

🌱 The above word lists were generated using the [stroop gem](https://github.com/paulgoetze/stroop):

```bash
stroop neutral
stroop congruent
stroop incongruent
```

with the seed: 134414671674842647560860440639024210370

*(FYI: I found this tiny stroop CLI to also be perfect for creating colorful artsy-fartsy wallpapers & online profile backgrounds* :wink:*)*