Hacker News new | ask | show | jobs
by danabramov 4220 days ago
I mostly wasn't talking about the high-level structure. Compare these methods:

        serializer = SnippetSerializer(data=request.data)
            if serializer.is_valid():
                serializer.save()
                return Response(serializer.data, status=status.HTTP_201_CREATED)
            return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
with this:

        (let [events (sub (:notif-chan (om/get-shared owner)) :hello (chan))]
            (go
              (loop [e (<! events)]
                (om/set-state! owner :message (:data e))
                (recur (<! events)))))))
In order to have a remote idea what's going on, I need to know about channels, what `events`, `sub`, `go`, `loop`, `recur`, `<!` are. In Python, it's easy to tell syntax and primitives from library classes and methods, but here I'm not sure which is which. That's what I mean by Clojure being dense. Of course it's stupid to assume you read the source without understanding the language first, but “Python after you know some OOP“ is still easier to read for absolute language beginner than “Clojure if you know some FP”. Again, I don't imply that Python is somehow better because of that.