Fork me on GitHub
#beginners
<
2019-06-22
>
ahmed1hsn13:06:23

Why promesa.core/do* macro is'nt working? (p/do* (let [a (rand-int 10) b (rand-int 10)] (+ a b)))

sullyj315:06:17

@crispin Cheers!

ashnur17:06:48

what can you teach someone about clojure in 15 minutes if the person only has a slow laptop with bad 3G connection and with no java installed? How would you go about helping them setup a modern repl and dev environment for clojure/clojurescript?

dpsutton17:06:23

what languages do you know that you could personally get that to happen? those are some pretty serious constraints

ashnur20:06:06

javascript, usually anything else that's expected to be installed on any linux or osx machine. Maybe not windows, slightly more constraining environment from this aspect.

dpsutton17:06:41

but i would maybe install planck if you had 15 minutes and 3g connection. seems like the smallest binary to get a running clojurescript setup. I don't think a modern repl and dev setup are achievable in this time frame if java is not around.

ashnur20:06:36

Thank you for understanding my questions correctly. What bothers me is not the lack of options for such constraints, but the utter lack of consideration for those who might not have all the time and resources that 99% of current clojure devs had when they were learning clojure.

dpsutton20:06:01

my original point was i don't think anyone can get a "modern dev setup" up an running in 15 minutes with 3g speeds

dpsutton20:06:57

I can't imagine getting a jvm installed with those constraints so clojure can't get around that

ashnur20:06:14

Exactly my point. Planck seems like a good option.

ashnur20:06:23

what I am trying to get at is that we agree on your assessment of the situation, what I disagree is the approach that this is completely normal. Yes we have to spend immense amounts of time and resources to do our work! Yes that no one who doesn't spend this time should be able to do what we do!

ashnur20:06:41

it would make sense if that effort would be something other than the expression of personal preferences and tradition

ashnur20:06:11

but actually, the current attitude is the exact opposite: https://clojurians.slack.com/archives/C03RZGPG3/p1561320484462100

ashnur20:06:37

we cherish that we can spend this much time and we wish we could spend even more, make it even harder!

dpsutton20:06:42

I don't understand your point. It seems sean went out of his way to record a screencast to help others? Is that a bad thing? It seems quite laudable and i've saved his rebl demonstration for later viewing. I haven't used it yet and I hope to learn from him.

sveri20:06:07

While I dont understand what @'s video has to do with this I think this is a valid reminder. Downloadsize of jvm and clojure tools is a barrier to entry. I dont think it was any different back then and the solution was to have CDs you could buy or let yourself send via postal services with the needed tools. For instance there were services that send Linux distributions around. Anyway, wanting to have it setup in 15 minutes with such a connection is not a realistic thing to do. Back then in the usenet and IRC time you needed to have a lot of patience and you were constrained by a lot of stuff, it was not much different.

andy.fingerhut20:06:18

With those kinds of bandwidth and processing constraints, the "15 minutes" part seems to become a barrier. If you give instead a day to download stuff first, then start installing things and using them, a lot more possibilities open up. With the 15 minute constraint (for what reason that is an interesting constraint, I do not know), it seems the best is to go to one of several web pages set up that let you try things out without having to install any software locally, except a web browser, which I am hoping is already installed on your machine.

ashnur20:06:35

You are all getting hung up on the specific example 🙂

ashnur20:06:58

my point is that every new line of documentation, every new minute of video that "teaches" something takes time away from actual learning and it's just a barrier, a kind of "grunt work" that one has to do Knowledge isn't something that can only grow...

andy.fingerhut20:06:12

What is the general point you are trying to make? That modern development environment ignore processing and bandwidth constrained environments, and do not target them? That we knew.

ashnur20:06:43

@ no, actually my point is that you accept that situation and by this actually create the situation

ashnur20:06:53

i mean not you personally of course 🙂

andy.fingerhut20:06:03

If your point is that some documentation and videos are less productive uses of one's time for learning than others, that we also knew.

ashnur20:06:18

there is no way for me to know how much anyone here specifically does or takes away of this and would not like to assume in either way...

ashnur20:06:19

@ from your responses it seems to me that you expect me to say something new to you. As if my message would be something that you don't know yet, and if I tell you then you will "understand" me and we will all live happily ever after? 🙂

andy.fingerhut20:06:50

The best answer I know to "use your time productively for learning, when you want to learn something" is to try to find the most time-productive learning resources for that topic that you can. Asking for recommendations, preferably ones that leverage what you already know, is often a good way forward there.

seancorfield20:06:43

