r/Clojure • • May 16 '20

re-frame's new website

https://day8.github.io/re-frame/
77 Upvotes

40 comments sorted by

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.

7

u/slifin May 16 '20 edited May 16 '20

https://reasonml.github.io/ is a good example to copy in my opinion, it uses the same docs generator the new re-frame site is using but has the value proposition as code there on the home page

A large scrolling forever page can make the docs seem impenetrable, Fulcro suffers from this IMO: http://book.fulcrologic.com/ at the same time lots of small pages can prevent sweeping reads, maybe medium pages with lots of hyperlinks is a good trade-off

Moving between pages ideally would be like a giant full stop or end of a paragraph, I can breathe easy knowing the next page will be about something conceptually different and mostly unload the last page from my head

Some of the categories/FAQs seem weird to me, over scrolling at the bottom of the page on macOS is a bit janky white on black, and some sections are missing but overall I think I like the direction

Examples and online REPLs are great in these kinds of sites

Edit: ReasonML's homepage also contains quick start, i.e. lein new reframe my-first-app

Edit: for reference, there are some other state management libraries websites here: https://redux.js.org/ https://recoiljs.org/

1

u/namesandfaces May 16 '20

ReasonML just uses Facebook's Docusaurus, so you can get the same look and feel if you want.

5

u/daveliepmann May 16 '20

Asking the user to commit to reading several pages [of a README.md] before they get to see any code is way, way too much.

Incredibly strong agree. A README is a context for short, immediately-actionable, and to-the-point.

the official Clojure website...really needs an illustratory code snippet on the frontpage

I'm not sure the "show the code early" rule for READMEs carries over to a language homepage. The audience is different, for one. Secondly, I think a prominent code example works for something like Reason better than for Clojure because the former is more familiar to more people. It's an anti-goal for your homepage to drive people away because they (naively, wrongly) see "all those parentheses".

I'm also not sure how much this matters. I'm sure at least one potential user left because the homepage didn't have a Hello World example, but I'm not sure the total number of serious potential users is significant.

3

u/SimonGray May 16 '20 edited May 16 '20

I'm sure at least one potential user left because the homepage didn't have a Hello World example, but I'm not sure the total number of serious potential users is significant.

I'm not talking about "hello world".

I'm talking about demonstrating value and making things more concrete (as opposed to abstract and high-level). Both this website and the official Clojure/ClojureScript ones are extremely descriptive. Unless you already know (and agree with) what they are talking about, the value of the language is hard to grasp.

There's an unofficial ClojureScript website that is more like a traditional site. It's not perfect, but it's more welcoming to newcomers IMO.

It's an anti-goal for your homepage to drive people away because they (naively, wrongly) see "all those parentheses".

We, as a community, are perhaps a bit insecure about parentheses, but well-written Clojure code can be quite beautiful - even to the uninitiated, I would argue

3

u/pavelklavik May 16 '20

The snippet in the unofficial ClojureScript website would need some work. To unfamiliar person, Reagent means nothing. It would be better to have something like "Create React components" and have the HTML output on the side.

1

u/SimonGray May 16 '20

There's no one snippet (it cycles randomly) so I'm not sure what you're referring to, but I agree that the code should but carefully written and presented.

2

u/pavelklavik May 16 '20

I was referring to Reagent snippet. In general, it is not clear what these snippet show to someone who is not familiar with Clojure. So maybe adding some description on the side, or showing some screenshot.

In general, when building a website, it is important to know who is the target audience. In case of Re-frame, who is the target? Clojure and ClojureScript developers? JS developers? React developers?

2

u/daveliepmann May 16 '20

well-written Clojure code can be quite beautiful

Absolutely agreed!

even to the uninitiated

Ehhhhhhh maybe I have less faith in the broader population of programmers :)

1

u/SimonGray May 16 '20

Ehhhhhhh maybe I have less faith in the broader population of programmers :)

Maybe not your average code monkey, but I find that the type of person who would visit something like Hacker News is often intrigued by the "mysterious" look of Lisp. The problem is more that Lisp has this image of being impractical or that they're so entrenched with OOP that Clojure's data-centric approach is weird, maybe even somewhat sacrilegious to them.

If you can provide a well-written code snippet up front that does something very practical, I think you can win some of them over.

5

u/phunanon May 16 '20

Woah, you're right! I was reading that README even just last week. I think I'll have to bookmark the particular revision until I get used to the new site.

1

u/mikethommo May 22 '20

The new site contains almost exactly the same content. Just arranged a bit differently.

1

u/Prestance May 17 '20 edited May 17 '20

Yeah you make a good point, totally agree! A clear homepage/getting started with snippet like https://www.learnreframe.com/ does, it's very clear IMHO.

2

u/mikethommo May 22 '20

That's a great suggestion. Will work on that, thanks. (But it might be a week before that shows up)

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:

https://svelte.dev/

3

u/pinkyabuse May 16 '20 edited May 18 '20

The App Structure page is missing.

Edit: it's fixed

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

u/mikethommo May 22 '20

This should be resolved now. Could you check again how it looks, please?

1

u/lime_boy6 May 22 '20

Looks better now. Nice work 😊

0

u/[deleted] May 16 '20

[deleted]

1

u/mikethommo May 22 '20

Would you mind having another look, please? It should be better now.

15

u/[deleted] 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

u/[deleted] 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

u/[deleted] 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.