Tweakers Anonymous

876 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
876
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Tweakers Anonymous

    1. 1. Tweakers Anonymous
    2. 2. Tweakers Anonymous “John”
    3. 3. Tweakers Anonymous John SJ Anderson / @genehack / dc.pm YAPC::NA 2012 ~ Madison WI
    4. 4. An elegant weapon for amore civilized age
    5. 5. Instead...• Not editor specific• Not so much “how”• More “what”• Applicable to any programmer’s editor
    6. 6. Programmer’s editor
    7. 7. Programmer’s editor• Syntax highlighting• Indentation support• Some amount of programability
    8. 8. Syntax Highlighting
    9. 9. Syntax Highlighting• Helps catch stuipd typos faster
    10. 10. Syntax Highlighting• Helps catch stuipd typos faster• Can obscure code
    11. 11. Syntax Highlighting• Helps catch stuipd typos faster• Can obscure code• Figure out to toggle it off
    12. 12. Indentation SupportWell, then get one that does do auto-indent.You cant do good work with bad tools. – Mark Jason Dominuss Good Advice #11918
    13. 13. Programmable
    14. 14. Programmable• Doesn’t need to be Turing complete
    15. 15. Programmable• Doesn’t need to be Turing complete• Although that’s nice
    16. 16. Programmable• Doesn’t need to be Turing complete• Although that’s nice• If you can select some text, send it to an external program, and get the output inserted back in, you’re good to go
    17. 17. Take-home message
    18. 18. Take-home message• Pay some attention to what you’re doing
    19. 19. Take-home message• Pay some attention to what you’re doing• Configure your environment so that most frequently done stuff can be done easily
    20. 20. Take-home message• Pay some attention to what you’re doing• Configure your environment so that most frequently done stuff can be done easily• The F keys on your keyboard are not just to skip tracks in your MP3 player
    21. 21. Take-home message• Pay some attention to what you’re doing• Configure your environment so that most frequently done stuff can be done easily• The F keys on your keyboard are not just to skip tracks in your MP3 player• Keep your configs in git – you will screw them up. This will save you.
    22. 22. Ever done this?
    23. 23. Ever done this?$ vim my_awesome_script.pl
    24. 24. Ever done this?$ vim my_awesome_script.pl# hack hack hack ; :wq
    25. 25. Ever done this?$ vim my_awesome_script.pl# hack hack hack ; :wq$ ./my_awesome_script.pl
    26. 26. Ever done this?$ vim my_awesome_script.pl# hack hack hack ; :wq$ ./my_awesome_script.plbash: ./my_awesome_script.pl:Permission denied
    27. 27. Fix your editor so this never happens againautocmd BufWritePost *.pl !chmod +x %(add-hook after-save-hook executable-make-buffer-file-executable-if-script-p)
    28. 28. Commit messages
    29. 29. Commit messages• Set up your revision control system so your commit messages are written in your preferred editor
    30. 30. Commit messages• Set up your revision control system so your commit messages are written in your preferred editor• $EDITOR, $VISUAL, $GIT_EDITOR, etc.
    31. 31. Commit messages• Set up your revision control system so your commit messages are written in your preferred editor• $EDITOR, $VISUAL, $GIT_EDITOR, etc.• Vim users may enjoy a brief moment of smugness at this point in the talk
    32. 32. Commit messages• Set up your revision control system so your commit messages are written in your preferred editor• $EDITOR, $VISUAL, $GIT_EDITOR, etc.• Vim users may enjoy a brief moment of smugness at this point in the talk• Emacs users should look into emacsclient -t
    33. 33. Code Formatting & Tidying
    34. 34. Code Formatting & Tidying• Same idea as “make executable on save”
    35. 35. Code Formatting & Tidying• Same idea as “make executable on save”• When you save a file, before it gets written, run perltidy on the file content and save the tidied version instead
    36. 36. Code Formatting & Tidying• Same idea as “make executable on save”• When you save a file, before it gets written, run perltidy on the file content and save the tidied version instead• If you don’t want to do that, you can at least configure things like trailing whitespace removeal, de-tab/en-tab, etc.
    37. 37. Syntax Checking
    38. 38. Syntax Checking• I have one trick and I use it everywhere
    39. 39. Syntax Checking• I have one trick and I use it everywhere• During file save, after the file is written out, run perl -c on it and display any errors
    40. 40. Even better:Syntax checking on the fly
    41. 41. Ill-advised live demo!
    42. 42. Even more betterest: Syntax checking and static analysis on the fly
    43. 43. Even more ill-advised demo
    44. 44. Code anddocumentation browsing
    45. 45. Code anddocumentation browsing• Emacs calls this find-file-at-point
    46. 46. Code anddocumentation browsing• Emacs calls this find-file-at-point• ffap!
    47. 47. Code anddocumentation browsing• Emacs calls this find-file-at-point• ffap!• Vim uses ‘gf’ (goto-file)
    48. 48. Auto-complete
    49. 49. Auto-complete• Can’t be done perfectly
    50. 50. Auto-complete• Can’t be done perfectly• Can be done fairly well
    51. 51. Auto-complete• Can’t be done perfectly• Can be done fairly well• Takes a lot of effort, is very fragile, and probably isn’t worth it
    52. 52. Auto-complete• Can’t be done perfectly• Can be done fairly well• Takes a lot of effort, is very fragile, and probably isn’t worth it• Really all you need is “complete based on stuff in open files”
    53. 53. Auto-complete• Can’t be done perfectly• Can be done fairly well• Takes a lot of effort, is very fragile, and probably isn’t worth it• Really all you need is “complete based on stuff in open files”• If you’re at the point where you’re messing with this, you probably need to get back to work
    54. 54. The more subtletake-home message
    55. 55. The more subtle take-home message• 5% of us care about this stuff way too much
    56. 56. The more subtle take-home message• 5% of us care about this stuff way too much• 80% of us don’t care about it nearly enough
    57. 57. The more subtle take-home message• 5% of us care about this stuff way too much• 80% of us don’t care about it nearly enough• If you’re not sure which group you fall into, you’re in the 80%
    58. 58. The more subtle take-home message• 5% of us care about this stuff way too much• 80% of us don’t care about it nearly enough• If you’re not sure which group you fall into, you’re in the 80%• 67% of statistics are made up to fill slide space
    59. 59. The more subtletake-home message
    60. 60. The more subtle take-home message• The editor is one of the tools you use the most when practicing your craft
    61. 61. The more subtle take-home message• The editor is one of the tools you use the most when practicing your craft• Spending some time to make it work better for you will let you work better too
    62. 62. The more subtle take-home message• The editor is one of the tools you use the most when practicing your craft• Spending some time to make it work better for you will let you work better too• The less friction you have around frequent operations, the more chance you have to get into flow
    63. 63. Share & enjoy• Emacs config: github.com/genehack/emacs• Vim config: github.com/genehack/genehack-vim
    64. 64. Thanks!Questions?
    65. 65. Share & enjoy• Emacs config: github.com/genehack/emacs• Vim config: github.com/genehack/genehack-vim

    ×