Fork me on GitHub
#beginners
<
2017-01-17
>
mikepjb10:01:21

@tbaldridge thanks, do you have other suggestions written up else? I see you have a profiling video so will check that out in the meantime!

poooogles11:01:05

@tbaldridge Thanks, I've moved to an unordered pipeline and that seems to have done the trick.

schmee12:01:26

what does “unordered pipeline” mean in this context? pipeline-async?

yogidevbear13:01:04

Am I understanding :require correctly here: (:require [clojure.browser.repl :as repl]) means I am using the clojure.browser.repl library in it's entirety, aliased as repl (:require [cljs.core.async :refer [<!]]) means I am using asynchronous take (`<!`) from within cljs.core.async without requiring the entire cljs.core.async library. Is this correct?

ejelome13:01:40

the first one is just aliasing the namespace, the second one is importing a specific function from the namespace

yogidevbear13:01:37

How does something like (:require [clojure.some.namespace :refer :all]) differ?

ejelome13:01:26

it differs because it's putting all the function of that namespace in the current file

ejelome13:01:39

if you know python, it's like *

ejelome13:01:59

from clojure.some.namespace import *

yogidevbear13:01:15

Okay, so if I'm using the alias :as form, this is calling functions from within the original namespace, whereas :refer :all imports all those functions into my current namespace and I can reference them directly as if they'd been defined within my namespace?

yogidevbear13:01:04

e.g. repl.somefunction vs somefunction

ejelome13:01:07

=> (:require [clojure.string :as s])
=> s/split

=> (:require [clojure.string :refer [split]])
=> split

=> (:require [clojure.string :refer :all])
=> split

ejelome13:01:20

the 2nd one can only call split from the clojure.string namespace, because that's what it only referred the 3rd one can call all the keywords (whre split also comes from) of the clojure.string, because it referred all of its keywords

yogidevbear13:01:00

Perfect. Thanks @ejelome 👍

tbaldridge13:01:14

@yogidevbear use the first two though if you can, :refer :all can make code harder to read, since you have no clue where a given symbol is imported from.

tbaldridge13:01:39

about the only time I use it is when I'm testing [clojure.test :refer :all]

yogidevbear13:01:59

Will do. I remember seeing it in Living Clojure (which I'm working through at the moment) and just wanted to make sure I grokked the differences

seako18:01:04

hello, i’m wondering what folks in this channel recommend in the way of resources to introduce someone to programming generally and to programming in clojure in particular

seako18:01:38

i was thinking that The Little Schemer might be a good first book since it seems to be good at introducing the habits of thinking of programming

seako18:01:07

but i’d love to know what else the community likes

schmee18:01:48

tbh I think clojure might be tough for someones first intro to programming

schmee18:01:08

I’d start with some Ruby or Python thing for beginners

gryffindorstudent19:01:50

@seako I've heard good things about The Little Schemer, another option would be SICP (also teaches Scheme)

ejelome19:01:27

I suggest HtDP

sveri19:01:49

I think FP in general maybe harder to grasp if you have years of OOP behind you. But if your mind is free I guess it would be easier to start with clojure. That said, why should it be easy in general? Programming can make a rocket fly to the moon, I dont see how that should be easy 😉

ejelome19:01:03

^ right, I even remembered looking for variable when I started learning Lisp, fun times 😄

schmee19:01:48

yeah, there is just so much that is different from “regular” programming that it might just confuse a beginner

schmee19:01:31

when you are learning, I think you should just focus on trying out stuff and not care too much about best practices

ejelome19:01:50

that's true, by experience, I actually learn faster and understand better if I build something that interests me, than mere following tuts

seako19:01:15

@ejelome that’s How to Design Programs, right? i’ve never read it but i like that it’s from one of the authors of the Little books. kind of fun that they start you out with an algebra of pictures. very different from the usual introduction.

ejelome20:01:00

yes, same author, but I think the main goal of his books is geared towards how to solve problems (how to think), rather than teaching you how to code; and as I have not come from a compsci background but merely a self taught individual, I find that I'm going into that direction, how wonderful if a newbie will start from that actual point I will go into, after some years of coding, kinda sad for me and ironic to them

seako23:01:37

thanks all for you input and suggestions