The lack of a debugger seriously hindered my development process in
the beginning. You should look into the IntelliJ plugin. It's very
well done, and debugging works flawlessly out of the box. It's sped up
my productivity by a factor of three at the very least.

I have given Emacs+Slime a fair chance I'd say, but after working with
it for four months now, a nice modern IDE like IntelliJ is still what
I'm used to and I get more work done in it, and I suspect it will be
like that for a majority of Clojure users.

As for workflow, mine doesn't differ significantly from everyone
else's. There is one technique that is a significant productivity gain
and which is far easier in Clojure than in other languages though.

I separate out my program into segments, and during development, I
make sure to keep each segment independent.

eg. For programming a simple 2d game. I can divide the program into
the GraphicsEngine segment, and the GameLogic segment. The
GraphicsEngine segment will handle all the lowlevel details of
drawing, and the GameLogic segment will handle game specific code.

So, I will program the GraphicsEngine segment first, and usually just
do some quick testing in the REPL to make sure it's working.

Then I will program the GameLogic segment. Now, in the final product,
the GameLogic segment will be dependent on the GraphicsEngine segment.
The GameLogic segment will call the appropriate functions to draw
sprites when it needs to, etc...

BUT during development I make sure not to mix the two. So instead of
directly calling GraphicsEngine, I'll create a simplified dummy
GraphicsEngine interface. This interface will usually just print
statements.

ie. I will create the dummy function:
  drawOval()
  which will just print "an oval was drawn at coordinate (0, 1) with
size 5", instead of actually drawing an oval to the screen.

I then use this dummy interface to program and test the GameLogic
segment. When everything's done, I can meld the two program halves
together relatively painlessly.

The advantages this approach has is:
  1) You can be fairly confident that there aren't any bugs in your
Dummy Interface.
  2) Because of that, any bugs you find while programming GameLogic
will in fact reside in GameLogic. So you don't need to bounce around
different parts of your program to trace bugs.
  3) Because the dummy interface is simple, you can keep it all in
your head while you program GameLogic. You don't need to jump other
parts of your program to check up function definitions, etc...
  4) It's great for debugging, because now you have a printout of all
your program actions. Which you can save, review, etc...

And Clojure is great for this style because there's no type system to
get in the way. To do this in Java requires a significantly more
careful plan so satisfy the type system, and often the effort that
goes into that plan outweighs the benefit.

I wonder if anyone else programs in this fashion.
  -Patrick
--~--~---------~--~----~------------~-------~--~----~
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
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