SlideShare a Scribd company logo
1 of 34
Mind Like Water:
The Path to Perl Bliss


       Peter Scott
           OSCON
   Portland, OR July 2006
The Way of This Talk
    “Soft” topics
•
    Personality types and interactions
•
    Beliefs and productive behaviors
•
    Distilled wisdom of (Perl) masters
•
Questions
Not…

• What is the sound of one parenthesis
 grouping?
Not…



• If a unit test fails but it’s testing
 unused code does it block a release?
But…




• Which comes first, tests or code?
The Many Faces of Steve
             (and Bob, and Mary, and Bill, and Jane,…)

• You are not a single person, but a constellation
    of personalities unique to you
•   This is the normal condition, not a disorder
     And in no way invalidates disorders labeled after
      multiple personalities
• It is a model, of course, but a convenient one
• Each personality has different strengths,
    weaknesses, methods of learning, and goals
•   How well we understand and integrate them is
    key
Perl Personalities
• Some personalities are common
• And are dominant at different times
• Personalities we likely have in common:
      The Perl Parser
  
      The Impatient Coder
  
      The Glory Hunter
  
      The Good Samaritan
  
• Of course, YPMV
• And there are others
The Perl Parser
• A very primitive personality
• Parses code and performs simulated
  execution
• Limited stack space
   This is why we require programs to be more
    readable than perl needs
   And why variables should be declared in
    innermost scope possible
   And why functions and methods should fit in a
    screen
A Beautiful Algorithm…
for my $index ( 1 .. $pop->Count ) {

     my $head = $pop->Head( $index );
     if ( head_okay( $head ) ) {

         my $body = $pop->Body( $index );
         my $msg = quot;$headn$bodyquot;;

         if ( msg_okay( $msg ) ) {

             deliver( $msg );
         }
     }
}
A Beautiful Algorithm… Uglified
for my $index ( 1 .. $pop->Count ) {
    print quot;Fetching message: $indexnquot;;
    my $head = $pop->Head( $index );
    if ( head_okay( $head ) ) {
        print quot;Passed header check...nquot;;
        my $body = $pop->Body( $index );
        my $msg = quot;$headn$bodyquot;;
        print quot;Length: quot;, length( $msg ), quot;nquot;;
        if ( msg_okay( $msg ) ) {
            print quot;Delivering...nquot;;
            deliver( $msg );
        }
    }
}
Enter Smart::Comments
for my $index ( 1 .. $pop->Count ) {
    ###     Fetching message: $index
    my $head = $pop->Head( $index );
    if ( head_okay( $head ) ) {
        ###      Passed header check...
        my $body = $pop->Body( $index );
        my $msg = quot;$headn$bodyquot;;
        ###      Length:    length( $msg )
        if ( msg_okay( $msg ) ) {
             ###     Delivering...
             deliver( $msg );
        }
    }
}
With Syntax Coloring
for my $index ( 1 .. $pop->Count ) {
    ###     Fetching message: $index
    my $head = $pop->Head( $index );
    if ( head_okay( $head ) ) {
        ###      Passed header check...
        my $body = $pop->Body( $index );
        my $msg = quot;$headn$bodyquot;;
        ###      Length:    length( $msg )
        if ( msg_okay( $msg ) ) {
             ###     Delivering...
             deliver( $msg );
        }
    }
}
The Perl Parser
• It can actually be smarter than perl

 use constant MAX_USERS    => 54;
 Readonly my $WINDOW_WIDTH = 640;


 … “Optimized away”

• Needs to be integrated with: The Impatient
 Coder
The Impatient Coder
• Wants to code now, sees no value in
    preparation
    Loves: Impatience as a virtue, Extreme
•
    Programming
    Hates: Design, documentation, planning,
•
    meetings, teamwork
    Needs to be integrated with: The Perl
•
    Parser, The Good Samaritan
    Especially for picking identifier names
•
The Glory Hunter
• Thrives on attention
• Wants to create works of art that will be
  admired throughout history
• Dislikes sharing credit
• Needs to be integrated with: The Good
  Samaritan
The Good Samaritan
• Wants to make the world a better place for
  everyone
• Wants to be needed
• Enjoys teamwork and helping people
• Needs to be integrated with: The Impatient
  Coder, The Glory Hunter
