Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

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

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

Andrew Radev

March 30, 2013
Tweet

More Decks by Andrew Radev

Other Decks in Programming

Transcript

  1. Vim

  2. Vim

  3. man

  4. # Returns the name # of the first day #

    of the week def a return bb[1] end
  5. 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
  6. # 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
  7. 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
  8. 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.
  9. Имплементация • Repo • repo.url('lib/foo.rb') • tags • ctags_reader •

    Renderer • Ctags filename link → → • Ripper.lex • ObjectRegex
  10. Заслужава ли си? • Библиотеки • Open Source • 3-ма

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