Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It may be because I'm not familiar with ClojureScript's syntax, but the whole sample application code seems like a real mess to me. It's full of boilerplate code and it is happily mixing application logic with DOM rendering. [1]

Compare this with an alternative JS MVC framework (like, say, Knockout.js) and another modern "javascript-compatible" language (like, say, TypeScript), and see for yourself. [2]

While I didn't run any benchmarks, it's safe to assume the Om demo is faster. However which sample do you think is easier to write, test and maintain? If "The Future of JavaScript MVC Frameworks" is supposed to look like the Om sample, sorry but I'll pass.

[1]: https://github.com/swannodette/todomvc/tree/gh-pages/labs/ar...

[2]: https://github.com/jpatte/TodoMvc-Knockout.ts



While the TypeScript + Knockout combo looks pretty good, it doesn't look that much more expressive to my eyes. Certainly hasn't been my experience that Clojure or ClojureScript are hard to test and maintain.

Still thanks for the comparison!


I don't see how language has anything to do with you criticism.


It's not really about a choice of language.

My point is that if Om claims to be superior to other JS MVC frameworks - as it is presented as "the future of MVC frameworks" - it needs to be good (if not superior) in many aspects. Performance is a big deal all right, but another aspect (which seems essential to me) is that using this framework should be easy, concise and intuitive. And I've been kinda disappointed to see that the sample code given to present Om in action is not. At all. If I wanted to fiddle a bit with this code right now, to add a few features for example (like adding a timestamp besides each item indicating when it was created), I wouldn't have any clue where to start.

What bothers me is that Om has clearly been written with ClojureScript in mind, so in a way this framework is supposed to be sublimated by the language. It should "feel" right. And I know it's possible with other frameworks (and my comparison with Knockout+TypeScript was meant to illustrate that), so I expected it to be the case with Om.


This sounds like a case of simple, not easy: http://www.infoq.com/presentations/Simple-Made-Easy

You could add a timestamp to each todo with two changes:

https://github.com/swannodette/todomvc/blob/gh-pages/labs/ar...

    (defn handle-new-todo-keydown [e {:keys [todos] :as app} owner]
    ...
            (om/update! app [:todos] conj
              {:id (guid) :title (.-value new-field)
               :created-at (js/Date.)  ;; <-- add this line
               :completed false :order (count todos)})
    ...)
https://github.com/swannodette/todomvc/blob/gh-pages/labs/ar...

    (defn todo-item [{:keys [id title editing completed] :as todo} {:keys [comm]}]
    ...
                ;; change this line
                (dom/label #js {:onDoubleClick #(handle-edit % todo m)} (str
    (:title todo) (:created-at todo)))
    ...)


I dunno- I'm a clojurescript guy, and it seems pretty "sublimated" to me.. I think the problems React.js and Om are trying to solve are more critical when dealing with large & complex applications... I think one would see the benefits more clearly in those cases (though it feels a simpler to me as it is already)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: