Om Next Lessons


#1

Om Next is now in Alpha and people have been using it. There’s also some documentation that walks through the new concepts

I’ve been following the tutorial and it appears that things are stabilizing. A lot of people have asked about a follow-up to Single Page Applications with ClojureScript and Om using Om Next. I’m thinking about building the same application (a Lab Notebook) using Om Next. I think it would have to include a backend.

Would you like to see lessons on this?

Please vote. Comments are encouraged!

  • :thumbsup: Yes, please teach this!
  • :thumbsdown: No, I’m not interested.

0 voters


#2

I downvoted but only because I don’t use Om. I find it too complicated and hard to get started with. I’ve settled on the Reagent/Re-frame camp, and plan on experimenting with other frameworks like rum and zelkova (and even petrol https://github.com/krisajenkins/petrol).


#3

I just listened to the Cognicast podcast with David Nolen on Om.next: http://blog.cognitect.com/cognicast/093 (really worth the time (especially when stuck in traffic :slight_smile: )).
It does seem to tackle a tough problem with an elegant solution, so I would look forward to such a lesson.


#4

I find re-frame with reagent interesting too. But I would love both lessons, Om next and Re-frame. :smile:


#5

I’d like the mentoring to consider different frameworks rather than just one. Maybe you can discuss Rum (my favorite at the moment), Reagent, and/or Quiescent before moving to Om Next? Better yet, would be a comparison of all these different options. At the moment, I think a lot of people simply pick Om (next) because it’s the most popular framework. However, they actually all have different strengths that are often underrepresented.


React Wrapper Comparison
#6

Hi @yeehaa

I’ve made a topic poll with what I interpret to be your suggestion here.

Thanks!
Eric


#7

Awesome Eric, Thanks!


#8

In case you’re interested, David also shared a slightly different perspective on Om.next (and other stuff) in this recent episode of Functional Geekery.


#9

Thought I’d just throw in my 2 cents in the hope others find it useful. A bit of context will possibly help. I consider myself an experienced programmer (wrote my first BASIC program in 1977 on a TRS-80). Early adopter of Java in mid 90’s programming web apps, but then moved into other programming areas and only recently returned to doing some web programming. No longer do much programming at work, but cutting code is something I enjoy and do in my off-work time. Love lisp languages and have been using Clojure for a couple of years and Clojurescript for the past few months. I have never done any javascript programming.

When I started Clojurescript, I looked at both Om and Reagent and settled on Reagent as a starting point. Not having any real Javascript experience, Reagent seemed easier than Om. Found Reagent really good and got stuff working really quickly. Had a few conceptual hurdles to jump, but got there relatively easy. As the things I was trying became more complex/sophisticated, I did begin to find some aspects of Reagent a little more difficult and had a few periods of hair pulling until I worked things out. However, for most of what I was doing, Reagent worked really well.

As I’ve increased my knowledge and experienced some of the challenges of modern web programming, I’m now re-visiting Om. Having gained more understanding of React I now find Om easier to understand and found the Clojurescript and Om course very useful. However, I also now have a much greater appreciation for what David Nolan is attempting with Om.Next. The issues he is trying to address with Om.next are very much in-line with some of the challenges I’ve encountered when developing SPAs with Reagent. Very much looking forward to Om.next.

I have a fairly strong opinion about frameworks. I’ve looked at Reagent based Re-frame and have used things like the Luminus framework to get a project started. I think these are really good learning tools. However, I’m less keen on the concept of frameworks in Clojure/Clojurescript than in other languages such as Ruby and Rails. Too often, I find that frameworks can force you into a structure and a solution space which are not necessarily optimal for the problem you are solving. One of the things I love about Clojure and Clojurescirpt is that it is easy to build your own ecosystem based on just what you need and no more. You are able to structure things to fit your mental model rather than being forced to try and get your mental model to fit with the framework. The challenge is knowing what is possible and how to compose your environment - this is where frameworks are so valuable. Note that I don’t consider Om, Reagent etc to be frameworks. These are libraries. Frameworks are things like Luminus or Re-frame.

My feeling is that which library - Om, Om.next, Reagent etc, to choose will depend a lot on your experience and your own mental model. In general, if you are relatively new to modern web programming and don’t have a lot of Javascript experience, I would recommend Reagent. On the other hand, if you are an experienced web programmer who knows Javascript and especially if you know React, I would suggest Om (or better yet, Om.next).

If you are very new to Clojure and Clojurescirpt, I think the Luminus web framework is a great starting point. It provides a good example of how you can compose your environment and how you can grab different libraries to solve parts of your problem. However, I would use it just for learning. When it comes time to write your first serious web application, I would start with a minimal lein template and add bits as you need them - keeping things as simple and minimal as necessary.

The other resource I use a lot is github. While you can learn a lot from reading books, blogs etc, nothing teaches you more than reading and analysiing other peoples code. This also holds for Clojure and Clojurescript. One of the things I like about the clojure world is that when trying to understand how a function works, you can easily view the code and while it may take a bit to understand how that little snippet of code works, the effort is extremely rewarding and provides the sort of insight which helps you improve your own code.

The video Eric links to is well worth watching. It provides a good overview of the differences between the 3 main React wrappers. I would also highly recommend David Nolan’s talks/videos on Om.next. However, you probably won’t get to really appreciate the subtitles involved until you sit down and try to use the different libraries.

I’m not sure if detailed tutorials or analysis of the different React wrappers is going to be that beneficial given the amount of work it will involve. Part of the issue is that this area is still moving very quickly and any work done to compare and contrast or even explain how to use the different frameworks will likely be outdated very quickly. I also think that if you understand Om, you will have no problems understanding Reagent and once you have experience with Reagent, you will have no real problems getting to understand Om. Therefore, my vote would be to put resources into an updated tutorial on Om.Next once it has reached at least a beta release.


#10

Wow! This is super popular.

I’m definitely going to do it, just as soon as Om.next goes into Beta, to make sure that I’m covering stuff that will be relevant as long as possible. David Nolen is good about compatibility and versioning, so I’m confident that once it goes Beta, it will be stable.

In the meantime, start at the om.next Quick Start. And check out David Nolen’s talk at Clojure/conj.

Rock on!
Eric


#11

OM Next is in beta finally. I’ve using OM Next in React Native but still run into issues here and there with queries or mutations that aren’t at the root. I would love some guidance to understand where the disconnects are.


#12

Hey there @puppybits,

I’m sure I don’t understand Om Next well enough to offer any guidance. I would suggest hopping on the Om Next channel on Clojurians Slack (http://clojurians.net/). They’re a friendly bunch and will give you up-to-date advice.

Good luck and rock on!
Eric