This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-25
Channels
- # aleph (1)
- # beginners (72)
- # boot (3)
- # cider (28)
- # cljs-dev (193)
- # cljsrn (11)
- # clojure (73)
- # clojure-brasil (3)
- # clojure-gamedev (2)
- # clojure-russia (6)
- # clojure-spec (30)
- # clojure-uk (26)
- # clojured (1)
- # clojurescript (32)
- # code-reviews (9)
- # core-async (4)
- # datascript (5)
- # datomic (9)
- # dirac (38)
- # fulcro (23)
- # garden (11)
- # leiningen (1)
- # luminus (11)
- # lumo (6)
- # off-topic (17)
- # quil (2)
- # re-frame (2)
- # reagent (3)
- # ring (3)
- # shadow-cljs (12)
- # spacemacs (4)
- # sql (2)
- # unrepl (85)
- # vim (3)
Hello everybody! After writing some advent of code solutions and playing with some other Clojure code. I think it's time for me to learn by doing something "real". I write a small scrapper to check my "library borrowings". https://github.com/Charlynux/library-monkey At the moment, the code is pretty small (100 lines) and straightforward (no error-handling, no tests,...). It works, but I would appreciate some review of my code. All advices/critics are welcome. (A more experiment clojurian can probably point some "not the Clojure way here" or "too much code there".)
@charles.fourdrignier Hi, a few notes from a first look:
You should use a formatter, the lines in your imports are not aligned. If you use the ->> or -> macro and call a function with only one argument you can omit the parantheses like so: (-> (foo bar baz) keyword)
Dont use use
for imports, instead prefer require :as
In html_parse.clj on l.21 you start with the data as a first argument to the threading macro. In l.35 you dont do that but instead start with the function and data as argument. I think it doesnt matter which style you choose, but I think its important to be conistent at least
I dont like the formatting of network l.14-20, this could be more compact and I would make the URI a var. The same in get-borrowings
As I see this often, coming from a java world I find it weird that namespaces are used so seldom. Please see here for the convention for java packages: https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Thanks a lot ! I will update my code with that.
@charles.fourdrignier no problem, I am also open to discussion, of course