r/Clojure • u/SevereOverfl0w • May 16 '20
re-frame's new website
https://day8.github.io/re-frame/9
u/MickeyMooose May 16 '20
Not sure about this.
It looks unfinished and it has lost its usefulness compared to the previous readme site.
Just steal this layout from Svelte JS:
3
3
u/clickrush May 16 '20
The term „data oriented“ is often misused by the clojure community. Neither clojure nor most of its libraries are inherently data oriented, but rather data driven.
3
u/Eno6ohng May 16 '20
IIRC clojure crowd widely used the term "data-oriented" before it was popularized with its current meaning, and even now the meaning is kinda fuzzy and depends on the context.
3
u/clickrush May 16 '20
Clojure predates DOO only by 2 years. I think the main issue with the term is that it isn’t very descriptive. DOD really should be called Memory Oriented Design or something along those lines. Yes, it does have implications on programming ergonomics, because it favors composition and relational thinking. But the core aspect is controlling memory layout and performance.
Data driven programming however is almost as old as programming itself roughly speaking. And the way I understand Clojure programming is strongly related to this concept. In fact I would say it was designed to be exactly that, just that term doesn’t come up too often.
4
u/Eno6ohng May 16 '20
100% agree.
One small addition though: I often notice the same crowd that praises "data-oriented design" (aka "memory-oriented design") also praises "data-oriented design" (aka "data-driven programming"), though in a rather limited sense (usually referring to ECS-based game architectures); using the same term on both occasions! That's what I meant by "depends on context", and that's why I'm somewhat skeptical on the preposition that it's the clojure community that is misusing the term; on the other hand, apparently this ship has sailed and it is indeed better for the greater good to (mostly) stick with "data-driven" to avoid further confusion.
2
u/didibus May 17 '20
I've never heard of DOO outside of Clojure? Do you have a link? Also what's this memory oriented thing you speak of?
Personally, I think of data oriented as meaning that you model your domain using plain data-structures. This is in contrast to object oriented where you model things with objects.
That's the context I hear it used for in Clojure. Seems like a natural use of the term.
Data driven is when data drives computation. For example, when you create DSLs using data literals and data-structures which get interpreted into some behavior.
Clojure itself is data driven, as its own code is represented as data literals and parsed into list data structures which get interpreted into evaluation.
Also Clojure encourages to model things like that too, such as Hiccup, Garden, etc.
So Clojure is both heavily Data Oriented and Data Driven in the definitions I gave them.
I'd be really sad if there's someone else who stole these terms to mean some other notion. Like the people who stole reactive for some weird manifesto that doesn't seem to have any semblance of reactivity in it.
2
u/Eno6ohng May 17 '20
https://github.com/amethyst/amethyst/
Data-oriented and data-driven game engine written in Rust
The former here means it uses efficient memory layout for components, while the latter means it's actually nice to use for the programmer.
2
u/didibus May 17 '20
Hum I see. I think that's quite a niche use, I think it be fine to have both community continue their independent use. They don't even really conflict that much and could actually find some parallels.
For example, I think the former is also about programmer ergonomics. Its just that when you are a game programmer, you need to be able to have finer grained control on memory layout, and objects don't give you that, so they're cumbersome to make use of effectively.
If instead like in Clojure, it is known that data will be modeled using data-structures, it's easier to say, okay well here I'm going to use the data-structure most appropriate for my needs that make it as easy for me as possible to model my domain and get the benefits I care about. So maybe that's using a structure of arrays, or some other data structures. It doesn't have to be an immutable map or vector. At least I've never seen Clojure's data oriented approach to mean exclusively you have to use Clojure's immutable data-structure. To me it always just meant that we eskew Objects and custom types and instead work directly with data-structures of our choice. And if you're a game programmer, you might choose things that optimize for memory layout.
So I think it's easy enough as a reader anyways to disambiguate using the context.
At least that's my feeling, so I think I'll happily continue to use my definition of Data Oriented and Data Driven within the context of Clojure.
3
u/Eno6ohng May 16 '20
Just my 2c: the logo needs the letter "f" emphasized somehow (with color maybe?). I think now it can be easily misread as "re-rame".
5
u/xela314159 May 16 '20
Well done. That’s the kind of quality, both in the library and the tutorial and website, that will make Clojure grow. We need more of this!
1
u/lime_boy6 May 21 '20
The large re-frame logo might look better if it were a little higher resolution. It looks quite pixelated around the edges on my iphone 6s plus
2
0
15
May 16 '20
[removed] — view removed comment
6
u/yogthos May 16 '20 edited May 16 '20
It's not really hypocritical because Reagent and re-frame APIs/semantics have remained largely unchanged over the years. There have been a few new features added, but practically no breaking changes. My team has some apps that have been in production close to half a decade now, and we just update the version to get speed improvements, features, and fixes.
Meanwhile, React ecosystem has had a ton of churn in that time. There have been lots of patterns introduced like redux, flux, hooks, and now cursors. If you started building an app using best practices a few years ago it's likely to be legacy at this point.
So, re-frame and Reagent actually insulate ClojureScript devs from the churn in the underlying React ecosystem. React is really just an implementation detail, and it can even be swapped out with a native implementation like mr-clean.
That said, I do agree that this may be seen as off putting and condescending by Js devs coming to ClojureScript. :)
2
u/foobarbazquix May 17 '20
There have been lots of patterns introduced like redux, flux, hooks, and now cursors.
Render props, context api, component lifecycle methods...
6
May 16 '20
[removed] — view removed comment
5
u/yogthos May 16 '20
I think the difference with jQuery is that React best practices are starting to look a lot like reagent and re-frame nowadays. To me this confirms that reagent/re-frame managed to get this right out of the gate.
However, I completely agree regarding marketing aspect. Keeping things positive is more likely to attract devs, especially considering that churn isn't really seen as a problem by most people.
2
u/clickrush May 16 '20
Clojure is a language that is targeted at developers who rely on the JVM and JS ecosystems but want to program in an ergonomic, stable, functional language.
JS specifically is very much a moving target. This doesn’t just include language features but also paradigms. This is the „target audience“ so to speak.
6
May 16 '20
[removed] — view removed comment
4
u/SimonGray May 16 '20
Reagent itself is a great starting point and is enough for many (most) apps. It's also not very difficult to understand, especially if you already know Clojure (it's just functions and atoms + the ubiqituous Hiccup). I know that many people start out with Re-frame (I did so myself), but lately I'm really learning the joys of just using pure reagent.
The main thing that Re-frame teaches is integrating business logic and component logic (events), isolating DOM mutation (coeffects and effects), and enforcing the single state atom (app db). The only really substantial technical addition are subscriptions (enabling reuse of presentation logic), which you can replicate yourself using reagent. I think its primary value proposition is that it's a framework (they call it a pattern) that teaches people wanting to do ClojureScript SPAs how to organise stuff well. That's what drew me to it in the first place.
But you don't really need it.
1
u/clickrush May 16 '20
Maybe it doesn’t have to be this kind of language. There is certainly a lot of room for improvement when it comes to setting up a working environment, but I think there is a real need for programming to become more conceptual and abstract. Languages like clojure seem to be very well suited for that niche.
1
u/kinleyd May 17 '20 edited May 17 '20
Fully concur with those thoughts. Simplification by reducing the number of moving parts as much as possible will go a long way to increase ClojureScript adoption.
29
u/SimonGray May 16 '20 edited May 16 '20
It's pretty and the devs seem to care about accessibility (nice), but it - kind of like the official Clojure website - really needs an illustratory code snippet on the frontpage. If you follow the "Get started" link there's another five pages to read before you get to the first tiny code snippet.
In the old (awesome) long-form README.md you could quickly scroll down to see some code and get a feeling of what Re-frame is about and that is now sadly gone. Asking the user to commit to reading several pages before they get to see any code is way, way too much.