Slide 1

Slide 1 text

HACK LIKE A JOURNALIST Scott Matthewman LONDON RUBY USER GROUP • NOVEMBER 2015 Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 2

Slide 2 text

EDITORIAL JOURNALISM versus SOFTWARE DEVELOPMENT Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 3

Slide 3 text

EDITORIAL JOURNALISM versus SOFTWARE DEVELOPMENT Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 4

Slide 4 text

EDITORIAL JOURNALISM is similar to SOFTWARE DEVELOPMENT Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 5

Slide 5 text

We need to convey complex information in ways that are comprehensible Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 6

Slide 6 text

We tell stories Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 7

Slide 7 text

Programs must be written for people to read, and only incidentally for machines to execute — Harold Abelson, Structure and Interpretation of Computer Programs http://bit.ly/hlaj-abelson Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 8

Slide 8 text

How do news journalists do it? Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 9

Slide 9 text

THE INVERTED PYRAMID A template for hard news stories Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 10

Slide 10 text

Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 11

Slide 11 text

“This format is valued for two reasons… Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 12

Slide 12 text

“First, readers can leave the story at any point and understand it, even if they do not have all the details. Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 13

Slide 13 text

“Second, it conducts readers through the details of the story. — Wikipedia, Inverted pyramid http://bit.ly/hlaj-pyramid Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 14

Slide 14 text

AN EXAMPLE NEWS STORY Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 15

Slide 15 text

Joan Littlewood sculpture unveiled outside Theatre Royal Stratford East Matthew Hemley The Stage October 6, 2015 http://bit.ly/hlaj-news Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 16

Slide 16 text

A sculpture honouring theatre director Joan Littlewood has been unveiled outside Theatre Royal Stratford East. Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 17

Slide 17 text

The bronze sculpture, called The Mother of Modern Theatre, is located in Theatre Square, next to the east London venue, which Littlewood led for 26 years. It was revealed on October 4, two years after it was commissioned and in the month in which Littlewood would have turned 101. She died in 2002. Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 18

Slide 18 text

Guests who attended the unveiling included Barbara Windsor and Ian McKellen. Theatre Royal Stratford East artistic director Kerry Michael said: “The sculpture of Joan Littlewood will be a permanent reminder of her great contribution not just to British theatre, but to world theatre. We are proud of our history at Theatre Royal Stratford East and this is the perfect way to celebrate it.” The sculpture was created by Philip Jackson. In November 2013, a public fundraising campaign was launched to raise money for the sculpture. Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 19

Slide 19 text

Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 20

Slide 20 text

CLARITY LEADS TO FEWER MISTAKES Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 21

Slide 21 text

IT’S EASIER TO WORK OUT WHAT TO LEAVE OUT OR MOVE ELSEWHERE Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 22

Slide 22 text

Guests who attended the unveiling included Barbara Windsor and Ian McKellen. Theatre Royal Stratford East artistic director Kerry Michael said: “The sculpture of Joan Littlewood will be a permanent reminder of her great contribution not just to British theatre, but to world theatre. We are proud of our history at Theatre Royal Stratford East and this is the perfect way to celebrate it.” The sculpture was created by Philip Jackson. In November 2013, a public fundraising campaign was launched to raise money for the sculpture. Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 23

Slide 23 text

I THOUGHT THIS WAS A RUBY USER GROUP Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 24

Slide 24 text

Programs must be written for people to read, and only incidentally for machines to execute — Harold Abelson, Structure and Interpretation of Computer Programs http://bit.ly/hlaj-abelson Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 25

Slide 25 text

We want the code to read like a top-down narrative. — Robert C. Martin, Clean Code: A Handbook of Agile Software Craftmanship Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 26

Slide 26 text

We want every function to be followed by those at the next level of abstraction, so that we can read the program, descending one level of abstraction at a time as we read down the list of functions. I call this the Stepdown Rule. — Robert C. Martin, Clean Code: A Handbook of Agile Software Craftmanship Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 27

Slide 27 text

... [it] helps the program read like a newspaper article. — Robert C. Martin, Clean Code: A Handbook of Agile Software Craftmanship Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 28

Slide 28 text

SOME EXAMPLE RUBY CODE http://bit.ly/hlaj-rspec-example Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 29

Slide 29 text

module RSpec module Core module RubyProject def add_to_load_path(*dirs) ... Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 30

Slide 30 text

def add_to_load_path(*dirs) dirs.map { |dir| add_dir_to_load_path(File.join(root, dir)) } end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 31

Slide 31 text

def add_dir_to_load_path(dir) $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 32

Slide 32 text

def add_to_load_path(*dirs) dirs.map { |dir| add_dir_to_load_path(File.join(root, dir)) } end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 33

Slide 33 text

def add_to_load_path(*dirs) dirs.map { |dir| add_dir_to_load_path(File.join(root, dir)) } end def add_dir_to_load_path(dir) $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 34

Slide 34 text

def root @project_root ||= determine_root end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 35

Slide 35 text

def determine_root find_first_parent_containing('spec') || '.' end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 36

Slide 36 text

def find_first_parent_containing(dir) ascend_until { |path| File.exist?(File.join(path, dir)) } end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 37

Slide 37 text

def ascend_until fs = File::SEPARATOR escaped_slash = "\\#{fs}" special = "_RSPEC_ESCAPED_SLASH_" project_path = File.expand_path(".") parts = project_path.gsub(escaped_slash, special) .squeeze(fs).split(fs).map do |x| x.gsub(special, escaped_slash) end until parts.empty? path = parts.join(fs) path = fs if path == "" return path if yield(path) parts.pop end end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 38

Slide 38 text

def root @project_root ||= determine_root end def determine_root find_first_parent_containing('spec') || '.' end def find_first_parent_containing(dir) ascend_until { |path| File.exist?(File.join(path, dir)) } end def ascend_until fs = File::SEPARATOR escaped_slash = "\\#{fs}" special = "_RSPEC_ESCAPED_SLASH_" project_path = File.expand_path(".") parts = project_path.gsub(escaped_slash, special).squeeze(fs).split(fs).map do |x| x.gsub(special, escaped_slash) end until parts.empty? path = parts.join(fs) path = fs if path == "" return path if yield(path) parts.pop end end Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 39

Slide 39 text

Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 40

Slide 40 text

Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 41

Slide 41 text

While this sounds simple, it is difficult to execute in the field because of the avalanche of information that one has to process. So sift through the unnecessary bits to zero in on the most relevant and the most important. — Dev Sukumar, Using the inverted pyramid to write an article http://bit.ly/hlaj-using-pyramid Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 42

Slide 42 text

Or, in other words… Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 43

Slide 43 text

HACK LIKE A JOURNALIST Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 44

Slide 44 text

Other principles where we can learn from each other » Code review & sub-editing » Being your own subeditor » Style guides as living documents » and more… https://scottmatthewman.github.io Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 45

Slide 45 text

QUESTIONS? Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com

Slide 46

Slide 46 text

THANK YOU scottmatthewman.github.io matthewman.net • @scottm altmetric.com • @altmetric • @AltmetricDev Scott Matthewman / @scottm / @altmetric / @AltmetricDev / scottmatthewman.github.io / altmetric.com