SlideShare a Scribd company logo
THE STORY OF A RAFFLER
Extracting wisdom from stupidity
About me
Ramon de la Fuente
Future500 B.V.
@f_u_e_n_t_e
SweetlakePHP
–Edward de Bono
“The purpose of the book has been to shift
attention from the problems themselves to the
way the mind tackles them”
Stupidity
The words "stupid" and "stupidity" entered the
English language in 1541. Since then, stupidity
has taken place along with "fool," "idiot,"
"dumb," "moron," and related concepts as a
pejorative appellation for human misdeeds,
whether purposeful or accidental, due to absence
of mental capacity.
Stupidity is a quality or state of being stupid, or
an act or idea that exhibits properties of being
stupid.
Code experiment
• 1. Write throw-away code
• 2. That performs some function
• 3. Wait, what??
Domcode Raffler Rules
• 1. Accept a filename as the first CLI argument.
• 2. The file will contain a n delimited list of names
• 3. Echo a single random name from the list
–Johnny Appleseed
“Type a quote here.”
Code experiment
• 1. Write a raffler
• 2. Using every “array_” function in PHP
• 3. Exactly once
Insight
Sequential
Strategic
Logical Thinking Lateral Thinking
Logical Thinking Lateral Thinking
A
B
C
A
B
C
Y
Logical Thinking Lateral Thinking
A
B…Y
Z
A
Z
C
Y
Evolution
Evolution
Evolution
Evolution
–Matt Groening
The Six Stages of Debugging
1. That can't happen.
2. That doesn't happen on my machine.
3. That shouldn't happen.
4. Why is that happening?
5. Oh, I see
6. How did that ever work?
The Six Stages of Debugging
1. That can't happen.
2. That doesn't happen on my machine.
3. That shouldn't happen.
4. Why is that happening?
5. Oh, I see
6. How did that ever work?
• It forces you to plan before you code.
• It virtually eliminates coder's block.
• Writing Unit tests will improve the design.
Test Driven Development?
Scenario: Starting a game
Given the dictionary provides "coconut"
When I start a game using the dictionary
Then there should be 11 guesses available
And the revealed word should be "_______"
Test Driven Development?
Scenario: Starting a game
Given the dictionary provides "coconut"
When I start a game using the dictionary
Then there should be 11 guesses available
And the revealed word should be "_______"
Test Driven Development?
Scenario: Starting a game
Given the dictionary provides "coconut"
When I start a game using the dictionary
Then there should be 11 guesses available
And the revealed word should be "_______"
Test Driven Development?
Problem Solving
Problem Solving
Problem Solving
Better solution
Problem Solving
Barely working solution
Problem Solving
Better solution
Problem Solving
Barely working solution
Problem Solving
Problem Solving
✓ ✗✓
Problem Solving
Problem Solving
Problem Solving
Problem Solving
SINGLETONS
GOTO
SERVICE LOCATOR
Problem Solving
SINGLETONS
GOTO
SERVICE LOCATOR
Problem Solving
Problem Solving
Problem Solving
Problem Solving
Problem Solving
–Edward de Bono
“Excellent thinking is of no use if based on an
incorrect assumption”
Problem Solving
You solve a Rubik’s Cube layer by layer,
by applying fixed sequences of moves,
leaving previously solved layers intact.
Problem Solving
You solve a Rubik’s Cube layer by layer,
by applying fixed sequences of moves,
leaving previously solved layers intact.
a programming problem
general patterns
Building a Raffler
Building a Raffler
Building a Raffler
Building a Raffler
• Separate by return value
• Add complexity score
• Group similar functions together
• Create composable blocks
Building a Raffler
Building a Raffler
Building a Raffler
/* returns original array */
.
Building a Raffler
Building a Raffler
Building a Raffler
Building a Raffler
Building a Raffler
Relevance?
Relevance?
“…do I use this interface, or not?”
– Senior developer
Relevance?
“…do I use this interface, or not?”
– Junior developer
Relevance?
“…I don’t understand how this can happen”
“…how could I make this happen??”
Further reading
“Experience is a museum for mistakes”
– Edward de Bono
Feedback on Joind.in: 16863
@f_u_e_n_t_e

More Related Content

Viewers also liked

Enterprise Manager Cloud Control 12c Release 4 - Installation
Enterprise Manager Cloud Control 12c Release 4 - InstallationEnterprise Manager Cloud Control 12c Release 4 - Installation
Enterprise Manager Cloud Control 12c Release 4 - Installation
Ivica Arsov
 