Why Test First Took So Long
• Programmers have historically been
  dominated by the Glory Hunter personality
   Because the discipline was largely an arcane
    priesthood
   And their code was tested by other people
• Now the Good Samaritan personality is
  ascendant
• Integrating this can actually satisfy the
  Glory Hunter as well
Key Lessons
• Get to know yourselves
• Be smart enough to know when you’re not
• Negotiate and balance
   Within yourself
   On a team
• Glory Hunter conceives project and
  ensures its completion
• Good Samaritan enlists cooperation
• Impatient Coder gets the job done
• Perl Parser ensures it’s comprehensible
Mind Like Water
• Minimize the distractions
• From the mundane…
   Get your editor to do its share




  (defconst cperl-hairy t)
… to the Sublime
• Use safety nets
   Automated tests:
    http://qa.perl.org/test-modules.html
• Factor out the boring rote stuff
   Automated bootstrapping with
    module-starter
    (CPAN: Module::Starter)
   Anything repetitive likely already has a
    module for automating it
The Behavioral Cycle
• Beliefs shape Attitudes
     Especially unconscious beliefs
    Attitudes drive behaviors
•
    But it works the other way around too
•
    Behaviors change attitudes
•
    Attitudes can change beliefs
•
    We can do this consciously
•
     It’s called discipline
Productive Perl Behaviors
• Adopt best practices (wax on, wax off)
   Whether or not you believe in them
   Neatness
   Precision
• Program within your comprehension limits
   And within those of the others who must read
    your code
• Adopt large system methodologies for
 large systems
   Largeness is in what it does, not how long it is
Secrets of the Masters
    Dominus
•
    Damian
•
•   brian d foy
    chromatic
•
Excerpted Wisdom - MJD
• Programming is not (always) a matter of
    personal taste.
•   I try to read and learn things that people around
    me are not reading and learning, because that
    tends to enable me to solve the problems that
    people around me are not able to solve.
•   I find myself saying that I don’t know and that I’m
    not sure a lot more than most programmers I
    know.
•   I read a lot of code written by other people and
    think about how it was done and why.
•   It seems like an awful lot of people […] don’t
    recognize that it would be a benefit to them to
    become less ignorant.
Excerpted Wisdom - Damian
• I believe that it’s critical to work on what you
    love […] It increases my productivity
    enormously.
•   Often I simply will not admit failure […] I think
    most people throw in the towel too quickly […] I
    don’t assume a priori that something is
    impossible […] the limits in your mind are
    generally far below your actual limits.
•   Design from the users’ perspective, not from
    the implementers’. Design for the users’
    convenience, not for the implementers’.
Excerpted Wisdom - Damian
• Larry Wall has been a very important role model
    to me […] I’ve come to admire and respect his
    patience. I always want closure on a job… it’s
    been very enlightening to watch [him] leave
    things undone, and come back to them when the
    time was right.
•   I try and do something that stretches me as a
    coder [every day].
•   Why do so many people seem to think that it’s
    easier to struggle to complete a job using only
    their existing tools/knowledge/skills, rather than
    first improving [those things] and then getting the
    job done more efficiently…?
Excerpted Wisdom - brian d foy
• I work with the language the way it is instead of
    fighting it to make it more like something else […]
    Everything is the way it is for a reason. It
    doesn’t have to be a good reason, but there is a
    reason.
•   I’d rather go for the long term payoff than the
    short term satisfaction.
•   Ask more questions than you answer, and listen
    to the answer […] Don’t like the answer you get?
    Wait a week. The world will be different. Most
    things work themselves out. Don’t get impatient.
Excerpted Wisdom - brian d foy
• If I come up with a way of thinking that
  seems to work, I try to apply it to
  something else to see if it still works.
• The most puzzling thing is that people
  don’t simply try something.
• I’ve learned quite a bit from Randal. He
  pokes his head into just about everything
  and brings back whatever he learns to his
  Perl programming.
Perl is Fun
Excerpted Wisdom - chromatic
• I try to experiment with new ideas and code
    regularly.
•   I’m really picky about small details in a lot of
    ways. […] I’ve grown to rely on very consistent
    formatting. I even spend a lot of time trying to
    find good identifier names in almost-throwaway
    programs[…]
•   I find that rigorous discipline helps me keep
    good habits.
•   I appreciate how Ward Cunningham makes
    almost everything good in software look
    effortless.
