Slide 1

Slide 1 text

Computer Science: The Good Parts csthegoodparts.com @jeffcohen

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

1. Encoding All The Things 2. Containers for Things 3. Doing Things 4. Building Big Things 5. Thinking About Things

Slide 5

Slide 5 text

Data Structures

Slide 6

Slide 6 text

Data Structures

Slide 7

Slide 7 text

Linked List 60 31 5 45 70 head

Slide 8

Slide 8 text

Queue New elements are appended to the end of the list 60 31 5 45 70 head

Slide 9

Slide 9 text

Stack 60 45 70 31 5 head New elements are inserted at the front of the list

Slide 10

Slide 10 text

60 31 5 45 80 70 74 99 87 68 Binary
 Tree root

Slide 11

Slide 11 text

Graph

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Algorithms

Slide 16

Slide 16 text

Babbage and Lovelace

Slide 17

Slide 17 text

Apollo 11

Slide 18

Slide 18 text

Margaret Hamilton Source code of the Apollo Guidance Computer

Slide 19

Slide 19 text

Complexity

Slide 20

Slide 20 text

Complexity Some computer programming implementations are more complex than others.

Slide 21

Slide 21 text

Complexity A "green" test suite is not an indicator of sustainability nor is it a guarantee of an optimal solution.

Slide 22

Slide 22 text

Complexity Science relies on standard systems of weights and measures. For software, we measure resources, which are typically time and space.

Slide 23

Slide 23 text

O(n) def search(name_to_find, names) for name in names if name == name_to_find return true end end return false end

Slide 24

Slide 24 text

def search(name_to_find, names) for name in names if name == name_to_find return true end end return false end O(n) 0 100 200 300 O(n)

Slide 25

Slide 25 text

O(log n) def search(name_to_find, sorted_names) 
 return false if sorted_names.size == 0 
 midpoint = sorted_names.length / 2 
 
 if name < sorted_names[midpoint].name 
 search(name_to_find, sorted_names[0, midpoint]) 
 elsif name > sorted_names[midpoint].name
 search(name_to_find, sorted_names[midpoint, -1]) end return true
 end

Slide 26

Slide 26 text

def search(name_to_find, sorted_names) 
 return false if sorted_names.size == 0 
 midpoint = sorted_names.length / 2 
 
 if name < sorted_names[midpoint].name 
 search(name_to_find, sorted_names[0, midpoint]) 
 elsif name > sorted_names[midpoint].name
 search(name_to_find, sorted_names[midpoint, -1]) end return true
 end O(log n) 0 100 200 300 O(log n) O(n)

Slide 27

Slide 27 text

Atom.io blog post

Slide 28

Slide 28 text

O(n2) def all_permuations(items) items.map do |item| items.map { |inner_item| [item, inner_item] } end end [1,2,3] => [[1,1], [1,2], [1,3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]

Slide 29

Slide 29 text

def all_permuations(items) items.map do |item| items.map { |inner_item| [item, inner_item] } end end O(n2) 0 100 200 300 O(n2) O(n) O(log n)

Slide 30

Slide 30 text

Cryptography

Slide 31

Slide 31 text

Cryptography

Slide 32

Slide 32 text

Cryptography

Slide 33

Slide 33 text

Cryptography

Slide 34

Slide 34 text

The Future

Slide 35

Slide 35 text

Traditions We know our history. We value progress over reinvention. We seek solutions to meaningful problems.

Slide 36

Slide 36 text

Alan Turing

Slide 37

Slide 37 text

Alan Turing Computer science
 is not
 computer programming

Slide 38

Slide 38 text

Alan Turing It's a way of thinking

Slide 39

Slide 39 text

Grace Hopper

Slide 40

Slide 40 text

Grace Hopper

Slide 41

Slide 41 text

Grace Hopper Humans are allergic to change. They love to say, "We've always done it this way." I try to fight that.
 
 That's why I have a clock on my wall that runs counter-clockwise.

Slide 42

Slide 42 text

Grace Hopper A ship in port is safe; but that is not what ships are built for. Sail out to sea and do new things.

Slide 43

Slide 43 text

Questions? Thoughts? Find me on twitter @jeffcohen Notes, Links, Resources: csthegoodparts.com