Be a library developer!

1,028 views

Published on

Is there a gem author around you? Did you meet any author of the gems
used? Did you contact with any author of the gems used on the
Internet?

Do you think that "the author is cool!", "the author is awesome!" or
"I respect the author!"? Do you want to be a gem author?

This talk doesn't describe about how to create a gem because it is
easy. "gem" is a package of Ruby library (, tool and so on) for easy
to install. This talk describes about developing a library that is gem
content.

This talk is based on my experience as a library developer. This talk
describes about how to write codes, how to write documents, release,
support and mental set for a better "library developer". I hope that
this talk is a trigger for increasing the number of better "library
developers".

Published in: Technology
  • Be the first to comment

Be a library developer!

  1. 1. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Be a library developer!Remember than ImagineKouhei SutouClearCode Inc.2013/06/01
  2. 2. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Table of contentsShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  3. 3. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Share the goalShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  4. 4. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8This talks goalYou knowhow to develop better softwares
  5. 5. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Better?Showby example
  6. 6. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8APIcontext.savecontext.circle(50, 50, 10)context.strokecontext.restorefrom cairo gem
  7. 7. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Pointcontext.save # <- Pointcontext.circle(50, 50, 10)context.strokecontext.restore # <- Pointfrom cairo gem
  8. 8. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Bettercontext.save docontext.circle(50, 50, 10)context.strokeendfrom cairo gem
  9. 9. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: WhyWhy is it better?
  10. 10. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: BecauseBecause itsmore Ruby-ish
  11. 11. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Ruby-ish?-ish ==Similar to others
  12. 12. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Is "similar" better?Similarity makes consistency✓Consistency makes readability✓Readability is important todevelop better softwares✓
  13. 13. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Is "readability" important?Readability makesmaintenability✓Maintenability is needed forimproving your softwaresrepeatedly✓
  14. 14. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8SoRuby-ish isbetter
  15. 15. Lets validatethe example
  16. 16. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8RememberFile
  17. 17. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Remember: File# Setupfile = File.open(path)file.read# Teardownfile.close
  18. 18. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Remember: File# SetupFile.open(path) do |file|file.readend # Teardown
  19. 19. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API (reprise)context.save # Setupcontext.circle(50, 50, 10)context.strokecontext.restore # Teardownfrom cairo gem
  20. 20. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Better (reprise)context.save do # Setupcontext.circle(50, 50, 10)context.strokeend # Teardownfrom cairo gem
  21. 21. Wrap up
  22. 22. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8BetterRuby-ish
  23. 23. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8In other wordsSimilar to others
  24. 24. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8The goal (reprise)You knowhow to develop better softwares
  25. 25. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8In other wordsYou knowwhat is "similar"and do similarly
  26. 26. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Describe key ideaShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  27. 27. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Key ideaRememberthanImagine
  28. 28. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Remember than ImagineKnowledgeRemember???ImagineEasy! Di�cult...
  29. 29. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8To remember,Remember???ImagineEasy! Di�cult...How to get?Knowledge
  30. 30. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8How to get knowledge?Experience✓Ask✓Observe✓
  31. 31. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Experience!Experience ← Do this �rst!✓Ask✓Observe✓
  32. 32. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Key ideaRememberthanImagine
  33. 33. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Apply the key ideaShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  34. 34. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8The goal (reprise)You knowhow to develop better softwares
  35. 35. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Apply the key ideaKnowledgeRememberBettersoftwares
  36. 36. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8To achieve the goal,What shouldyou experience?
  37. 37. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8What experience?KnowledgeRememberBettersoftwaresKnowledgeWhat experience?
  38. 38. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8RubyistKnowledgeRememberBettersoftwaresKnowledgeRubyist experience!
  39. 39. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Rubyist?Youexperienced!
  40. 40. Try
  41. 41. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Getterwindow.get_property("opacity")# What is better API???from gtk2 gem
  42. 42. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Getter (better)window.get_property("opacity")window.opacity # Betterfrom gtk2 gem
  43. 43. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Now,You found"remember" is"di�cult"
  44. 44. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Di�cult!Remember!?What is"Ruby-ish"!?
  45. 45. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Di�cult?KnowledgeRemember???ImagineDi�cult...Easy!Di�cult???
  46. 46. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8BecauseYou dont haveexperience about"Remember thanImagine"
  47. 47. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8No "remember" experienceBettersoftwaresKnowledgeRubyist experience!RememberNo experience
  48. 48. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Your statusExperience✓Ask (Heard) ← You are here!✓Observe✓
  49. 49. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8To achieve the goal,What shouldyou experience?
  50. 50. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8What experience?BettersoftwaresKnowledgeRubyist experience!RememberWhat experience?
  51. 51. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Library developerBettersoftwaresKnowledgeRubyist experience!RememberLibrary developer
  52. 52. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Library developerConsiders abouteasy to use APIas a Rubyist✓✓easy to understand documentas a library user✓✓
  53. 53. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Library developerConsiders themmany times
  54. 54. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8"Many times"Its very goodexercise
  55. 55. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8ExercisesAPI✓Document✓
  56. 56. API
  57. 57. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Getter (reprise)# Low levelwindow.get_property("opacity")# Betterwindow.opacityfrom gtk2 gem
  58. 58. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Better?# Low levelwindow.get_property("visible")# Better# ???: hint: "visible" is boolfrom gtk2 gem
  59. 59. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Better# Low levelwindow.get_property("visible")# Betterwindow.visible?from gtk2 gem
  60. 60. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Getter# Better for record as collectionrecord["name"]# Better for record as objectrecord.namefrom rroonga gem
  61. 61. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Initrequire "gst"# ???Gst.init # <- What?Gst::ElementFactory.make("playbin")from gstreamer gem
  62. 62. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Init (usage)require "gst"# For advanced useGst.init("--gst-debug=*:9")Gst::ElementFactory.make("playbin")from gstreamer gem
  63. 63. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Init (better)require "gst"# Make optional# Gst.initGst::ElementFactory.make("playbin")from gstreamer gem
  64. 64. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8API: Init (impl)class << Gstdef const_missing(name)init; const_get(name); enddef init(*argv)# ...initialize library...class << selfremove_method(:const_missing)end; end; endfrom gstreamer gem
  65. 65. Document
  66. 66. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Document: InstallInstall:For Debian GNU/Linux:% sudo apt-get install libgtk2.0-dev% gem install gtk2For OS X:...
  67. 67. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Document: BetterInstall:% gem install gtk2libgtk2-0-dev is installed automatically"gem install GEM_NAME" is popular install way
  68. 68. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Exercises endWe remembered about"what is similar?"✓We done "similarly"✓
  69. 69. Do you understandabout"Remember thanImagine"?
  70. 70. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Wrap upShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  71. 71. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8This talks goalYou knowhow to develop better softwares
  72. 72. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8BetterRuby-ishSimilar to others
  73. 73. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Goal: In other wordsYou knowwhat is "similar"and do similarly
  74. 74. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Key ideaRememberthanImagine
  75. 75. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Remember than ImagineKnowledgeRemember???ImagineEasy! Di�cult...
  76. 76. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8For developmentExperience Rubyist forknowledge✓Then remember the knowledgeBut it is di�cult because you donthave experience about "remember"✓✓
  77. 77. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8No "remember" experienceBettersoftwaresKnowledgeRubyist experience!RememberNo experience
  78. 78. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Experience lib developerIts very goodexercise
  79. 79. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8The next stepShare this talks goal✓Describe key idea✓Apply the key idea✓Wrap up & The next step✓
  80. 80. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8The next stepUse "library developer"experience to otherthings
  81. 81. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8For example,Use it todevelop othersoftwares
  82. 82. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Develop other softwaresYou can remember abouta better bug reportHow to reproduce?✓✓a better patchHow to commit? (size? message?)✓✓
  83. 83. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8ConclusionBe a librarydeveloper!
  84. 84. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8FYIWe accept applications aboutour internshipYou can develop a library with us✓✓
  85. 85. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Bonus tracksSimilar vs. Innovation✓No "imagine" communication✓
  86. 86. Similarvs.Innovation
  87. 87. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8InnovationDoing "similarly" will notachieve "innovation"✓Should all we aspireinnovation?✓
  88. 88. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8NoWe have regular life✓Its also important thatwe improve our regular life✓
  89. 89. No"imagine"communication
  90. 90. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8No "imagine"Show all u need from the startDont omit anything✓If you emit something,other people need "imagine"✓✓Use your experience for it!✓
  91. 91. Be a library developer! - Remember than Imagine Powered by Rabbit 2.0.8Key ideaRememberthanImagine

×