Excerpted Wisdom - chromatic
• It is painful to wake up early to exercise every
    morning, at least for the first few weeks, but after
    it becomes a habit, it’s painful not to do so. The
    same goes for good development practices,
    such as testing and working in small, reversible
    steps.
•   If I need to make a big change to a system, I try
    to make the change [that way]. In part, that
    means relying on effective testing and working
    as simply as possible.
•   I wonder why it’s easier [for many other people]
    to ask, in public, “Can I do task X in this way”
    than to write a five-line program to see.
Common Wisdom
    Extend yourself; try new things
•
    Learn at every opportunity
•
    Experiment; be curious
•
    Integrate lessons from other fields
•
    Persist
•
    Use discipline to free yourself for important
•
    tasks
     Even when it appears superfluous
• Be patient
Answers

More Related Content

Viewers also liked

El Mundo De Los Copleros 2
El  Mundo De Los Copleros 2El  Mundo De Los Copleros 2
El Mundo De Los Copleros 2liliC
 
Amazing Já Vi De Tudo B
Amazing   Já Vi De Tudo BAmazing   Já Vi De Tudo B
Amazing Já Vi De Tudo BOscar Luiz Neto
 
Os Vanlindberg
Os VanlindbergOs Vanlindberg
Os Vanlindbergoscon2007
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
理財課程
理財課程理財課程
理財課程miscat
 
Decimoctava Cata
Decimoctava CataDecimoctava Cata
Decimoctava Cataagpallav
 
Xina
XinaXina
Xinatoies
 
Dbi Advanced Talk 200708
Dbi Advanced Talk 200708Dbi Advanced Talk 200708
Dbi Advanced Talk 200708oscon2007
 
12° Encontro de WebDesign (usabilidade)
12° Encontro de WebDesign (usabilidade)12° Encontro de WebDesign (usabilidade)
12° Encontro de WebDesign (usabilidade)maumoreira
 
A.R.MARK (STANDS EM FEIRAS)
A.R.MARK (STANDS EM FEIRAS)A.R.MARK (STANDS EM FEIRAS)
A.R.MARK (STANDS EM FEIRAS)marcellopollara
 
Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004enpatagoniasur
 
Data Mining Open Ap Is
Data Mining Open Ap IsData Mining Open Ap Is
Data Mining Open Ap Isoscon2007
 
Sintesis Mod2
Sintesis Mod2Sintesis Mod2
Sintesis Mod2Clota
 

Viewers also liked (20)

Dios te dice
Dios te diceDios te dice
Dios te dice
 
El Mundo De Los Copleros 2
El  Mundo De Los Copleros 2El  Mundo De Los Copleros 2
El Mundo De Los Copleros 2
 
Amazing Já Vi De Tudo B
Amazing   Já Vi De Tudo BAmazing   Já Vi De Tudo B
Amazing Já Vi De Tudo B
 
Os Vanlindberg
Os VanlindbergOs Vanlindberg
Os Vanlindberg
 
Avida
AvidaAvida
Avida
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
理財課程
理財課程理財課程
理財課程
 
Decimoctava Cata
Decimoctava CataDecimoctava Cata
Decimoctava Cata
 
Xina
XinaXina
Xina
 
Dbi Advanced Talk 200708
Dbi Advanced Talk 200708Dbi Advanced Talk 200708
Dbi Advanced Talk 200708
 
12° Encontro de WebDesign (usabilidade)
12° Encontro de WebDesign (usabilidade)12° Encontro de WebDesign (usabilidade)
12° Encontro de WebDesign (usabilidade)
 
A.R.MARK (STANDS EM FEIRAS)
A.R.MARK (STANDS EM FEIRAS)A.R.MARK (STANDS EM FEIRAS)
A.R.MARK (STANDS EM FEIRAS)
 
Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004
 
Presentations
PresentationsPresentations
Presentations
 
Data Mining Open Ap Is
Data Mining Open Ap IsData Mining Open Ap Is
Data Mining Open Ap Is
 
Sintesis Mod2
Sintesis Mod2Sintesis Mod2
Sintesis Mod2
 
ApresentaçãO11
ApresentaçãO11ApresentaçãO11
ApresentaçãO11
 
Os Souders
Os SoudersOs Souders
Os Souders
 
Apple
AppleApple
Apple
 
