Fork me on GitHub

@montanonic use whatever is more readable my preference usually goes to anonymous literals


@seancorfield: I think you are stating the most common 'complaint' I hear from experienced developers trying out Clojure/Clojurescript for the first time. The good thing about the Clojure community is that we are willing to let go of old paradigms if they're not working, the bad thing about the Clojure community is the same. It's hard for people to latch onto an idiomatic approach to the 'macro' paradigms like web dev (we definitely have a strong story in the 'micro' around functional composition etc.). I am following @luke's work on Arachne with great interest to see if this provides the basis for filling this whole in the Clojure story.


@agile_geek: Interesting observation. I guess I’m old enough and have been programming long enough that I'm used to there being very little "best practices" codified online or even in books (I’d been a professional programmer for a decade before the "Gang of Four" patterns book came out, for instance — and all this new-fangled "video tutorial" stuff is still alien to me 😄 ).


I prefer “best practices” in the spirit of Effective Java. There is probably a way to differentiate those from larger architectural “decisions” like what Luke is trying out with Arachne.


@seancorfield: I am in the same boat. Albeit I have some COBOL books somewhere! And I can remember what a status 30 error code is!


@roberto: as stated above I think Clojure has a good story WRT best practices at the micro but has less guidance in the macro. I am following @ztellman's stuff around 'Elements of Clojure' with great interest too.


oh, yeah, I find ztellman’s book very insightful. His unsession at Clojure West was also pretty good. Very thought provoking.


ztellman book?


I wish there was more books geared towards web development - with titles like "microservices with clojure" "Build a webapps with clojure"


it probably isn’t what you are looking for. It isn’t a prescriptive book.


@agile_geek: yes as I mentioned earlier (scroll up - one day ago)


@agile_geek: I bought it but I haven't read it. Maybe I should


@lewix: I think it's a good place to start if you're interested in web development


The author also has a talk online where he demoes how to build web apps with clojure. It was given at this year’s Philly’s ETE


Once you're past the 'how do I do anything with Clojure' stage I think is a good 'intermediate' level book.


Ok I'll invest more time with those books


I invested about a month learning clojure/clojurescript...I guess it takes more time than I thought to be comfortable with the bigger picture (more complex apps from A to Z)


way more than most technologies I dealt with in the past


@roberto: thanks for the link


it takes a while, it is a paradigm shift, and that is harder to learn than syntax.


I spent about 2 years trying to learn it on and off, until it finally clicked.


Learning SML made clojure (and scala) click for me.


i think learning the paradigms is more important than the syntax. After that things flow naturally.


I found Clojure/Clojurescript deceptively simple and frustratingly hard at same time. Coming from years of procedural and imperative OO programming, the syntax is simple but there's a lot to 'unlearn' and 'relearn' to 'get' the FP side of things. Once you 'get it' you kick yourself because it all seems so simple you wonder why it took so long. Persevere 😄


@roberto: I think the paradigm clicks, but the lack of learning resources to stitch everything together lack. I should have at least read the only book available about web development before I pass judgement though


I learned web dev by reading most of the simple examples out there. At the time, the only book available was out dated. The second edition book should be very helpful to get you ramped up tho.


Maybe I struggled with that bit less because I started writing Java apps for the web before JSP's or web containers so it was all hand crafted multithreaded bepoke code rendering in an applet!


well, the basics were not that hard for me, it was things like OAuth


Anything seems easier than that!


once you get through the basics of routing, and want to incorporate things like OAuth or sockets, things start to get hairy.


for me that was the biggest struggle


there's something I always wondered, how is it decided what goes into the clojure core.


The bit of the story that's missing is that there's no all encompasing 'framework' that does everything...a la Django or Rails


in terms of functions


core is very minimal, just what is needed to start the app.


have you ever done gui apps?


I used to write lots of swing apps, so it was very familiar to have a “main” or “core” that starts the app


if you come from rails, that is hidden from you. I think it is more common in python land (in the pyramid framework for example)


agile_geek: In my opinion the problem is less about a framework that does everything and more about learning materials showing the big picture. Instead of lessons about functions x or y, we should have more resources about building Apps. So it's easier to see how everything is connected....


That's what Dmitri's book should give you


@roberto: sorry I phrased it wrong. I meant that I wonder how the core team decide which functions to add to the core library


ah, I see. I don’t really think much about that. 🙂


I can’t “change that” if it bothers me, so I don’t give it any thought.


@lewix: basically, what Rich say's goes. I quite like the fact that he's very conservative about how much he puts in core


@roberto: I found some function that I thought useful that I didn't see in the core lib (can't remember off the top of my mind), and some in the core libs which makes me wonder..when will I need that?


when you have a Lisp with macro's you can pretty much write whatever extension to the language you want.


Often something you think should be in core will be in a library someone else has written


agile_geek: fair enough


or you can write it yourself 😉


Typically stuff going into core now is fundamental paradigm shifting stuff that needs associated changes to the reader and/or compiler to make efficient. For example, transducers.


anyone played with golang ?


i tried some katas, it wasn’t for me.


i like some of the things: like generating a portable executable.


the tooling is execellent


but I didn’t like the language 😞


There’s an #C16LEKSLT channel that has some really good discussions around language comparisons if folks want to go deeper.


Re: what goes into core — I agree @lewix that I often end up writing a function myself that then seems to be common in almost every "utility" library and you wonder why it’s not in core, and then you see something in core that seems really exotic and you can’t figure out when you’d even need such a thing!


Most of core is fairly obvious "building blocks" tho’ otherwise.


Is there a way to break out of recur loop recursion early?


@montanonic: Just conditionally don’t call recur


No magic, really 🙂


yeah, I wasn't even thinking of that for some reason, even though I already do that to ensure the input isn't null


Yeah, you can essentially flip your thinking around and instead think of recur as being the special thing that causes it to go back to the loop, where the default is to not.


Guys, I have a fundamental question, it's probably really silly, maybe my head is still too OOP. Maybe I'm just so confused that I won't be able to express my question correctly, but here it is: how should I design the representation of a certain core domain data? Suppose I'm designing a classroom software, in a classroom there will be students, a student has a name, surname, age and gender, how should I correctly define that first so I can, then, write functions to manipulate this structure? Should I use defstruct?


@digorithm: To be honest, I would first take a stab using regular maps, trying to be somewhat disciplined about things, but without getting too caught up in it. (Malleability is a good thing early on in the design.) Perhaps then reach for defrecord later after things settle down, if you find you need the structure it provides, or for perf.


@mfikes thanks for the response. how could I use regular maps in generic/abstract way to describe the structure of a student, for example?


{:first-name “Jane” :last-name “Smith”}


do it like you would JSON, that's one way to approach things