Computer Science: The Good Parts

Computer Science: The Good Parts

Kansas City Developers Conference

8217faf2bfdfa7daf10135d41ddd421e?s=128

Jeff Cohen

August 04, 2017
Tweet

Transcript

  1. Computer Science: The Good Parts csthegoodparts.com @jeffcohen

  2. None
  3. None
  4. 1. Encoding All The Things 2. Containers for Things 3.

    Doing Things 4. Building Big Things 5. Thinking About Things
  5. Data Structures

  6. Data Structures

  7. Linked List 60 31 5 45 70 head

  8. Queue New elements are appended to the end of the

    list 60 31 5 45 70 head
  9. Stack 60 45 70 31 5 head New elements are

    inserted at the front of the list
  10. 60 31 5 45 80 70 74 99 87 68

    Binary
 Tree root
  11. Graph

  12. None
  13. None
  14. None
  15. Algorithms

  16. Babbage and Lovelace

  17. Apollo 11

  18. Margaret Hamilton Source code of the Apollo Guidance Computer

  19. Complexity

  20. Complexity Some computer programming implementations are more complex than others.

  21. Complexity A "green" test suite is not an indicator of

    sustainability nor is it a guarantee of an optimal solution.
  22. Complexity Science relies on standard systems of weights and measures.

    For software, we measure resources, which are typically time and space.
  23. O(n) def search(name_to_find, names) for name in names if name

    == name_to_find return true end end return false end
  24. 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)
  25. 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
  26. 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)
  27. Atom.io blog post

  28. 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]]
  29. 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)
  30. Cryptography

  31. Cryptography

  32. Cryptography

  33. Cryptography

  34. The Future

  35. Traditions We know our history. We value progress over reinvention.

    We seek solutions to meaningful problems.
  36. Alan Turing

  37. Alan Turing Computer science
 is not
 computer programming

  38. Alan Turing It's a way of thinking

  39. Grace Hopper

  40. Grace Hopper

  41. 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.
  42. 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.
  43. Questions? Thoughts? Find me on twitter @jeffcohen Notes, Links, Resources:

    csthegoodparts.com