Slides
Next: Objects >>

The CPU is a Honey Badger

Honey Badger Don't Care

honey badger don't care

  • To a computer, it's all ones and zeros
  • Abstractions make your code make sense to humans

Tiers of Abstraction

  • Variables

    • give a name to a chunk of data
  • Functions

    • give a name to a chunk of code
    • encapsulate input, output, and local variables

Data Tiers

  • Structs

    • put several pieces of related data together
  • Data Structures

    • List, Stack, Queue, Hash, Tree, Heap

Code Tiers

  • Closures
    • function plus scope of defining function
    • allow several chunks of code to share state

Combining Code & Data

  • Objects

    • encapsulate data and behavior
    • allow several chunks of code to share extra state
  • Classes

    • reuse code and data for different instances

Other Abstractions

  • Immutability

    • values (like variables that you can't modify)
    • adding this constraint can make your code simpler and more scalable
  • More...?

comments powered by Disqus