Referential Transparency — Programming Word of the Day

5 years ago
Anonymous $oIHRkISgaL

https://medium.com/background-thread/referential-transparency-programming-word-of-the-day-afc31101488c

I usually don’t wear a watch, but recently I found a watch I got as a gift at the bottom of my closet. I dusted it off, went to a watch repair shop to change the battery, and it’s ticking again. Wearing it for a few days, I noticed a really good advantage of wearing a watch: you can tell the time! Right now you are probably thinking “Are you kidding me?” and I’m not! By this point I’m used to pulling out my phone and waiting for it to wake up to tell me what time it is. It actually shocked me how cool it is to just glimpse at your wrist and instantly know that it’s 9:15 AM.

I realized another thing about watches. Every time you look at them, it shows a different time. At this point your eyes are probably rolling so hard that they’re about to pop out of your eye sockets, but this very obvious fact is the crux of what we’re talking about today. Watches are useful precisely because they time is constantly changing, and whenever you look at them they tell you the current time.