DEV Community

Discussion on: What is an analogy or visualization of a coding concept that really helped you understand it better?

Collapse
 
charlesdlandau profile image
Charles Landau

First things first, Julia Evans is IMO great at this. jvns.ca is her website. She writes "zines" with illustrated technical concepts, and they're great.

Anyway, the most helpful analogy I encountered as I was learning was to think of an interface like a light switch.

  • Hides complexity from the user
  • Exposes methods to the user (e.g. lightswitch.turn_on()
  • Is extensible
  • Is intuitive

Credit: I first came across this description in Data Structures and Algorithms in Python by Goodrich, Tamassia, and Goldwasser