Fork me on GitHub
#off-topic
<
2019-10-26
>
gklijs12:10:30

Just finished listening the latest 'The REPL' Podcast. It's kind of amazing how similar the stack they use is to my bank pet project. Even down to Bulma for css. Podcast: https://podcasts.google.com/?feed=aHR0cHM6Ly9mZWVkcy50aGVyZXBsLm5ldC90aGVyZXBs&amp;episode=aHR0cHM6Ly93d3cudGhlcmVwbC5uZXQvZXBpc29kZXMvMzAv Pet project: https://github.com/openweb-nl/open-bank-mark

✌️ 4
richiardiandrea17:10:38

It is interesting he also mentioned Adam, which is based in Vancouver here, and I know well. Small world 😃

heyarne14:10:08

I just updated my spacemacs distribution, it's super easy to setup linting with clj-kondo and joker and it helps my workflow a lot. Thanks to the authors! @borkdude @roman.bataev

👍 8
8
Denis G19:10:19

I didn’t think a lot on this topic, so maybe I am talking nonsense How does TDD and BDD work in functional programming? Are these ideas only relevant to OOP?

Denis G19:10:29

It feels like with the REPL-driven-development (which I love) there is no emphasis on writing tests, and this is why I’d like to know how does this relate to Clojure and whole FP in general

dominicm19:10:15

They're still relevant to languages without a repl

Alexander Heldt19:10:32

you can still do TDD while being highly interactive with the REPL. an example https://www.youtube.com/watch?v=GtuP8byblT4

Denis G19:10:36

but what about BDD and mocking and stuff. How does this work in FP? Is it even necessary?

sammikko19:10:39

Trying out things in REPL gives you some security but I think tests should guard again regression.. when you change some thing X and then Y breaks...

sammikko19:10:41

Most of the things are just functions and you can mock them...

seancorfield20:10:16

@denisgrebennicov I don't understand why you think TDD or BDD wouldn't work in FP?

Denis G20:10:35

idk. I guess it is wired in my head, tdd. bdd. mocking with imperative OOP programming

Denis G20:10:33

I just didn’t see/read/heard about it in FP channels, articles

andy.fingerhut20:10:10

I mean, tdd could probably technically be an approach adapted to nearly any human endeavor where one is creating a device to serve some purpose, yes? First create the experiment that would distinguish working vs. not working, then try to make the device that passes the experiment.

andy.fingerhut20:10:03

I am not claiming it is necessarily a good approach for any or all such endeavors, but that is the basic idea, as I understand it.

Denis G20:10:16

I guess all this Mockito frameworks took me off-guard

sheluchin20:10:41

I wonder if there's another takeaway to this. Could there be a interactive developer interface that makes use of the REPL while at the same time piping assertions into files to help in writing test suites?

sheluchin20:10:53

A REPL-driven TDD of sorts, with fewer manual edits...

Drew Verlee00:10:45

It sounds like your at that stage where your exploring the interactions between new ideas. Its generally a good thing to explore how things relate. The relationship between the repl and Tests is quite flexible. Keep in mind, were just talking about READ EVAL PRINT LOOP. So you can defiantly read a new expression and then EVAL it to see how it would effect a test suite. That is, run the tests every time you evaled a new form. However, i eval a lot of forms and running the entire test sweet each time might be cumbersome. I tend to just directly run the tests from my favorite editor manually. On testing, stubs, mocks. Nothing much is new between FP and OOP. All the options are still there. Clojure.Spec has excellent support for stubs and TDD if you want. I find understanding the logic to be something i have to explore a bit more before i can create a spec for it though, and so its hard to do right up front.

Drew Verlee00:10:33

Basically, if it helps, the REPL is purely additive. You have another way to interact with the system. It means nearly everything you valued before is still there.

sheluchin10:10:29

Thanks for the feedback, @U0DJ4T5U1. That is quite helpful, and you're right, that's exactly the stage I'm at now. I have watched a few videos on Clojure.Spec and I'm really looking forward to using it, but haven't got there yet. I also haven't actually started with unit testing, as I'm just working my way through Brave Clojure and the Fulcro3 tutorial, so I guess I'm just extrapolating the limited knowledge of Clojure that I do have. I mean, Python is my bread and butter, and I do use the REPL there, but the persistent nature of Clojure's data structures completely changes the approach for the better. I'm glad to have join Clojurians. Seems like a great community so far. Everything I've asked has received very thoughtful answers and it's making the journey smoother. Think I'll be sticking around 🙂

Drew Verlee18:10:58

Yep sounds good. I'm also working through the fulcro3 videos right now. The approach seems well thought out. I feel todo better would require a significant investment in retooling underlying ideas and tools (react, etc...). I dont really know what those would be. It might have more knobs then some applications need. But thats usually the trade off with a framework approach.

sheluchin18:10:30

It's a bit of a struggle for me to decide whether to learn the ecosystem and tooling vs. just making a working thing using the content in the lessons. Like, I almost decided to spend a few hours reading the shadow-cljs user guide today, but then decided to stick to a top-down approach for now.

Drew Verlee18:10:20

Doing the fulcro tutorials is a great idea imo. Your a bit in the deep end, but thats good as long as you dont get stuck.

sheluchin18:10:22

You're not the first person to mention that Fulcro is hard. What makes you say that?

Drew Verlee18:10:27

I don't mean its hard. I mean its a lot of functionality. I see it as a fullstack web solution that i assume ( i haven't used it in practice) could be applied to very complex web applications.

Drew Verlee18:10:16

complex meaning, could handle a significantly complex domain and performance requirements.

Drew Verlee18:10:21

I'm no expert here 🙂

Drew Verlee18:10:54

That being said, the ideas and methods the framework employees seem sound to me and its worth being exposed to them. Even if you realize, for one reason or another, you cant take advantage of them. I dont know what your goals are really, so i can't say its a good use of your time though .

sheluchin18:10:42

Ah, I'm still very early in. I'm just on section 4, and deliberately taking it very slowly so it sinks in before moving on. Switching back and forth between the video and the book. Haven't even got to the fullstack stuff yet. I'm not new to web development by any means, though.

sheluchin18:10:25

My goal is to be able to develop some product ideas that I have, and to transform the way I think about web development in the process. It's kinda working 🙂

Drew Verlee19:10:24

Yea. i would say your approach is reasonable.

Drew Verlee19:10:38

Here is a reddit post that compares fulcro to re-posh (from a year ago) i find having comparisons can be enlightening. https://www.reddit.com/r/Clojure/comments/8qgovx/reposh_020_released_use_datascript_as_your_data/

Drew Verlee19:10:34

Feel free to ask me questions.

sheluchin19:10:37

Thanks very much. Hopefully I don't make you regret that offer too much heh

seancorfield20:10:09

@alex.sheluchin Don't type into the REPL, type into your editor -- that's the "interactive developer interface" -- and then there's minimal manual editing since you're writing your test suites and just evaluating them into the REPL 🙂

sheluchin20:10:59

heh, yeah, I suppose that's roughly what it is in the first place 🙂 I do have a tendency to try out a lot of stuff in comment forms but haven't quite gotten to writing many tests in Clojure yet. I'm just barely discover the power of Clojure's REPL and letting my imagination run away.

seancorfield21:10:20

At work we have about 20k lines of tests compared to 70k lines of production code, and that test code is a mix of styles. Some test-first, some generative, some rely heavily on mocks, some are BDD-style...

dpsutton21:10:33

I think @noisesmith made a library to capture repl forms into a test file. I’ve wanted to play with it but never have

noisesmith21:10:33

the goal was to turn repl experiments when developing into tests that detect regressions