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

While we're on the subject, here's my super nitpicky complaint abour mori: the use of snake_case when almost all JS is camelCase.

In the simple little project where I used mori, I did this:

    const {
      get,
      conj,
      js_to_clj: map,
      clj_to_js: pretty
    } = mori;
But I bet you lose a surprisingly large number of JS devs due to just having the "wrong" names. Maybe I should publish a camel-case-mori module on npm...


This is because mori is written in ClojureScript. For the most part, all mori is doing is exporting pieces of Clojure so that the native JavaScript environment can access them[1]. In Clojure, the naming convention is "foo-bar", and the cljs compiler translates that to "foo_bar".

I can't imagine changing the cljs compiler or adding a piece to mori that must be maintained is important enough for this. I'd imagine Swannodette's answer would be "you should use ClojureScript anyway" :)

[1] -- https://github.com/swannodette/mori/blob/master/src/mori.clj...


I don't think it'd be a huge issue in any case, probably just a case of providing a handler for name conversions. Not sure if it's worth the extra code lying around, but anything that potentially makes cljs a better actor in the js world is nice.




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

Search: