(RubyConf 2016) Computer Science: The Good Parts

8217faf2bfdfa7daf10135d41ddd421e?s=47 Jeff Cohen
November 09, 2016

(RubyConf 2016) Computer Science: The Good Parts

My keynote talk from RubyConf 2016 in Cincinnati.

8217faf2bfdfa7daf10135d41ddd421e?s=128

Jeff Cohen

November 09, 2016
Tweet

Transcript

  1. Computer Science: The Good Parts Jeffrey Cohen
 @jeffcohen jeffcohenonline.com

  2. None
  3. Data Structures

  4. Data Structures

  5. Linked List

  6. 60 31 5 45 80 70 74 99 87 68

    Binary Tree
  7. Data Structures

  8. Graph

  9. None
  10. None
  11. None
  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 A "green" test suite is not an indicator of

    sustainability. Some implementations are more complex than others. • Time • Space
  20. O(n) def exists?(name_to_find, names) names.each do |name| return true if

    name == name_to_find end return false end
  21. def exists?(name_to_find, names) names.each do |name| return true if name

    == name_to_find end return false end O(n) 0 100 200 300 O(n)
  22. O(log n) def exists?(name_to_find, sorted_names) 
 
 midpoint = sorted_names.length

    / 2 
 return true if sorted_names[midpoint].name == name_to_find 
 if name < sorted_names[midpoint].name 
 search(name_to_find, sorted_names[0, midpoint]) 
 else 
 search(name_to_find, sorted_names[midpoint, -1]) 
 end 
 return false
 end
  23. def exists?(name_to_find, sorted_names) 
 
 midpoint = sorted_names.length / 2

    
 return true if sorted_names[midpoint].name == name_to_find 
 if name < sorted_names[midpoint].name 
 search(name_to_find, sorted_names[0, midpoint]) 
 else 
 search(name_to_find, sorted_names[midpoint, -1]) 
 end 
 return false
 end O(log n) 0 100 200 300 O(log n) O(n)
  24. Atom.io blog post

  25. O(n2) def make_combinations(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]]
  26. O(n2) def make_combinations(items) items.map do |item| items.map { |inner_item| [item,

    inner_item] } end end 0 100 200 300 O(n2) O(n) O(log n)
  27. The Future

  28. Alan Turing

  29. Alan Turing Computer science
 is not
 computer programming

  30. Alan Turing It's a way of thinking

  31. Grace Hopper

  32. Grace Hopper

  33. 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.
  34. 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.
  35. Questions? Thoughts? Find me on twitter
 @jeffcohen
 
 
 jeffcohenonline.com