Document your Development
Code
Copyright 2015. Jyaasa Technologies. http://jyaasa.com
http://jyaasa.com
Namaste !
I am Kapil Raj Nakhwa.
I am a Ruby enthusiast working
at Jyaasa Technologies !
Copyright 2015. Jyaasa Technologies.
1.
Documentations ..
you hate it.
“
http://jyaasa.com
If it is not documented, It does not exist. As long
as the information is stored in someone’s head,
it is vulnerable to loss.
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Traditional Software Development Says...
oDocumentation helps Software Development
oDocumentation helps maintain Software Quality
oDocumentation makes it easy to Transfer Projects
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Well, Screw it...
oKnow Your code
oLiterate your fellow programmers
oRemove accidental redundancies
oReduce overall development time
oHand over the project
Copyright 2015. Jyaasa Technologies.
“
http://jyaasa.com
You either know how to program and code, and
commenting is part of that, or you don’t. Either your
team knows some or doesn’t
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
oGreat way to solidify Ruby fundamentals
oMany prominent Rubyists and core contributors have
started out this way
Why You Should?
http://jyaasa.com
ordoc
oyard
oTomdoc
oSdoc
oDocumentup
orspec_api_doc
oapipie-rails
oAjax-rdoc
Awesomeness in our Toolbox...
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
ogem install yard
oyard doc
oyard server
oyard -help
Picking easiest one Yard
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
oyard server –reload
ohttp://www.rubydoc.info/
oTemplates : https://github.com/lsegal/yard/wiki/Templates
oExtend: http://yardoc.org/guides/extending-yard/writing-
handlers.html
oAwesome Tools:
oyard-blame https://github.com/lsegal/yard-blame
oyard-stick https://github.com/dkubb/yardstick
Why Yard?
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Why Yard Meta Data Formatting
Available Tags:
http://www.rubydoc.info/gems/yard/file/docs/Tags.md#List_of_
Available_Tags
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Compared to rdoc
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
In Yard
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
class MyWebServer
# Handles a GET request
# @param request [Request] the request object
# @return [String] the resulting webpage
def get(request) "hello" end
# Handles a POST request
# @note This method may modify our application state!
# @param (see #get)
# @return (see #get)
def post(request) self.state += 1; "hello" end
end
A documented class
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
--query 'has_tag?(:api) && tag(:api).text == "public"'
yard gems
yard server --gems
yard graph --protected --full --dependencies
Use Cases
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
You like Class Diagrams?
Have you ever generated one?
Do you know what it is?
Copyright 2015. Jyaasa Technologies.
http://jyaasa.comCopyright 2015. Jyaasa Technologies.
http://jyaasa.comCopyright 2015. Jyaasa Technologies.
http://jyaasa.com
brew install graphviz
gem install yard
yard -n
yard graph --dependencies | dot -Tpdf -o app_diagram.pdf
I Used magick to generate those! Here’s
the Spell:
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Beside code docs. Educate yourself and
your team
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Beside code docs
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Beside code docs
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Beside code docs
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Beside code docs
Copyright 2015. Jyaasa Technologies.
http://jyaasa.com
Final Words...
Don’t be an asshole. Always document your code.
Copyright 2015. Jyaasa Technologies.
Search First
Reuse
Implement
Literate
Programming
PROCESS IS
EASY
http://jyaasa.com
Thank You for listening!
Questions?
Find me on Twitter @xecutioner303
or hit me kapil@jyaasa.com
Copyright 2015. Jyaasa Technologies.

Document Your Development Code