As a follow up to my last post about my simple_cache implementation, I'd like to learn about the current best practices for documenting LFE projects. I read somewhere that Robert doesn't like edoc and though I didn't try, I would imagine it's not fond of processing *.lfe files either. Can it handle the resulting *.beam instead?
Anyway, I've got a few questions.
- What's the preferred method of documenting LFE code these days?
- Are there any LFE-specific tools like edoc or Clojure's Codox or Marginalia?
- How can I programmatically access docstrings of defuns?
- Can defmodule forms include a docstring (like Clojure's ns)?
- Would there be any interest in me writing a tool like Codox to generate HTML and/or Markdown docs?
Cheers,
Eric
--
You received this message because you are subscribed to the Google Groups "Lisp Flavoured Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-flavoured-e...@googlegroups.com.
To post to this group, send email to lisp-flavo...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-flavoured-erlang.
For more options, visit https://groups.google.com/d/optout.
On Aug 17, 2015, at 12:35 PM, Robert Virding <rvir...@gmail.com> wrote:OK, I better describe my thoughts around documentation. :-)First off I am definitely not one of those say (good) code is self-documenting and doesn't need to be documented. IMAO that is stupid. That said writing good documentation is not always easy and has to be kept up to date, but this is not more of a problem than keeping your function and variable names relevant.
What I don't like is including user documentation in your code files. This I think clutters up the file and makes it harder to find and discern the actual code. You are trying to find a function definition and have to wade past pages of documentation describing how to use a function with lots of examples. This is what I object to. In my code files I want to see documentation which is relevant to me as the coder and that's all.
To be clear this doesn't mean there shouldn't be good documentation for the user, just not mixed up with the code. This what I don't like with edoc and other documentation systems. The edoc output is fine, though I prefer the standard Erlang documentation formats, but it just clutters up the source file. I have the same issue with other systems where the documentation is in the code. It also clutters up the beam files.
I also find that I very seldom use tools like help/1 to read the documentation of a function. I prefer to look in separate documentation. This is course could be due to that I haven't had such systems and so gotten used to not having them. Though this is independent of having documentation in the source files.
My question back is: what is actually our goal with the documentation? Is it actually to include the documentation in the source files? Or is this just a way to get them easily accessible to developers through help/1 or equivalent? If it's the latter then I am sure we can work out a system that will make all of us happy.But I understand that I am in minority here so something will have to be done. Though there will be a compiler option to strip the documentation out of the beam files. :-)Elixir has gone very far along these lines and built-in these documentation/support from the very beginning.Maybe my view comes from whom I feel I am developing things for, for me it is much more for production systems rather than development systems. I don't know.