SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Tweakers Anonymous
       John SJ Anderson
            dc.pm
          @genehack
    genehack@genehack.org
An elegant weapon for
 a more civilized age
An elegant weapon for
 a more civilized age
But instead...
But instead...
But instead...
But instead...
• Not editor specific
But instead...
• Not editor specific
• Less about how
But instead...
• Not editor specific
• Less about how
• More about what
But instead...
• Not editor specific
• Less about how
• More about what
• Should be able to apply ideas to any
  programmer’s editor
Programmer’s editor
Programmer’s editor
• Syntax highlighting
Programmer’s editor
• Syntax highlighting
• Indentation support
Programmer’s editor
• Syntax highlighting
• Indentation support
• Programable
Syntax highlighting
Syntax highlighting
• If nothing else, this helps catch stupid typos
  faster
Syntax highlighting
• If nothing else, this helps catch stupid typos
  faster
• Can also sometimes obscure the code -- you
  may want to be able to easily toggle it on
  and off
Syntax highlighting
• If nothing else, this helps catch stupid typos
  faster
• Can also sometimes obscure the code -- you
  may want to be able to easily toggle it on
  and off
• Not to the angry fruit salad level
Syntax highlighting
• If nothing else, this helps catch stupid typos
  faster
• Can also sometimes obscure the code -- you
  may want to be able to easily toggle it on
  and off
• Not to the angry fruit salad level
• Just something that distinguishes keywords
  from variables from function names
Indentation support
Indentation support
Well, then get one that does do auto-indent.
You can't do good work with bad tools.
 -- Mark Jason Dominus's Good Advice
 #11918
Programable
Programable
• Doesn’t need to be Turing complete or
  anything crazy
Programable
• Doesn’t need to be Turing complete or
  anything crazy
• (Although you may be missing out if it isn’t.)
Programable
• Doesn’t need to be Turing complete or
  anything crazy
• (Although you may be missing out if it isn’t.)
• If you can send a selection to an external
  program and replace the selection with the
  output, you’re probably set
The generic advice
The generic advice
•   Pay some attention to what you’re doing
The generic advice
•   Pay some attention to what you’re doing
•   Set things up so stuff you do most often can be
    done most easily
The generic advice
•   Pay some attention to what you’re doing
•   Set things up so stuff you do most often can be
    done most easily
•   E.g., saving a file, closing a file, defining and running
    macros, etc. etc.
The generic advice
•   Pay some attention to what you’re doing
•   Set things up so stuff you do most often can be
    done most easily
•   E.g., saving a file, closing a file, defining and running
    macros, etc. etc.
•   The F keys are not there just so you can skip tracks
    in your MP3 player
The generic advice
•   Pay some attention to what you’re doing
•   Set things up so stuff you do most often can be
    done most easily
•   E.g., saving a file, closing a file, defining and running
    macros, etc. etc.
•   The F keys are not there just so you can skip tracks
    in your MP3 player
•   Keep your config in git so you can revert it when
    you screw it up
Ever done this?
Ever done this?
$ vim my_awesome_script.pl
Ever done this?
$ vim my_awesome_script.pl

# hack hack hack; !wq
Ever done this?
$ vim my_awesome_script.pl

# hack hack hack; !wq

$ ./my_awesome_script.pl
Ever done this?
$ vim my_awesome_script.pl

# hack hack hack; !wq

$ ./my_awesome_script.pl

bash: ./awesome_script.pl: permission denied
This is fixable:
       auto chmod +x
autocmd BufWritePost *.pl !chmod +x %


