On Wed, Aug 10, 2011 at 11:22 PM, Scott Jaderholm <jaderh...@gmail.com>wrote:

> I haven't read the code yet but I have a few questions:
> Do you miss backbone.js? Are you going to use it with cljs?
>

I'm using 100% ClojureScript, with Google Closure as the only external
dependency. I don't miss Backbone.js, because it's design makes less sense
with ClojureScript than it does with JavaScript (i.e. it is based on the
JavaScript OOP paradigm). I used what I learned from Backbone.js  while
writing my ClojureScript code. I copied the idea of a routes function that
generates views based on the URI. I use this routing method to generate
views without reloading the page, using an event listener and the
goog.history.Html5History module. One of my favorite aspects of Backbone.js
is Underscore.js, which brings Lisp functions like filter, map and reduce to
JavaScript, but this is clearly redundant in ClojureScript. Backbone.js is
not something I would use with ClojureScript, but it is definitely designed
by smart people and it is a useful source of inspiration when building
client-side applications.


> Have you shared any code between the frontend and backend? As in run the
> same functions on both sides. If so, are you duplicating the code in both
> .clj and .cljs or doing something else


Vix has three quite separate components: the visitor-facing presentation
layer (flat HTML pages that are used as Enlive templates and CSS), the
Clojure backend (basically a document repository with a JSON API) and the
ClojureScript client-side code. The client-side code, including it's
templates, is fully written using the Google Closure tools and
ClojureScript, so there is almost no overlap. Off the top of my head I can
think of a single utility function that I copied between the ClojureScript
and Clojure parts. As far as I'm aware it is not possible to share code by
other means than copying yet, because there are some practical barriers for
interoperability.

How has the debugging/error notification experience been?


The stack traces aren't always very informative, so some things took a while
to figure out. This was usually my own fault, because I skimmed over
something important in the docs, for example, but it wouldn't hurt if it was
easier to figure out what was going wrong. I suggest using the generated
JavaScript as the starting point for debugging. My process is pretty much to
check if the  JavaScript output looks correct and use the debuggers in
Firefox and Gnome if that doesn't help. I've also used the occasional
(js/console.log) call and even edited the generated JavaScript on occasion
to figure out the root of a particularly nasty problem.

- fmw

-- 
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