كافورپوش
كافورپوشكافورپوش
كافورپوش
qoqnoos
 
Proiect POSDRU la Colegiul "Emil Negruţiu" Turda
Proiect POSDRU la Colegiul "Emil Negruţiu" TurdaProiect POSDRU la Colegiul "Emil Negruţiu" Turda
Proiect POSDRU la Colegiul "Emil Negruţiu" Turda
turdanews
 
Media i reklama - Gazeta.pl
Media i reklama - Gazeta.plMedia i reklama - Gazeta.pl
Media i reklama - Gazeta.pl
stingyinterior138
 
10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان
qoqnoos
 
Tcl menu of programmes and tools
Tcl   menu of programmes and toolsTcl   menu of programmes and tools
Tcl menu of programmes and tools
Tom Brown
 
Narradores de Javé Histórias de Minas
Narradores de Javé   Histórias de MinasNarradores de Javé   Histórias de Minas
Narradores de Javé Histórias de Minas
Adélia Nicolete
 

Viewers also liked (7)

Enterprise Manager Cloud Control 12c Release 4 - Installation
Enterprise Manager Cloud Control 12c Release 4 - InstallationEnterprise Manager Cloud Control 12c Release 4 - Installation
Enterprise Manager Cloud Control 12c Release 4 - Installation
 
كافورپوش
كافورپوشكافورپوش
كافورپوش
 
Proiect POSDRU la Colegiul "Emil Negruţiu" Turda
Proiect POSDRU la Colegiul "Emil Negruţiu" TurdaProiect POSDRU la Colegiul "Emil Negruţiu" Turda
Proiect POSDRU la Colegiul "Emil Negruţiu" Turda
 
Media i reklama - Gazeta.pl
Media i reklama - Gazeta.plMedia i reklama - Gazeta.pl
Media i reklama - Gazeta.pl
 
10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان
 
Tcl menu of programmes and tools
Tcl   menu of programmes and toolsTcl   menu of programmes and tools
Tcl menu of programmes and tools
 
Narradores de Javé Histórias de Minas
Narradores de Javé   Histórias de MinasNarradores de Javé   Histórias de Minas
Narradores de Javé Histórias de Minas
 

Similar to Extracting wisdom from stupidity

Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01Chris Yukna
 
Observation & Inference
Observation & InferenceObservation & Inference
Observation & Inferencetreothe
 
Writing for TAKS and STAAR
Writing for TAKS and STAARWriting for TAKS and STAAR
Writing for TAKS and STAARccaviness
 
Idiomatic expressions
Idiomatic expressionsIdiomatic expressions
Idiomatic expressions
majosesuarez10
 
Dramathink 2015
Dramathink 2015Dramathink 2015
Dramathink 2015
Susan Hillyard
 
Creating a narrative for ESOL level 2
Creating a narrative for ESOL level 2Creating a narrative for ESOL level 2
Creating a narrative for ESOL level 2
aliah1981
 
Uxhk2015v5
Uxhk2015v5Uxhk2015v5
Uxhk2015v5
Jennifer Fabrizi
 
Parent night in the classroom 2014
Parent night in the classroom 2014Parent night in the classroom 2014
Parent night in the classroom 2014
TaraKatz
 
Essential 55
Essential 55Essential 55
Essential 55
msstubbshammond
 
Sample online english lesson (for teacher r1)
Sample online english lesson (for teacher r1)Sample online english lesson (for teacher r1)
Sample online english lesson (for teacher r1)Mary Constant
 
Fsd Getting Your Point Across Pdg
Fsd Getting Your Point Across PdgFsd Getting Your Point Across Pdg
Fsd Getting Your Point Across Pdg
Michael Barker
 
10 ways to build your vocabulary
10 ways to build your vocabulary10 ways to build your vocabulary
10 ways to build your vocabulary
Prince Tayyab
 
Scientific english
Scientific englishScientific english
Scientific english
Trần Long
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingYasir Khan
 
Midton college ppt
Midton college pptMidton college ppt
Midton college pptAshok Idnani
 
Critical ThinkingThe Art of ArgumentPower Point Presentat.docx
Critical ThinkingThe Art of ArgumentPower Point Presentat.docxCritical ThinkingThe Art of ArgumentPower Point Presentat.docx
Critical ThinkingThe Art of ArgumentPower Point Presentat.docx
mydrynan
 
