Why Computers Can't Count Sometimes

Why Computers Can't Count Sometimes

Sometimes, numbers on sites like YouTube and Twitter jump up and down; subscriber counts lag, like-counts bounce all over the place. Why is it so hard for computers to count? To answer that, we need to talk about threading, eventual consistency, and caching.

Thanks to my proofreading team, and to Tomek on camera!

The Cambridge Centre for Computing History: http://www.computinghistory.org.uk/

I’m at http://tomscott.com
on Twitter at http://twitter.com/tomscott
on Facebook at http://facebook.com/tomscott
and on Instagram as tomscottgo

50 Comments

  1. Kitty Cat on December 14, 2019 at 7:22 pm

    Put 69 on the thumbnail you coward



  2. Cody Nemo on December 14, 2019 at 7:25 pm

    There’s gotta be a solution to this though.
    Like…. my engineer side is screaming internally at how ineffectual this is.



  3. John Taylor on December 14, 2019 at 7:26 pm

    I’m watching this in a massive magazine..



  4. Forrest C. Adcock on December 14, 2019 at 7:29 pm

    So what you’re saying is that 473 people may not have downvoted this video… Good.



  5. workniniraq on December 14, 2019 at 7:29 pm

    Sooooo…did you play Frogger???



  6. Spacedestructor on December 14, 2019 at 7:30 pm

    actually based on experience that me and a developer friend of me had with the twitter api it is prety resonably to assube that it keeps at least some of the chaches for 15 minutes or more because thats the time it can take the api to update the output it gives if you are not an important person that is using the api



  7. Jared DiScipio on December 14, 2019 at 7:31 pm

    67, 68…



  8. Adam Bainbridge on December 14, 2019 at 7:31 pm

    @3:14 – 1701.
    Noted.
    Like given.



  9. Ribeye Robert D on December 14, 2019 at 7:32 pm

    This is interesting stuff.
    I’m sure a lot of people understand their world a little better thanks to you and the team.



  10. m Candelaria on December 14, 2019 at 7:32 pm

    My eyes: see 67 and 68
    Me: ah yes, it’s all coming together now



  11. studio48nl on December 14, 2019 at 7:33 pm

    Thank you. This should be basic knowledge these days…
    But no… just enlarge the connection pool from 10 to 1000… hey, now the database is the problem…? DBA, you suck (usually me trying to explain the above, but now I can send this video)!



  12. Blue on December 14, 2019 at 7:35 pm

    Dow is that why sometimes YouTube videos say 1 view but like 1.8k likes?



  13. Lariana-Chan Gaming on December 14, 2019 at 7:38 pm

    FOOL! I am on my laptop



  14. Grape Juse on December 14, 2019 at 7:38 pm

    Just put the stuff in a synchronized block ease pease



  15. Charaf eddine Zabakh on December 14, 2019 at 7:39 pm

    i needed 69 on the thumbnail 😭



  16. Dan3a on December 14, 2019 at 7:41 pm

    This looks like a very nice place



  17. David barnes stuff 2 on December 14, 2019 at 7:42 pm

    According to my TRS-80 model 100, you haven’t been born yet.



  18. δτ on December 14, 2019 at 7:44 pm

    So as long as I am looking at these counts, I will see one cached value after another, and sometimes it happens that I go from a more recent value to an older one?



  19. Felix Rewer on December 14, 2019 at 7:46 pm

    The tweet was just okay.



  20. ZLDL on December 14, 2019 at 7:47 pm

    "Math" 🤮



  21. THE_KRAKEN on December 14, 2019 at 7:49 pm

    3:14 NCC-____



  22. Afrid mohammad on December 14, 2019 at 7:52 pm

    Now I understand why the video quality drops at 5:10.



  23. GoodTimes Gaming on December 14, 2019 at 7:53 pm

    When nobody talks about the fact that atari frogger is playing in the background



  24. Chaos Reigns on December 14, 2019 at 7:54 pm

    I figured there was some amount of estimation involved. Like, we’ve only gotten updates from 5% of the servers in the last minute, so we’ll guess that the other 95% got the same amount of hits in that time as the ones we’ve heard from. Which would easily cause fluctuation.



  25. Un Limon on December 14, 2019 at 7:55 pm

    “Overgrown calculators”
    Never have I hated words so much but accepted them



  26. TR1P on December 14, 2019 at 7:55 pm

    The thumbnail was almost great



  27. CJ Marland on December 14, 2019 at 7:55 pm

    Did just subscribe to your channel to increase your subscriber numbers from 1.95 million to 1.92 million, you’re welcome



  28. Luis Hernandez on December 14, 2019 at 7:55 pm

    Let’s hope to God this doesn’t happen with banking systems.



  29. Tom Scott on December 14, 2019 at 7:57 pm

    This was a really difficult script to write! Folks who know ‘eventual consistency’ as a more formal term may be annoyed that I’m using it a bit loosely here. Hopefully this works as an explainer for folks who are new to it, though!



  30. Pete Rondeau on December 14, 2019 at 8:00 pm

    Everything will be Ok in the end. If it’s not OK, it’s not the end.



  31. The Assassin on December 14, 2019 at 8:01 pm

    For the thumbnail we were on the verge of greatness we were this close



  32. Jake Verde on December 14, 2019 at 8:02 pm

    Huh, so that’s why my comments keep disappearing randomly, stupid computers.



  33. daniel coffey on December 14, 2019 at 8:03 pm

    1:30 More details on the recipe please.



  34. Jay Ramsey on December 14, 2019 at 8:05 pm

    This reminds me of the tinfoil hat people who post videos of themselves liking conspiracy videos, then reloading the page to claim that their like/view wasn’t counted. Which is, of course, another conspiracy involving YT attempting to "hide the truth".



  35. Paulo Jose Castro on December 14, 2019 at 8:05 pm

    Poor programmers, they kept making up things for users impossible demands



  36. Vivek Acharya on December 14, 2019 at 8:06 pm

    The views are frozen



  37. Church of Claus on December 14, 2019 at 8:09 pm

    Tom, how did u learn this?



  38. Pice of Rock Ricksinberg burrito on December 14, 2019 at 8:09 pm

    67, 68, *69* *NICE*



  39. Jacob Howie on December 14, 2019 at 8:09 pm

    5:02 *police sirens*
    Tom what did you do



  40. Sachin Nair on December 14, 2019 at 8:09 pm

    Knock knock
    Multithreading
    Who’s there



  41. mathis8210 on December 14, 2019 at 8:10 pm

    And then there are the cases where thousands of dislikes just disappear forever, whenever some company fucks up, but has a good standing with the tech companies…



  42. Rahul Khandelwal on December 14, 2019 at 8:11 pm

    This channel is lit 🔥🔥



  43. Andres No on December 14, 2019 at 8:16 pm

    My cruise control skips the number "70" sometimes….



  44. Louis Cowell on December 14, 2019 at 8:16 pm

    …’math’?



  45. Michael Wilkes on December 14, 2019 at 8:17 pm

    Eventual consistency is far from ‘basic’.



  46. uwu vision on December 14, 2019 at 8:17 pm

    I was just here hoping that the 67 and 68 in the thumbnail would become 69 in the video.



  47. real cartoon girl on December 14, 2019 at 8:18 pm

    youtube comments be like
    wHy iS tHeRe 100 liKeS wHeN oNlY 3 pErSoN viEwEd iT???1?1?!1!



  48. Otto 910 on December 14, 2019 at 8:18 pm

    *Sees thumbnail*
    Me: We were on the verge of greatness…



  49. Emil Sørensen on December 14, 2019 at 8:19 pm

    It strikes me as incredibly energy-inefficient to update viewcounts this often for this many people. Why doesn’t it just update once per minute? Or five minutes? Would people be unable to use Twitter if you didn’t get view counts until an hour had passed?



  50. Pat Rick on December 14, 2019 at 8:19 pm

    Still awaiting for them to give me my 100 million subscribers