I’ve resisted producing videos for a long time — years — because I really couldn’t get my head around how anyone could learn best from watching something… But, apparently, we do now have a generation of programmers who really do expect to learn from videos, and don’t get what they want from books. That’s part of what “blows my mind” — the shift in how people learn.

seancorfield20:06:08

I almost feel like I’ve been “bullied into making videos” 🙂

ashnur20:06:14

I love to watch some videos

seancorfield21:06:12

Funnily enough, this topic came up in Defn #51 which was just recorded this morning… and I talked about how there weren’t really even many books published when I got started — compared to what we take for granted these days.

seancorfield21:06:58

Design Patterns, for example. I’d been doing C++ in production for a few years before the classic “Gang of Four” book appeared. Design Patterns were the “new hot thing” and conferences were full of talks about them. So much stuff that we all take for granted today didn’t exist back then.

andy.fingerhut21:06:49

ashnur, I am not sure what you mean by "Knowledge isn't something that can only grow...". Are you saying that you think it can "shrink", if you spend time on the wrong things? Or something else?

ashnur21:06:12

what i love most are not videos, podcasts, books or even referece but tests and bootstrap-boilerplate configs. Something what you get with create-react-app (although i especially dislike that one example, but whatever, good for the point 😉 )

seancorfield21:06:58

Learning through doing, you mean? Yeah, that was pretty much the only option for folks back in the day.

ashnur21:06:06

@ Yes, there is such a thing as "negative" knowledge, you can spend so much time reading docs that you don't practice and actually forget a lot

ashnur21:06:47

well, i am relatively old, i have been doing programming for money for 15+ years now

andy.fingerhut21:06:47

Sure, when it comes to learning the active process of developing software, practice is needed. Hopefully a good teacher will understand that and encourage lots of practice, once enough to try something new has been taught.

seancorfield21:06:39

This weekend I’m working through the 3rd ed of Web Development in Clojure, mostly because I want to get up to speed on “modern ClojureScript” in terms of tooling etc. I have the PDF open in a browser and I’m trying out every example in the book, running the code… I think it’s important to spend time learning. I like the “Pragmatic Programmer” book’s advice to learn a new language every year — but that’s much harder than it sounds, even beyond finding the time to read/practice in a new language that you won’t get to use day-in, day-out at work.

ashnur21:06:29

I don't know how you find the time. I barely am able to keep up to date next to my work 😞

seancorfield21:06:04

I don’t find as much time for it as I’d like. Much the same as I don’t find as much time as I’d like for writing articles, doing open source work, and making videos 🙂 At least I can claim some of the open source work is for my employer and just time there, since we rely so heavily on so many libraries (and it’s a big part of why I contribute/maintain OSS projects).

john18:06:24

https://www.maria.cloud/intro is a pretty quick way to learn ClojureScript with just an internet connection

nate_clojurians23:06:25

so I have a map of direction-to-coordinates like {:north-east [3 3] ...} and I want to transform it to {:north-east actual-thing-at-coord ...} but only if the thing exists in that coordinate. I can think of a few ways to do this but it feels like brute force, like there must be some slick way to transform a value to another thing but if nil then exclude the key entirely

nate_clojurians23:06:54

I could reduce to do it but there's gotta be another way

andy.fingerhut23:06:34

when you say "but only if the thing exists in that coordinate", what do you want to happen if no thing exists in that coordinate? Leave the key and value as :north-east [3 3]?

nate_clojurians23:06:52

no, exclude the key entirely

nate_clojurians23:06:59

I suppose I can comp a map and filter

seancorfield23:06:08

Sounds like reduce-kv to me…

seancorfield23:06:30

(reduce-kv (fn [things dir [x y]] (if (exists board x y) (assoc things dir (get-item board x y)) things)) {} direction-to-coordinates)

seancorfield23:06:50

Modified per whatever your exists/fetch logic is.

nate_clojurians23:06:17

in my case

(reduce-kv (fn [m k v]
               (cond-> m (cells v) (assoc m k (cells v))))
             {}
             (maze-cells-around-intersection col row))

nate_clojurians23:06:37

I could use a let to avoid the double-fetch I guess

nate_clojurians23:06:22

(reduce-kv (fn [m k v]
               (let [cell (cells v)] (cond-> m cell (assoc m k cell))))
             {}
             (maze-cells-around-intersection col row))

dpsutton23:06:21

The cond-> doesn’t buy you much. You could just use an if-let

nate_clojurians23:06:54

oh, forgot about that one

nate_clojurians23:06:42

the cond is making it return the map

nate_clojurians23:06:46

if the condition is false

nate_clojurians23:06:16

so cond-> vs if-let with an else

seancorfield23:06:05

(if-let [cell (cells v)] (assoc m k cell) m)