@colin.yates: @sventechie I consider myself to be a fairly average developer from a mainly procedural/OOP background and I went..and I’m still going through..phases of understanding learning Clojure. Initially I had no problem with the idea of separating data and behaviour- easy and refreshing hark back to procedural programming where the two are not complected either. Syntax was easy. Thinking about high level functions being passed around and closures took some time. However, I still struggle with the density of some very idiomatic Clojure. I find myself struggling to hold in my head the shape of the data as it passes through the ‘pipeline’ of transformations in anything doing a reasonable amount. As with other languages, breaking things into much smaller functions helps but I think I miss the ‘type signposts’ that let me know what the data shape is the function expects and produces. Is it a map of keywords and vectors? If so what’s in the vectors? etc.
I don’t necessarily want strong typing I just want documentation (meta data or examples) of what a function expects/produces.
Prismatic Schema helps but I don’t want schema’s littered through code (haven’t tried core.typed so no comment), meta data type hints help but I’m toying with just using pre: and post: a bit more?
@agile_geek: I use Schema almost everywhere, certainly on boundary functions. My colleague uses pre/post - either are invaluable I think. I also tend to be unidiomatic and prefer smaller named functions or a larger function with intermediary steps/fns in a let
It isn’t a lack of familiarity with the fns (which are almost always some combination of map, reduce, filter, keep or remove :-)), it is, as you say, trying to understand what the shape of the data is.
having said all of that, some of the fns are far more readable with the threading operator than I could ever have gotten close to with Java/Groovy.
@colin.yates: glad to know it’s not just me.
@agile_geek: you might consider checking out annotate: https://github.com/roomkey/annotate it's a little bit more lightweight/less noisy than schema, just a single type annotation at the top of the defn above the docstring
I also still have problems understanding some deeper clojure concepts (transducers is the first thing that pops to mind).
And also make heavy use of pre/post conditions and Schema (where it makes sense). I normally add Schema after the fact, once I’ve refactored all my functions and see them working.
The real world is such an ugly thing. i.e. Business vs Academic
(random side comment)
yeah, it is what makes life interesting.
and makes us die young
speak for yourself :simple_smile:
haha
it would be fine if I could change my situation, but most of the problems I'm trying to deal with are not caused by me or under my control
short of resigning, of course
hehehe
I know how you feel
just in the past month I’ve been able to do clojure in my day job. Very small applications, but it made me very happy.
Before that it was only in the weekends.
I’ve been looking at doing something like http://osv.io/blog/blog/2014/07/27/capstan-lein-template/ OSv to run clojure apps on. Is there a particular cloudOS/Unikernel that anyone else is using for their clojure deploys they’d recommend?
@mj_langford: I’ve experimented with Heroku, OpenShift and AWS — they are all quite easy, also Docker but probably want an Oracle JDK for performance
@sventechie: I'm more looking for a fast launching "os free" pre-built image situation rather than something like Heroku
A smooth system deploy always makes me nervous. Means I missed the real problems 😛
maybe I've just gotten too cynical
@mj_langford: you mean like CoreOS or something even lower level?
@sventechie: lower still, unikernel if possible, something like http://osv.io/manageability/ if not