This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-04
Channels
- # admin-announcements (14)
- # aleph (3)
- # beginners (75)
- # boot (95)
- # carry (4)
- # cider (23)
- # clojure (39)
- # clojure-android (3)
- # clojure-brasil (2)
- # clojure-dev (17)
- # clojure-gamedev (1)
- # clojure-mexico (12)
- # clojure-poland (12)
- # clojure-romania (1)
- # clojure-russia (10)
- # clojure-spec (8)
- # clojure-uk (36)
- # clojurescript (34)
- # core-async (4)
- # datomic (40)
- # emacs (1)
- # events (7)
- # hoplon (119)
- # instaparse (52)
- # keechma (71)
- # mount (4)
- # off-topic (9)
- # om (4)
- # onyx (3)
- # other-languages (23)
- # protorepl (3)
- # re-frame (9)
- # reagent (26)
- # rethinkdb (5)
- # spacemacs (2)
- # testing (1)
- # yada (1)
@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.
I wish there was more books geared towards web development - with titles like "microservices with clojure" "Build a webapps with clojure"
@lewix: I presume you've already found this one? https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition
@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 https://pragprog.com/book/vmclojeco/clojure-applied is a good 'intermediate' level book.
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)
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!
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.
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
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
@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
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.
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
oh, cool
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?
do it like you would JSON, that's one way to approach things