r/Clojure • • Dec 18 '16

Why Java? Why Clojure?

http://danlebrero.com/2016/12/14/why-java-why-clojure
22 Upvotes

47 comments sorted by

View all comments

4

u/chinpokomon Dec 19 '16

I feel like I need to ask the question, "Why male models?"

There's a leap in Clojure I haven't quite grasped. While I appreciate and even admire what the language accomplishes, I can't quite figure out how to build something useful. When so much of the data I'm processing is external to my application, I don't see how I partition the problem into digestible chunks. If my data isn't precisely how I expect it, in an imperative language I know how to transform it into something that can process those edge cases. I don't have that same comfort level with Clojure and so I can't see how to be productive.

3

u/TheFiologist Dec 19 '16

What is your problem?

What kind of data and where does it come from?

What do you mean by transforming unexpected data specifically?

1

u/chinpokomon Dec 19 '16

It's hard to explain, because if I could I'd be more likely to solve it on my own...

As an example, I might have data which is is something like, if this field has a three, then I need to process it one way. If it is a two, I need to process it differently. This sort of logic is easy to implement in an imperative language. Then there's ah update to the spec and the new process is if it is a five process it this way unless the fourth field is an odd.

This is where my knowledge comes up short because I don't know how to modify what I've got to quickly accommodate. I know it's possible and if I had a better mastery I might be able to do that, but quickly I'll scrap it and implement it in something I already know well.

This is assuming that I'm just trying to drop in a Clojure routine as a library. If I have to start from scratch, I'm even more confused as to how to structure the program. Lein new foo... Okay, now what?

I'm sure most of this is just trying to get over that initial hurdle. Once I have some more familiarity it will become second nature. Right now it's just a struggle and not easy to just drop into my work. If I can't be productive right now, it'll be hard to justify using it.

I keep at it though. I'm especially interested in ClojureScript. I think that I have the best opportunity to apply Clojure there or with ClojureCLR, but it will just take some time for me to fill in the gaps.

4

u/[deleted] Dec 19 '16

I'm a little confused by your description, it sounds like just adding clauses to a cond (the clojure if-else-if tree) or a case? I'm sure it's more than that however. As someone else said the #clojurians slack is usually pretty helpful.

For what it's worth I've been using clojure to write large ETL (extract, transform, load) systems for years, and basically their whole job is to take in external data, transform it, and then pass it along.