Os Lamothe
Os LamotheOs Lamothe
Os Lamothe
 

Similar to Mlw

Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl PracticesJay Shirley
 
Add Perl to Your Toolbelt
Add Perl to Your ToolbeltAdd Perl to Your Toolbelt
Add Perl to Your Toolbeltdaoswald
 
Bedroom To Boardroom
Bedroom To BoardroomBedroom To Boardroom
Bedroom To BoardroomJosh Williams
 
Selected Sessions from RailsConf 2007
Selected Sessions from RailsConf 2007Selected Sessions from RailsConf 2007
Selected Sessions from RailsConf 2007Jerry Richardson
 
Guerilla Usability Testing
Guerilla Usability TestingGuerilla Usability Testing
Guerilla Usability TestingAndy Budd
 
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars  Ruby Is From Venus Presentation 1Rails Is From Mars  Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1railsconf
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentChun-Wen Wang
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job EasierTonya Mork
 
Test Driven Development SpeedRun
Test Driven Development SpeedRunTest Driven Development SpeedRun
Test Driven Development SpeedRunSpeck&Tech
 
The Art of Persuasion
The Art of PersuasionThe Art of Persuasion
The Art of PersuasionAntoine Genot
 
Striving towards better PHP code
Striving towards better PHP codeStriving towards better PHP code
Striving towards better PHP codeSteve Maraspin
 
Project & Business Planning Workshop - 2008
Project & Business Planning Workshop - 2008Project & Business Planning Workshop - 2008
Project & Business Planning Workshop - 2008AIngerman
 
Innovate! - How to Walk Backwards
Innovate! - How to Walk BackwardsInnovate! - How to Walk Backwards
Innovate! - How to Walk Backwardsjpalley
 
How to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and RecognitionHow to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and Recognitionguest7c430d
 
Whats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.KeyWhats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.Keynhm taveer hossain khan
 

Similar to Mlw (20)

Better Perl Practices
Better Perl PracticesBetter Perl Practices
Better Perl Practices
 
Add Perl to Your Toolbelt
Add Perl to Your ToolbeltAdd Perl to Your Toolbelt
Add Perl to Your Toolbelt
 
Bedroom To Boardroom
Bedroom To BoardroomBedroom To Boardroom
Bedroom To Boardroom
 
Mpg Feb08 Gian Lorenzetto
Mpg Feb08 Gian Lorenzetto Mpg Feb08 Gian Lorenzetto
Mpg Feb08 Gian Lorenzetto
 
Selected Sessions from RailsConf 2007
Selected Sessions from RailsConf 2007Selected Sessions from RailsConf 2007
Selected Sessions from RailsConf 2007
 
Guerilla Usability Testing
Guerilla Usability TestingGuerilla Usability Testing
Guerilla Usability Testing
 
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars  Ruby Is From Venus Presentation 1Rails Is From Mars  Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
 
Life Hackery
Life HackeryLife Hackery
Life Hackery
 
Test Driven Development SpeedRun
Test Driven Development SpeedRunTest Driven Development SpeedRun
Test Driven Development SpeedRun
 
The Art of Persuasion
The Art of PersuasionThe Art of Persuasion
The Art of Persuasion
 
Striving towards better PHP code
Striving towards better PHP codeStriving towards better PHP code
Striving towards better PHP code
 
Fabulous Resumes
Fabulous ResumesFabulous Resumes
Fabulous Resumes
 
Project & Business Planning Workshop - 2008
Project & Business Planning Workshop - 2008Project & Business Planning Workshop - 2008
Project & Business Planning Workshop - 2008
 
Innovate! - How to Walk Backwards
Innovate! - How to Walk BackwardsInnovate! - How to Walk Backwards
Innovate! - How to Walk Backwards
 
How to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and RecognitionHow to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and Recognition
 
How to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and RecognitionHow to Effectively Utilize Rewards and Recognition
How to Effectively Utilize Rewards and Recognition
 
Whats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.KeyWhats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.Key
 
DjangoCon09: No! Bad Pony!
DjangoCon09: No! Bad Pony!DjangoCon09: No! Bad Pony!
DjangoCon09: No! Bad Pony!
 

More from oscon2007

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5oscon2007
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifmoscon2007
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Moleoscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashearsoscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swposcon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Mythsoscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholisticoscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillipsoscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdatedoscon2007
 

