by pier25 · 7y ago · 0 comments
These days the solution usually falls into 3 camps:
1) Write everything in JS like React.createElement or Mithril. No build setup but a pain to use.
2) JSX. Requires a build setup which might become complex as the project grows.
3) Templates. Probably the less elegant of all 3 but the most pragmatic and easy to use.
Someone attempted to solve this and created a new language called Imba. It's like a mutant Ruby with HTML that compiles to JS.
It has a lot of productivity benefits compared to previous attempts at solving the same problem, but goddammit it's ugly.
It's easy enough to create a template/starter kit the way you want it and tweak it to your taste. Also when (not if) you get a problem you know what's going on instead of a black box.
For me, ClojureScript/Reagent [1] has been a dream come true. It marries JS, HTML and React very, very well. I still use normal CSS because I haven't hit a pain point with it yet, but there's some nice CSS tools that use EDN syntax and get rid of many CSS pain points. So far, I've only been able to use it for personal projects but they're not all small. I work with normal React at work on large projects and I've yet to run into anything I thought would be harder to do if were done with Reagent.
https://toggl.com/programming-princess/
I will take a more serious look at ClojureScript, thanks for the suggestion.
I jump around between C#, JS, HTML, XML, JSON, JSX, CSS, SQL and Clojure all day long. I have to do the non-Clojure stuff a lot more and have been doing them decades longer, after just a few weeks of getting used to it, Clojure would be my first choice.