Документация (RogueConf 2013)

Документация (RogueConf 2013)

Лекция, в която представям възгледите си за писането на документация и няколко мои експериментални tool-чета за улесняване на процеса по документиране на код.

Видео: http://youtu.be/0aZ0LRxuq_I

Fc59401781a26b10f5d4fc5b758fb3b7?s=128

Andrew Radev

March 30, 2013
Tweet

Transcript

  1. 2.

    Vim

  2. 3.

    Vim

  3. 6.
  4. 7.
  5. 9.

    man

  6. 16.

    # Returns the name # of the first day #

    of the week def a return bb[1] end
  7. 22.

    class RungeKutta attr_reader :h def initialize(h, f) @f = f

    @h = h.to_f end def call(x, y) k1 = h * f(x, y) k2 = h * f(x + h/2, y + k1/2) k3 = h * f(x + h, y - k1 + 2*k2) y + (1.0/6.0) * (k1 + 4*k2 + k3) end def f(*args) @f.call(*args) end end
  8. 23.

    # Implements a third-order Runge-Kutta algorithm # for finding the

    solution to an ODE. # # See http://en.wikipedia.org/wiki/Runge_kutta class RungeKutta # ... end
  9. 24.
  10. 26.

    module Sprockets # `Index` is a special cached version of

    # `Environment`. # # The expection is that all of its file system # methods are cached for the instances lifetime. # This makes `Index` much faster. This behavior # is ideal in production environments where the # file system is immutable. # # `Index` should not be initialized directly. # Instead use `Environment#index`. class Index < Base # ... end end
  11. 27.

    The basic thing you need to get asset compilation working

    is an instance of `Environment`. That class implements the rack interface, so you could simply `run Sprockets::Environment.new` and get a rack server up that serves assets. For production use, you can use the `index` method to get an `Index` object, which is read-only and therefore faster.
  12. 28.
  13. 29.

    Имплементация • Repo • repo.url('lib/foo.rb') • tags • ctags_reader •

    Renderer • Ctags filename link → → • Ripper.lex • ObjectRegex
  14. 40.
  15. 43.
  16. 46.

    Заслужава ли си? • Библиотеки • Open Source • 3-ма

    души на монолитен рейлс app • SOA, 10+ човека