SlideShare una empresa de Scribd logo
1 de 73
Descargar para leer sin conexión
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

Más contenido relacionado

Destacado

10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان10 صفحه از سمفونی مردگان
10 صفحه از سمفونی مردگان
qoqnoos
 

Destacado (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 a Extracting wisdom from stupidity

Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01Letshavesomepun 140616032650-phpapp01
Letshavesomepun 140616032650-phpapp01
Chris Yukna
 
Observation & Inference
Observation & InferenceObservation & Inference
Observation & Inference
treothe
 
Writing for TAKS and STAAR
Writing for TAKS and STAARWriting for TAKS and STAAR
Writing for TAKS and STAAR
ccaviness
 
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
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
Yasir Khan
 
Midton college ppt
Midton college pptMidton college ppt
Midton college ppt
Ashok 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
 
Chapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online StudChapter 8 Psych 1 Online Stud
Chapter 8 Psych 1 Online Stud
Mosslera
 
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
 

Similar a 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
 

Último

KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
Cara Menggugurkan Kandungan 087776558899
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
brynpueblos04
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
vikas rana
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka
call Now 9811711561 Cash Payment乂 Call Girls in Dwarkacall Now 9811711561 Cash Payment乂 Call Girls in Dwarka
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka
vikas rana
 

Último (14)

KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
 
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
Call Girls In Mumbai Just Genuine Call ☎ 7738596112✅ Call Girl Andheri East G...
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptx
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka
call Now 9811711561 Cash Payment乂 Call Girls in Dwarkacall Now 9811711561 Cash Payment乂 Call Girls in Dwarka
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 

Extracting wisdom from stupidity