5 ms·
Your small dive prompted me to create a simple version of what you were describing [1]. I didn't use my usual editor, and just used the cljsfiddle itself. I r
by escherize 10y ago
Your small dive prompted me to create a simple version of what you were describing [1]. I didn't use my usual editor, and just used the cljsfiddle itself.
I really wanted to create a spec for the data in app-state, and check the value in the app-state atom each time I edited it (perhaps with an add-watch). That gets you many of the same advantages of static typing, but you only add the extra insurance when you think its worthwhile instead of always.
Instead of using strings for time-choices and page-choices (in the code at [1]), you can use maps like
[{:title "Day" :time 24}, {:title "Hour" :time 1}...]
and expand when nessicary. It shouldn't be too difficult to keep them in sync this way.
You might want to check out clojurescript again sometime soon. Clojure.spec (and cljs.spec) are going to offer a huge jump in usability. Clojure.spec is a tool kit, and specs are basically definitions of data, that can be used for parsing, unparsing, and generating that very data. The beginning of this (interactive, cljs driven) blog post shows clojure.spec off a bit.
[1] - http://escherize.com/cljsfiddle/#gist=eea10854f99ef124f8dc152af1ff306d http://escherize.com/cljsfiddle/#gist=eea10854f99ef124f8dc15...
[2] - http://blog.klipse.tech/clojure/2016/10/10/defn-args.html http://blog.klipse.tech/clojure/2016/10/10/defn-args.html
- bpicolo 10y agoClojurescript with re-frame is great.
- dkersten 10y agore-frame is absolutely fantastic! I've never enjoyed frontend web development as much as I have using ClojureScript with re-frame.
- bschwindHN 10y agoAbsolutely agree. And the cool thing is you can use re-frame and friends on mobile with React Native. The most pleasant developer experiences I've had were with the Clojure and ClojureScript ecosystems. https://github.com/drapanjanas/re-natal https://github.com/drapanjanas/re-natal
- dkersten 10y agoThanks for the link. I hadn't heard of re-natal, but it looks really great. Will have to try it now :)
- bshimmin 10y agoI don't know about anyone else, but for me in Chrome there was an empty white box where the code was supposed to be on your first link. When I clicked around in it a bit, the code magically appeared. (I offer this as no criticism of anything, just in the hope it might save a single other soul the same confusion I had.)