Fork me on GitHub
#clojure
<
2016-11-13
>
pvinis02:11:16

is there a project on github that has clojure as backend, clojurescript as frontend, that i can take a look at?

akiroz04:11:15

hey guys, got a general question about programming: How do you usually keep track of the state of your code base when hacking on a moderatly sized project? The problem I get all the time is that before I start, I only have a general idea about the implementation (something like a architectural diagram or a list of modules with their responsibilities). When I actually start coding, I need to decide on the concrete shape of my data or the calling conventions of my functions and those depend on my use cases and implementation difficulty. As a result I end up jumping all over the place in my code base and writing bits of stuff everywhere, most of the time I'll forget to implement a piece of code somewhere when I try to run it. How do you guys tackle this problem? or is there something wrong with my approach?

seancorfield04:11:28

@akiroz We tend to write tests to describe the behavior we want (and now we also write clojure.spec definitions for the data). That serves as documentation and also drives our development.

fellshard06:11:51

Sounds like you need a little organization / focus. ๐Ÿ™‚ What tests help you do is focus on implementing exactly what's necessary to implement a specific scenario. If you think of something to touch later, that can actually be a good place to drop something like a 'TODO comment', since it's searchable. Then, once the test has passed, you can go back to all those marked points, fix anything you had in mind, decide whether to make new tests to cover scenarios you'd thought of along the way, etc.

fellshard06:11:42

Basically, give yourself a way to focus on one thing at once; leaving markers in the code for in-place modifications, tests for new slices of functionality to add, or perhaps a whole document for design directions to explore.

fellshard06:11:29

Then it's out of your head, on paper, searchable, revisitable, and you won't have to bounce around so much just to make sure you caught everything. ๐Ÿ™‚

wei08:11:02

@pivinis not sure exactly what youโ€™re looking for. for Hello World Iโ€™d recommend something like this: https://github.com/clojure/clojurescript/wiki/Quick-Start. For real-world apps, there are plenty. A good place to start looking might be https://github.com/omcljs/om under "Applications built with Om"

kauko12:11:27

@eraad what does its say if you use a timezone like "+01:00"?

eraad13:11:55

@kauko it changes the presented date but always shows it in UTC using the โ€œ-"

eraad13:11:43

I think it explains the behaviour ๐Ÿ™‚

tdantas14:11:27

hey guys, what/how you normally does to mock http requests on tests ?

eraad14:11:46

if you are using pedestal or ring, those libs provide mock functions

eraad14:11:12

otherwise, just use maps

tdantas14:11:10

> otherwise, just use maps that got my attention ! suppose I have my own namespace foo.http and I have my function get something like that

(defn get [url] 
    (clj/http url))

tdantas14:11:43

how could I use maps @eraad to avoid hit the network ? didn't get your idea

Prakash14:11:03

or u can use with-redefs to redefine the get function to return the response - https://clojuredocs.org/clojure.core/with-redefs

tdantas14:11:23

cool @pcbalodi that is really interesting !

tdantas14:11:35

thank you guys !

tdantas14:11:04

thanks mate ! @eraad :thumbsup:

curlyfry15:11:47

Hi, I did an introductory "lunch and learn" lecture on Clojure at my workplace last week (some teams at my work use Clojure, some have never seen it). Here are the slides if anyone wants to use them for their own intro talk (as is or as a reference). https://docs.google.com/presentation/d/1GGqkAlBSmZtRAlGEylDjTioUbmdLEAcRenBbif8VZhA/edit?usp=sharing

roelofw18:11:51

What is the best way to recieve some 4700 images from a external api. I did this on ruby and I wonder if this can be made faster with clojure and maybe luminus

benzap21:11:36

@roelofw Looked over ruby and multi-threading, and it seems to suffer the same issues with the Global Interpreter Lock as python, so multi-threading might not offer up as much of a performance increase as in clojure (at least it won't be as easy) There are several ways to receive from an external API quickly, but lets focus on being able to perform parallel requests. The preferred way might be via core.async, which offers the ability to perform several requests in parallel through either a thread-pool, or through an asynchronous event loop. Even if you don't end up using core.async, I recommend you read up on it, it makes a lot of parallel operations ten times easier.

roelofw21:11:24

@benzap so I could read up the numbers and as soon as I have the first number. I could parallel download the rest of the data of a image and so on ?

roelofw21:11:37

I will read up about core.async

roelofw21:11:43

thanks for the tip