code-reviews

ul 2015-06-12T06:29:09.000178Z

@kamillelonek: May be https://www.jetbrains.com/upsource/ will fit your needs? I have no experience with that, but JetBrains usually make good tools.

kamillelonek 2015-06-12T06:30:17.000180Z

thanks

kamillelonek 2015-06-12T06:30:21.000181Z

I'll check that

danielcompton 2015-06-12T07:21:46.000182Z

@kamillelonek: I’ve had great results with Gerrit for code reviews, but it’s a little bit more heavyweight than a one-off code review. gerrithub is free for OSS

kamillelonek 2015-06-12T07:22:55.000183Z

I was thinking about something small, gerrit is quite big as I've tried it

zoldar 2015-06-12T07:25:16.000184Z

@kamillelonek: Maybe http://codebrag.com/ ?

kamillelonek 2015-06-12T07:26:00.000186Z

still, it need to be self hosted 😉

zoldar 2015-06-12T07:26:11.000187Z

@kamillelonek: it is, it's downloadable

kamillelonek 2015-06-12T07:27:10.000188Z

seriously, I need a dead simple solution, something like GitHub gists, but with better commenting options, I'll stick to gists for now, but in case I find something I'll post it here

zoldar 2015-06-12T08:17:54.000189Z

@kamillelonek: oh crap, I got it backwards, sorry

kamillelonek 2015-06-12T19:17:56.000190Z

may I ask for a code review: https://gist.github.com/KamilLelonek/304699d8803e699bfd45

gjnoonan 2015-06-12T19:53:46.000192Z

@kamillelonek: I would be careful of your naming, and try to make it a bit clearer -> declaring github-user-public-keys-url as a def but also in the parameter of a function for instance. Think about namespaces too, eveything in here is specific to github so I wouldn’t have github in all the defn’s.

gjnoonan 2015-06-12T19:54:32.000193Z

@kamillelonek:

(defn github-user-public-keys-json [github-user-public-keys-url]
  (json/read-str (github-user-public-keys-response github-user-public-keys-url) :key-fn keyword))
could become something like
(defn github-user-public-keys-json [public-keys-url]
  (let [response (response-body public-keys-url) ]
    (json/read-str response :key-fn keyword)))

gjnoonan 2015-06-12T19:56:01.000195Z

github-user-public-keys-response makes more sense becoming response-body, and it is then re-usable and it doesn’t matter what you give to it (within reason)

kamillelonek 2015-06-12T19:57:35.000196Z

ok, your points are very valid

kamillelonek 2015-06-12T19:57:45.000198Z

thank you for the input

gjnoonan 2015-06-12T19:58:33.000199Z

You’re welcome :simple_smile: feel free to come back for further input after you have made changes

gjnoonan 2015-06-12T20:01:11.000200Z

I am not sure If json should be in the function also, as it is implied that json will be returned. Which it will not.

gjnoonan 2015-06-12T20:05:06.000201Z

perhaps public-keys-for-user and then pass a username in rather than the whole url.

kamillelonek 2015-06-12T22:05:03.000203Z

@gjnoonan: what do you think now: https://gist.github.com/KamilLelonek/304699d8803e699bfd45?

gjnoonan 2015-06-12T22:37:35.000204Z

@kamillelonek: Sorry for the late reply, better, but still watch out for your naming.

(defn- all-members-json []
  (:body (all-members-response)))
For instance, is json needed in the name? I don’t feel it adds any value. It would be better mentioning that in the docstring.. member is being mentioned a lot in the functions, which implies to me it needs to be separated.. A few more little things too, but again relating to naming.
(defn- all-members-public-keys-urls []
  (map github/member-public-keys-url (all-members-logins)))
I feel that a verb/action needs to be the function of the map. What are you intending to do with all-members-logins ? github/member-public-keys-url doesn’t tell me.

kamillelonek 2015-06-12T22:42:02.000205Z

> Sorry for the late reply

kamillelonek 2015-06-12T22:42:14.000206Z

I'm so grateful you are helping me at all

kamillelonek 2015-06-12T22:42:30.000207Z

I don't even expect to have an immediate response

kamillelonek 2015-06-12T22:43:57.000208Z

in the first case when I'm using json is to distinguish function name from the other one without json

kamillelonek 2015-06-12T22:44:26.000209Z

it's not needed at all, but I don't have a better name, all-members already exists

kamillelonek 2015-06-12T22:47:57.000210Z

naming is kinda hard for me, when I come from OO where it was easier to have objects and name their methods

kamillelonek 2015-06-12T22:48:20.000211Z

especially naming modules and namespaces is what I'm still getting used to

gjnoonan 2015-06-12T22:54:48.000212Z

Which is why I think something like a response-body function, which grabs the body of any response you pass into it may be a better option.

gjnoonan 2015-06-12T22:55:20.000213Z

member-public-keys-with-id wheres the id from? does it take an id or is it returned with an id?

kamillelonek 2015-06-12T22:57:37.000214Z

hm, it returns id as well

gjnoonan 2015-06-12T23:00:40.000215Z

is this always going to be used just for getting public keys?

kamillelonek 2015-06-12T23:01:54.000217Z

yes