On Aug 25, 2014, at 9:58 AM, Luc Coffeng <
lucco...@gmail.com> wrote:
> Hi Bob,
>
> Like Tamas, I like keeping everything in one file because it shows the narrative. Also, I'm kind of paranoid about files getting separated, so I like to have everything in one file. I can see why you as a developer want to be able to rerun code on different platforms. However, I think for most users this is not really something they will do, as most stick to one platform (or as I do, run their R code in Windows or Mac).
But even as a user, I work with Michael and Andrew on models and Michael
only uses CmdStan and Andrew only RStan.
It may not be an issue if our users all clump with collaborators on the
same platform.
> Back to the narrative argument though. I think for me, the "narrative"-thinking is kind of a habit.
Interesting. This is why I find stats papers so hard to read. They
want to tell a story rather than give definitions.
I don't think you need a narrative of how you got from where you started
to where you're at (except perhaps as a guide for the next person so they
don't make the same mistakes).
What I like is a single script that can run everything from the shell.
There's your narrative. And when I say "everything", I mean everything
from the raw data munging to the final output graph generation.
One problem doing this with a tool that runs the code as it builds the
doc is that the code may take a long time to run. It may need to be shipped
out to clusters to run experiments. So trying to shoehorn it into my LaTeX
pipeline just isn't going to work.
I do keep hearing good things about iPython notebooks. One of them being
that you can just open one and start typing and it records everything you
did to get from point A to point B. Myself, I'd rather keep refactoring until
I have a reproducible path from A to B that isn't just a record of everything
I typed into a shell or interpreter.
> I haven't enjoyed any formal coding classes, so I've never been taught to organize code in separate files. Now, I can see the benefits of doing so (e.g. I recently became aware of version control software etc). However, I've found version control to be a pain to integrate in my daily routine.
I don't think anyone learns this kind of thing in classes. You
learn software engineering more from working with others on bigger
projects. I think it's kind of like applied stats that way. Homework
is a very controlled environment compared to applied stats work (which
can span years and involve lots of feedback) and the same goes for
software engineering. The hardest thing to do in my own experience is
learn how to read others' code --- you often have to reverse engineer their
thinking and then come to appreciate doing just about everything the standard
way so there's less guesswork.
If you're finding version control to be a pain, that's just because
it's one of those "bicycle skills" to quote John Cook:
http://www.johndcook.com/blog/2012/08/01/bicycle-skills/
Once you get used to it, there's really no alternative. If you use a remote repo,
you also get backups and can easily collaborate with others. It also helps organize
your work so you don't have all the "last-weeks-version", "first-version",
"current", "no-really-current" directories that the lack of version control
tend to engender.
Using something like SVN (or Git like SVN) is pretty easy. I found the jump up
to the Git branching and development model painful, but again now feel that I can't
live without it on a project our size.
The "right" answer is very much related to what your goals are and how
many people you're working with.
> I'm not sure whether it's still within the scope of the Stan Development Team to provide a general guide on coding practices (although I'd love to see such a guide), unless they believe that Stan has specific features that require special attention, from a user-perspective. Maybe you might like to launch a poll to see what most people do, and why.
We'll do whatever we can to be helpful. I don't think Stan has any
features that differentiate it from BUGS or JAGS in terms of workflow.
- Bob