My Family Tree
My Family Tree My Family Tree
My Family Tree
Ruslana Peresada
 
Chapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online StudChapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online StudMosslera
 
Greene county etymology and morphology january 15
Greene county etymology and morphology january 15Greene county etymology and morphology january 15
Greene county etymology and morphology january 15
branzburg
 
English101 Short Refresher on Grammar.pptx
English101 Short Refresher on Grammar.pptxEnglish101 Short Refresher on Grammar.pptx
English101 Short Refresher on Grammar.pptx
eleanor baguio
 

Similar to Extracting wisdom from stupidity (20)

Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01
 
Observation & Inference
Observation & InferenceObservation & Inference
Observation & Inference
 
Writing for TAKS and STAAR
Writing for TAKS and STAARWriting for TAKS and STAAR
Writing for TAKS and STAAR
 
Idiomatic expressions
Idiomatic expressionsIdiomatic expressions
Idiomatic expressions
 
Dramathink 2015
Dramathink 2015Dramathink 2015
Dramathink 2015
 
Creating a narrative for ESOL level 2
Creating a narrative for ESOL level 2Creating a narrative for ESOL level 2
Creating a narrative for ESOL level 2
 
Uxhk2015v5
Uxhk2015v5Uxhk2015v5
Uxhk2015v5
 
Parent night in the classroom 2014
Parent night in the classroom 2014Parent night in the classroom 2014
Parent night in the classroom 2014
 
Essential 55
Essential 55Essential 55
Essential 55
 
Sample online english lesson (for teacher r1)
Sample online english lesson (for teacher r1)Sample online english lesson (for teacher r1)
Sample online english lesson (for teacher r1)
 
Fsd Getting Your Point Across Pdg
Fsd Getting Your Point Across PdgFsd Getting Your Point Across Pdg
Fsd Getting Your Point Across Pdg
 
10 ways to build your vocabulary
10 ways to build your vocabulary10 ways to build your vocabulary
10 ways to build your vocabulary
 
Scientific english
Scientific englishScientific english
Scientific english
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Midton college ppt
Midton college pptMidton college ppt
Midton college ppt
 
Critical ThinkingThe Art of ArgumentPower Point Presentat.docx
Critical ThinkingThe Art of ArgumentPower Point Presentat.docxCritical ThinkingThe Art of ArgumentPower Point Presentat.docx
Critical ThinkingThe Art of ArgumentPower Point Presentat.docx
 
My Family Tree
My Family Tree My Family Tree
My Family Tree
 
Chapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online StudChapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online Stud
 
Greene county etymology and morphology january 15
Greene county etymology and morphology january 15Greene county etymology and morphology january 15
Greene county etymology and morphology january 15
 
English101 Short Refresher on Grammar.pptx
English101 Short Refresher on Grammar.pptxEnglish101 Short Refresher on Grammar.pptx
English101 Short Refresher on Grammar.pptx
 

Recently uploaded

CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docxCHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
ngochaavk33a
 
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdfCollocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
ngochaavk33a
 
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINTSOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
ssuser8d5e2d1
 
UNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the NatureUNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the Nature
Chandrakant Divate
 
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docxÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
ngochaavk33a
 
Program Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdfProgram Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdf
Michael Herlache, MBA
 
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptxEthical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
TANMAYJAIN511570
 

Recently uploaded (7)

CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docxCHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
CHUYÊN ĐỀ READING ÔN THI HSG THPT HAY.docx
 
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdfCollocation thường gặp trong đề thi THPT Quốc gia.pdf
Collocation thường gặp trong đề thi THPT Quốc gia.pdf
 
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINTSOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
SOCIOLOGY PPT. SOCIAL SECURITY POWER POINT
 
UNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the NatureUNIVERSAL HUMAN VALUES- Harmony in the Nature
UNIVERSAL HUMAN VALUES- Harmony in the Nature
 
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docxÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
ÔN TẬP CỤM THÀNH NGỮ TIẾNG ANH CỰC HAY.docx
 
Program Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdfProgram Your Destiny eBook - Destiny University.pdf
Program Your Destiny eBook - Destiny University.pdf
 
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptxEthical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
Ethical_dilemmas_MDI_Gurgaon-Business Ethics Case 1.pptx
 

Extracting wisdom from stupidity