(add-hook 'after-save-hook

'executable-make-buffer-file-executable-if-script-p)
Commit messages
Commit messages
• Set up $GIT_EDITOR so you can write
  commit messages in your editor of choice
Commit messages
• Set up $GIT_EDITOR so you can write
  commit messages in your editor of choice
• emacsclient is particularly nice here:
Commit messages
• Set up $GIT_EDITOR so you can write
  commit messages in your editor of choice
• emacsclient is particularly nice here:
  export GIT_EDITOR=‘emacsclient -t’
Code Tidying
Code Tidying
• Same idea as “make executable on save”
Code Tidying
• Same idea as “make executable on save”
• When you save a file, before the write, run
  perltidy, and save the output of that instead
Code Tidying
• Same idea as “make executable on save”
• When you save a file, before the write, run
  perltidy, and save the output of that instead
• If you don’t want to do that, do the world a
  favor and set up your editor to delete trailing
  whitespace when you save a file.
Code Tidying
• Same idea as “make executable on save”
• When you save a file, before the write, run
  perltidy, and save the output of that instead
• If you don’t want to do that, do the world a
  favor and set up your editor to delete trailing
  whitespace when you save a file.
• Please.
Syntax Checking
Syntax Checking
• Beating the same one-trick pony
Syntax Checking
• Beating the same one-trick pony
• Run ‘perl -c’ after you save
Syntax Checking
• Beating the same one-trick pony
• Run ‘perl -c’ after you save
• Gripe if there are errors
Even Better:
Syntax Checking
Even Better:
Syntax Checking
   On The Fly!
Ill-advised live demo!
Even Betterest:
Syntax Checking


  On The Fly
Even Betterest:
 Syntax Checking
& Static Analysis
   On The Fly
Even more
   ill-advised
live demoing!
Code Browsing
Code Browsing
• Emacs calls this find-file-at-point
Code Browsing
• Emacs calls this find-file-at-point
• ffap!
Code Browsing
• Emacs calls this find-file-at-point
• ffap!
• With add-ons (such as PerlySense) one can
  get quite fancy
Documentation
        Browsing
• Same idea here, really
Auto-Completion
Auto-Completion
While it isn’t possible to do this perfectly,
you can get closer than you might think...
Auto-Completion
While it isn’t possible to do this perfectly,
you can get closer than you might think...
...but it might not be worth the effort
Share & Enjoy
• My editor config:
  https://github.com/genehack/emacs
Thanks!
Questions?
First Ever
DC-Baltimore Perl Workshop
       14 April 2012
        dcbpw.org

Weitere ähnliche Inhalte

Ähnlich wie Tweakers Anonymous

Ähnlich wie Tweakers Anonymous (20)

Effective text editing with vim
Effective text editing with vimEffective text editing with vim
Effective text editing with vim
 
Bug Hunting Safari
Bug Hunting SafariBug Hunting Safari
Bug Hunting Safari
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...Austin Python Learners Meetup - Everything you need to know about programming...
Austin Python Learners Meetup - Everything you need to know about programming...
 
Notes on Debugging
Notes on DebuggingNotes on Debugging
Notes on Debugging
 
Building reusable components with generics and protocols
Building reusable components with generics and protocolsBuilding reusable components with generics and protocols
Building reusable components with generics and protocols
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Message passing
Message passingMessage passing
Message passing
 
Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?
 
Continous Delivery of your Infrastructure
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your Infrastructure
 
Automating MySQL operations with Puppet
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with Puppet
 
Spaghetti gate
Spaghetti gateSpaghetti gate
Spaghetti gate
 
The 5 Minute MySQL DBA
The 5 Minute MySQL DBAThe 5 Minute MySQL DBA
The 5 Minute MySQL DBA
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
Run stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 EditionRun stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 Edition
 
Big Websites
Big WebsitesBig Websites
Big Websites
 
Opslogger: Operations code (should be) production quality too!
Opslogger: Operations code (should be) production quality too!Opslogger: Operations code (should be) production quality too!
Opslogger: Operations code (should be) production quality too!
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
DITA translatability best practices
DITA translatability best practicesDITA translatability best practices
DITA translatability best practices
 
'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast
 

Mehr von John Anderson

A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To Swift
John Anderson
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
John Anderson
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This Century
John Anderson
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
John Anderson
 
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
John Anderson
 

Mehr von John Anderson (20)

#speakerlife
#speakerlife#speakerlife
#speakerlife
 
Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)Introduction to Git (even for non-developers)
Introduction to Git (even for non-developers)
 
Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018Logs are-magic-devfestweekend2018
Logs are-magic-devfestweekend2018
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?Do you want to be right or do you want to WIN?
Do you want to be right or do you want to WIN?
 
An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)An Introduction to Git (even for non-developers)
An Introduction to Git (even for non-developers)
 
You got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & LinuxYou got chocolate in my peanut butter! .NET on Mac & Linux
You got chocolate in my peanut butter! .NET on Mac & Linux
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This Century
 
Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)Introduction to Git (even for non-developers!)
Introduction to Git (even for non-developers!)
 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
 
A Modest Introduction To Swift
A Modest Introduction To SwiftA Modest Introduction To Swift
A Modest Introduction To Swift
 
A static site generator should be your next language learning project
A static site generator should be your next language learning projectA static site generator should be your next language learning project
A static site generator should be your next language learning project
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This Century
 
A Modest Introduction to Swift
A Modest Introduction to SwiftA Modest Introduction to Swift
A Modest Introduction to Swift
 
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To YouLogs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
Logs Are Magic: Why Git Workflows and Commit Structure Should Matter To You
 
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
Friends Don't Let Friends Browse Unencrypted: Running a VPN for friends and f...
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Tweakers Anonymous

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n