Hi !

First of all, thanks to you (and to others as well, I will not repeat the
many thanks I would like to write everywhere in the thread !) for the
detailed answer.

Definitely food for thought !

2010/7/20 j-g-faustus <johannes.fries...@gmail.com>

> I haven't tried CCW, but I am happy with Enclojure 6.8. (In 6.9 the
> file navigator which lists the functions and vars in the file doesn't
> work yet, and the navigator is perhaps 50% of the value I derive from
> an IDE.)
>
> > Am 19.07.2010 um 20:50 schrieb Laurent PETIT:
> > > If you work from the files, then you simply do not save the files until
> you're "happy" with the codebase.
>
> I wouldn't want to have the REPL autoload anything just because I save
> a file, simply because most of the files I am editing are in a broken
> state most of the time, and could stay that way for days.
>

Wow, if you can work efficiently by having broken files saved for several
days in your code base, and effectively work out the situation, you're way
smarter than me !

I generally try to keep my files in a good shape at the end of a coding
session, because my RAM is limited.
This generally invokes either placing the wrong things within single line
comments, or the (comment ) form, or (sometimes) the new definition
immediately followed by the old definition (so that reloading the ns
eventually loads the old definition).
And generally, I also write a comment to remind me of what I was trying to
achieve (ok, not always doing this one, and always regretting so).

Now, if the "automatic reload" tries to reload a broken namespace, the
reload will stop at the first compilation error. You'll have an error marker
in the source code to indicate where things start to go wrong.

I simply cannot (yet) understand how "bad" it is for the REPL. I certainly
need more "use case" examples to really grasp the annoyance pointed out by
you, Chas, etc. Having this use cases in mind will help me build a better
IDE, so please don't hesitate !



> Saving is something I do out of habit, because I'm going out for
> lunch, because I want access to the files from another tool (backup,
> version control, move to different editor or computer, whatever).
> I'm thinking of "save" as "save the text in this file" rather than
> "recompile and reload everything", I don't want "save" to give me
> exception stacktraces and a boatload of warnings.
>
> I once used a Java IDE that tried to recompile the project every time
> I saved. I never got used to that either and found it a constant
> nuisance. And it's even worse in a REPL-based language where a reload
> may mess up carefully arranged global state.
>
>
> I'm working similarly to Meikel, using the REPL for testing of simple
> draft/mock functions and using "evaulate expression" at least as often
> as "load file" - the file as a whole is broken and won't load, but I
> just finished this particular function and want to test it.
>
> I normally start out with a sketch or skeleton of the whole project,
> with multiple files and lots of partial drafts, and fill out the
> details over time (days or weeks).
> Being able to finish and test functions one by one is one of the great
> benefits of REPL-based development IMHO. I wouldn't want anything that
> forces me to have every file in a loadable state all the time.
>

I don't think you deliberately leave your namespaces in non loadable states.
Do you ?

Oh, maybe I understand: by "partial drafts", you mean "pseudo-code",
directly written in clojure, is it this ?

If there was a shortcut key to quickly wrap/unwrap a top level defn with
(comment), and if the keyboard shortcut for "evaluate top level form in the
REPL" would be smart enough to detect top level comment and send to the REPL
the unwrapped form, would it help you ?
That way, your files would visually show the "pseudo-code" parts (those
within comments), and your namespaces will remain in a loadable shape,
eventually relieving you from manually load your project "piece by piece"
every time you must restart a REPL ?


> Perhaps relatedly, someone doing a usability study of how newspapers
> journalists work told me that journalists (at least the ones she were
> studying) didn't write articles by starting at the beginning and
> finishing at the end.
> Instead they wrote down snippets, sentence fragments, nifty turns of
> phrase etc. in whatever order they happened to think of them, spread
> the fragments out on the screen and copy/pasted the parts together to
> assemble a complete article.
> According to her this was a surprisingly efficient way of working,
> they could finish an article in no time compared to writing it in a
> more traditional start-to-finish fashion. Perhaps because the time you
> need to think of what to say about X can be spent to say something
> about Y.
>
> This is somewhat similar to my preferred way of working with code, I
> start out with a jumble of fragments and assemble them into complete
> code over time.
> The Java development style where you need the whole file (or even
> worse, the whole project) to compile in order to test a single method
> is a lot slower, at least for me.
>
>
I understand what you're saying, but I'm wary of pushing metaphors too far.
I don't exactly see where the REPL sits in your's :-)


>
> >     a. So having an "IDE-dedicated live server REPL" seems like I
> > could relieve the user from explicitly launching a REPL (it's weird
> > and counter-intuitive for a user to have to somehow "manually"
> > trigger the IDE user assistance !).
>
> I can't tell. I have the REPL running 100% of the time I am using a
> Clojure IDE, so this is an issue I never encounter. But if you need a
> "server REPL" for internal reasons that's fine by me, as long as it
> doesn't mess with the REPL I am using.
>
> > I may still make the default behaviour be "automatically
> > reload", and for people wanting the maximum safety, "don't automatically
> > reload").
>
> I'm perfectly fine with that :)
>
>
> For what I would like:
>
> * I would be happy to have a one-click option (button or keyboard
> shortcut) to reload everything that is currently loaded.
>

That's definitely something I'd like to provide as a user convenience. One
question : when you write "reload everything that is currently loaded", what
are precisely your expectations ? by "that is currently loaded", do you
expect a "per var" granularity level, or is a "per namespace" granularity
level good enough ? (because I see how to do the "per namespace" level, but
not the "per var" - without having to patch clojure for enhancing the 'def
special form - and I do not want to do that)


>
> * If there is some way to undefine vars that were loaded from file
> when the vars are deleted from the file and the file is reloaded, I
> think I would like that too. It would save many a REPL restart to
> check that newly refactored code doesn't depend on something that was
> deleted. (Although it might come back to bite me if I have overridden
> the file definition in the REPL and a reload removes both of them, I
> expect I would eventually learn not to avoid that.)
> Or perhaps a one-click manual "restart REPL and reload current files",
> somewhat analogous to a Java "clean and build".
>
>
> I should mention that my working habits were formed with Emacs and
> Allegro Common Lisp and a decade with various Java IDEs.
> We adjust to the tools we are using, at least to some extent, and
> people coming to Clojure from elsewhere may have different
> expectations.
>
> If we want to move the state of Clojure IDEs forward, we may have to
> break some expectations for people like me, and "but that's how we did
> it in X twenty years ago" is not a sufficient reason to keep something
> in and of itself.
>
> I don't think it is possible to please everyone simultaneously, so if
> you think you have a better idea and can find at least a few people
> who prefer it your way, I'd say go for it :)
>
> Thanks for raising the question, it will be interesting to see what
> comes out of it.
>

Indeed, that's why I'm making the above suggestions to "challenge" your way
of working :-)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to