DEV Community

Discussion on: Changelog: Reading Time Now Displayed

Collapse
 
nektro profile image
Meghan (she/her)

Cool! How is it calculated?

Collapse
 
ben profile image
Ben Halpern
  def calculate_reading_time
    word_count = @content.split(/\W+/).count
    (word_count / 275.0).ceil
  end

Contributions welcome 😄

Collapse
 
viniciuskneves profile image
Vinicius Kiatkoski Neves

Ben, just wondering, why 275 WPM?

This question came up to my mind and I decided to read a bit about it and found the following reference which recomends 200 WPM: marketingland.com/estimated-readin...

There is also this from Wikipedia where there is a nice graph with several different studies correlating WPM / age.

As I mentioned I'm just curious about the magic number (where you've found it).

Thread Thread
 
itsasine profile image
ItsASine (Kayla)

From your Wikipedia link, this caught my eye:

reading for memorization (fewer than 100 words per minute [wpm]); reading for learning (100–200 wpm); reading for comprehension (200–400 wpm); and skimming (400–700 wpm)

I'd think most here are reading for learning, to an extent. 200 WPM sounds like it'd be a good middle between learning and comprehending, though I could just be slow since I tend to read at work while I'm watching tests run.

Thread Thread
 
ben profile image
Ben Halpern

Hmm all good food for thought. We settled on this a while back and I sort of forget the exact reasoning.

We’ll make this smarter over time.

Thread Thread
 
viniciuskneves profile image
Vinicius Kiatkoski Neves

Just a tip (don’t wanna bother you with that) but usually when I get those magic numbers on my code I try to add comments linking to it. It might help future contributors to understand and think twice before updating it to another magic number hehehe
As I mentioned I was just curious about it!
Nevertheless I think it is a great feature and it might help engagement ✌️

Collapse
 
m1guelpf profile image
Miguel Piedrafita

Haven't worked with Ruby a lot, but would you be open to a PR that takes images into account?