docs

About docs of Clojure & libs
arrdem 2018-01-05T01:33:27.000159Z

A quick cut at parsing doctests in @pithyless’s style - https://github.com/arrdem/stacks/pull/4. It’s definitely workable.

pithyless 2018-01-05T08:07:19.000110Z

Good point @noisesmith - I was aware of the ^:test metadata, but I did not want to clobber possibly existing tests attached to the var. (I always wondered why deftest works the way it does, why it’s not idiomatic to just see ^:test attached to the function itself. Or have you seen that in practice?) You’re right about making things simpler, it was a very rough cut just to be able to play with the “ergonomics” of the doctest approach.

pithyless 2018-01-05T08:08:40.000051Z

Very cool @arrdem! That was an unexpected and quick turnaround for a random comment posted to Slack 🙂

pithyless 2018-01-05T08:10:43.000243Z

I’ve found the doctest approach satisfying to encourage me to write documentation for public api functions, but I have not used it in anger on a project yet, because I was not sure if the >>, =>, and :> distinction was even a good idea. Was hoping for some feedback from others.

pithyless 2018-01-05T08:12:37.000144Z

Here’s an example borrowed from weavejester/medley, where I was trying to justify to myself that doctest trumps tests in another part of the app as a communication tool:

pithyless 2018-01-05T08:12:48.000066Z

(defn abs
  "Return the absolute value of number `x`.

  Works with all numbers supported by the runtime
  and correctly handles integer overflow, unike `Math/abs`.

      >> (abs -3)
      => 3

      >> (abs -3/5)
      => 3/5

      >> (abs -3.5)
      => 3.5

      >> (abs Integer/MIN_VALUE)
      => 2147483648
  "
  {:attribution "weavejester/medley"
   :added "0.1"}
  [x]
  (if (neg? x) (- x) x))

arrdem 2018-01-05T08:13:55.000108Z

@pithyless it's a neat little idea, and I already had 90% of the tools to hand 😛

pithyless 2018-01-05T08:15:37.000109Z

My line of thinking was can I get away with using doctest for communication and edge-cases, and test.check for completeness. ¯\(ツ)/¯ Not sure, but open to feedback.

arrdem 2018-01-05T08:16:36.000169Z

Yeah I totally buy that.

pithyless 2018-01-05T08:16:52.000102Z

@arrdem - you’re right, it does look a lot more sane and robust in your approach. 😄 I’m taking a week off for the holidays, but I’ll happily pick this up the week after next in anger 🙂

arrdem 2018-01-05T08:17:41.000130Z

Enjoy then! This fills a need for me at $DAYJOB so I'm throwing time at it somewhat actively. Would definitely be glad for the help when you're back tho, especially if you're a better hand with web/ring anything than I am.

pithyless 2018-01-05T08:29:44.000255Z

I wonder if @bozhidar would not be interested in joining this channel and adding his thoughts. His talk on the problems with the current clojure docs ecosystem was one of my inspirations to take a stab at this.

arrdem 2018-01-05T08:35:30.000182Z

Yeah. Part of my experience from Grimoire is that even though I built a dead-easy-for-me system for writing docs, its bar was still too high for most people to figure out how to contribute let alone contribute meaningfully. The goal of Stacks is essentially to ... just build a tool you can slap more frontends / DSLs ontop of so you can meet devs where they are and drive the activation energy price down.

arrdem 2018-01-05T08:36:30.000181Z

Anyway. Bedtime here.

bozhidar 2018-01-05T09:57:33.000032Z

Well, it seems there’s a problem of soliciting contributions across the board in the Clojure community. Forget about docs - most of the major Clojure projects have almost contributors outsider their primary maintainer(s). That’s a stark contrast with what I’m used in the Ruby community (for instance).

bozhidar 2018-01-05T09:58:11.000360Z

I’d normally expect people to contribute to things like REPLy, compliment, cljs-tooling, nREPL, etc like crazy…

bozhidar 2018-01-05T09:58:25.000130Z

And way more doc contributions, of course…

arrdem 2018-01-05T16:54:41.000471Z

Yeah. I don't really get it either, but I think part of the problem is that largely hostile core has discouraged the formation of a traditional community. Clojurians are more of a loosely affiliated user group than members of a community.

arrdem 2018-01-05T16:55:48.000143Z

There also seems to be a lot of code that's written by someone on contract, ossd and kinda left rather than meaningfully maintained or committed to community ownership.

alexmiller 2018-01-05T18:59:34.000352Z

@arrdem “largely hostile” is both wrong and deeply insulting. I’m at a loss as to what you think the 12k+ people here are if not a community.

arrdem 2018-01-05T19:14:25.000573Z

@alexmiller It has been the experience of many folks (myself included) that contributing to core is difficult. I understand why this is, meant no offense, and difficult or defensive would have been a better choice of words than hostile. My intent was to point out that this leads to the emergence of a different kind of broader community dynamics, not to cast aspersions at the warm and friendly people I’ve met here. I like your work enough that I’ve stuck around this long 😄