More from oscon2007 (20)

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Mlw

  • 1. Mind Like Water: The Path to Perl Bliss Peter Scott OSCON Portland, OR July 2006
  • 2. The Way of This Talk “Soft” topics • Personality types and interactions • Beliefs and productive behaviors • Distilled wisdom of (Perl) masters •
  • 4. Not… • What is the sound of one parenthesis grouping?
  • 5. Not… • If a unit test fails but it’s testing unused code does it block a release?
  • 6. But… • Which comes first, tests or code?
  • 7. The Many Faces of Steve (and Bob, and Mary, and Bill, and Jane,…) • You are not a single person, but a constellation of personalities unique to you • This is the normal condition, not a disorder  And in no way invalidates disorders labeled after multiple personalities • It is a model, of course, but a convenient one • Each personality has different strengths, weaknesses, methods of learning, and goals • How well we understand and integrate them is key
  • 8. Perl Personalities • Some personalities are common • And are dominant at different times • Personalities we likely have in common: The Perl Parser  The Impatient Coder  The Glory Hunter  The Good Samaritan  • Of course, YPMV • And there are others
  • 9. The Perl Parser • A very primitive personality • Parses code and performs simulated execution • Limited stack space  This is why we require programs to be more readable than perl needs  And why variables should be declared in innermost scope possible  And why functions and methods should fit in a screen
  • 10. A Beautiful Algorithm… for my $index ( 1 .. $pop->Count ) { my $head = $pop->Head( $index ); if ( head_okay( $head ) ) { my $body = $pop->Body( $index ); my $msg = quot;$headn$bodyquot;; if ( msg_okay( $msg ) ) { deliver( $msg ); } } }
  • 11. A Beautiful Algorithm… Uglified for my $index ( 1 .. $pop->Count ) { print quot;Fetching message: $indexnquot;; my $head = $pop->Head( $index ); if ( head_okay( $head ) ) { print quot;Passed header check...nquot;; my $body = $pop->Body( $index ); my $msg = quot;$headn$bodyquot;; print quot;Length: quot;, length( $msg ), quot;nquot;; if ( msg_okay( $msg ) ) { print quot;Delivering...nquot;; deliver( $msg ); } } }
  • 12. Enter Smart::Comments for my $index ( 1 .. $pop->Count ) { ### Fetching message: $index my $head = $pop->Head( $index ); if ( head_okay( $head ) ) { ### Passed header check... my $body = $pop->Body( $index ); my $msg = quot;$headn$bodyquot;; ### Length: length( $msg ) if ( msg_okay( $msg ) ) { ### Delivering... deliver( $msg ); } } }
  • 13. With Syntax Coloring for my $index ( 1 .. $pop->Count ) { ### Fetching message: $index my $head = $pop->Head( $index ); if ( head_okay( $head ) ) { ### Passed header check... my $body = $pop->Body( $index ); my $msg = quot;$headn$bodyquot;; ### Length: length( $msg ) if ( msg_okay( $msg ) ) { ### Delivering... deliver( $msg ); } } }
  • 14. The Perl Parser • It can actually be smarter than perl use constant MAX_USERS => 54; Readonly my $WINDOW_WIDTH = 640; … “Optimized away” • Needs to be integrated with: The Impatient Coder
  • 15. The Impatient Coder • Wants to code now, sees no value in preparation Loves: Impatience as a virtue, Extreme • Programming Hates: Design, documentation, planning, • meetings, teamwork Needs to be integrated with: The Perl • Parser, The Good Samaritan Especially for picking identifier names •
  • 16. The Glory Hunter • Thrives on attention • Wants to create works of art that will be admired throughout history • Dislikes sharing credit • Needs to be integrated with: The Good Samaritan
  • 17. The Good Samaritan • Wants to make the world a better place for everyone • Wants to be needed • Enjoys teamwork and helping people • Needs to be integrated with: The Impatient Coder, The Glory Hunter
  • 18. Why Test First Took So Long • Programmers have historically been dominated by the Glory Hunter personality  Because the discipline was largely an arcane priesthood  And their code was tested by other people • Now the Good Samaritan personality is ascendant • Integrating this can actually satisfy the Glory Hunter as well
  • 19. Key Lessons • Get to know yourselves • Be smart enough to know when you’re not • Negotiate and balance  Within yourself  On a team • Glory Hunter conceives project and ensures its completion • Good Samaritan enlists cooperation • Impatient Coder gets the job done • Perl Parser ensures it’s comprehensible
  • 20. Mind Like Water • Minimize the distractions • From the mundane…  Get your editor to do its share (defconst cperl-hairy t)
  • 21. … to the Sublime • Use safety nets  Automated tests: http://qa.perl.org/test-modules.html • Factor out the boring rote stuff  Automated bootstrapping with module-starter (CPAN: Module::Starter)  Anything repetitive likely already has a module for automating it
  • 22. The Behavioral Cycle • Beliefs shape Attitudes  Especially unconscious beliefs Attitudes drive behaviors • But it works the other way around too • Behaviors change attitudes • Attitudes can change beliefs • We can do this consciously •  It’s called discipline
  • 23. Productive Perl Behaviors • Adopt best practices (wax on, wax off)  Whether or not you believe in them  Neatness  Precision • Program within your comprehension limits  And within those of the others who must read your code • Adopt large system methodologies for large systems  Largeness is in what it does, not how long it is
  • 24. Secrets of the Masters Dominus • Damian • • brian d foy chromatic •
  • 25. Excerpted Wisdom - MJD • Programming is not (always) a matter of personal taste. • I try to read and learn things that people around me are not reading and learning, because that tends to enable me to solve the problems that people around me are not able to solve. • I find myself saying that I don’t know and that I’m not sure a lot more than most programmers I know. • I read a lot of code written by other people and think about how it was done and why. • It seems like an awful lot of people […] don’t recognize that it would be a benefit to them to become less ignorant.
  • 26. Excerpted Wisdom - Damian • I believe that it’s critical to work on what you love […] It increases my productivity enormously. • Often I simply will not admit failure […] I think most people throw in the towel too quickly […] I don’t assume a priori that something is impossible […] the limits in your mind are generally far below your actual limits. • Design from the users’ perspective, not from the implementers’. Design for the users’ convenience, not for the implementers’.
  • 27. Excerpted Wisdom - Damian • Larry Wall has been a very important role model to me […] I’ve come to admire and respect his patience. I always want closure on a job… it’s been very enlightening to watch [him] leave things undone, and come back to them when the time was right. • I try and do something that stretches me as a coder [every day]. • Why do so many people seem to think that it’s easier to struggle to complete a job using only their existing tools/knowledge/skills, rather than first improving [those things] and then getting the job done more efficiently…?
  • 28. Excerpted Wisdom - brian d foy • I work with the language the way it is instead of fighting it to make it more like something else […] Everything is the way it is for a reason. It doesn’t have to be a good reason, but there is a reason. • I’d rather go for the long term payoff than the short term satisfaction. • Ask more questions than you answer, and listen to the answer […] Don’t like the answer you get? Wait a week. The world will be different. Most things work themselves out. Don’t get impatient.
  • 29. Excerpted Wisdom - brian d foy • If I come up with a way of thinking that seems to work, I try to apply it to something else to see if it still works. • The most puzzling thing is that people don’t simply try something. • I’ve learned quite a bit from Randal. He pokes his head into just about everything and brings back whatever he learns to his Perl programming.
  • 31. Excerpted Wisdom - chromatic • I try to experiment with new ideas and code regularly. • I’m really picky about small details in a lot of ways. […] I’ve grown to rely on very consistent formatting. I even spend a lot of time trying to find good identifier names in almost-throwaway programs[…] • I find that rigorous discipline helps me keep good habits. • I appreciate how Ward Cunningham makes almost everything good in software look effortless.
  • 32. Excerpted Wisdom - chromatic • It is painful to wake up early to exercise every morning, at least for the first few weeks, but after it becomes a habit, it’s painful not to do so. The same goes for good development practices, such as testing and working in small, reversible steps. • If I need to make a big change to a system, I try to make the change [that way]. In part, that means relying on effective testing and working as simply as possible. • I wonder why it’s easier [for many other people] to ask, in public, “Can I do task X in this way” than to write a five-line program to see.
  • 33. Common Wisdom Extend yourself; try new things • Learn at every opportunity • Experiment; be curious • Integrate lessons from other fields • Persist • Use discipline to free yourself for important • tasks  Even when it appears superfluous • Be patient