This document discusses the importance of code documentation and introduces YARD as a documentation tool for Ruby. It recommends documenting code for maintainability and knowledge transfer. It also provides examples of using YARD tags and generating class diagrams from code documentation.
4. “
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.
5. 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.
6. 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.
7. “
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.
8. http://jyaasa.com
oGreat way to solidify Ruby fundamentals
oMany prominent Rubyists and core contributors have
started out this way
Why You Should?
12. 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.
15. 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.
28. http://jyaasa.com
Thank You for listening!
Questions?
Find me on Twitter @xecutioner303
or hit me kapil@jyaasa.com
Copyright 2015. Jyaasa Technologies.