Live data from Hacker News

Counting Clojure Code

aaroniba.net

11–13 of 13 posts

Re: Counting Clojure Code

#11
>Obviously

``` (f a b c) ```

> is the same "amount" of code as

> `(f a b c)`

Yes, obviously! But they do not take the same number of lines - one is three lines and the other is one line.

It's sort of funny to me- number of lines doesn't paint the picture we want it to... so let's change the metric! Our code is special, anyway.

Re: Counting Clojure Code

#12
post #5

Earlier quoted context omitted.

I think this heuristic is using lines-of-code as a proxy for simplicity, in the simple-vs-easy sense. All other things being equal, and presuming the difference is architectural rather than an artifact of a too-clever coding style, I would tend towards the shorter library too.

> All other things being equal... ...but they're not. Perhaps one time in 50 you'll find a topic so well worn that you have choices between multiple mature, stable libraries with good APIs that lets you dig into the source code to see how nice it is (by whatever metric) to decide if you want to use it. Perhaps what, json parsers? I can barely think of any other examples. It's a completely pointless metric. The beauty…

I agree there are many considerations when choosing a library, but conciseness does come up. For example, I was recently impressed with how concise http-kit is. The author seems proud of it too:

http://www.http-kit.org/http-kit-clean-small.html

You and I probably just have different values on this matter. Your comment implies that conciseness is merely "nice", so I'm guessing you just don't value that aspect of code as highly as I do.

Re: Counting Clojure Code

#13

Earlier quoted context omitted.

> All other things being equal... ...but they're not. Perhaps one time in 50 you'll find a topic so well worn that you have choices between multiple mature, stable libraries with good APIs that lets you dig into the source code to see how nice it is (by whatever metric) to decide if you want to use it. Perhaps what, json parsers? I can barely think of any other examples. It's a completely pointless metric. The beauty…

I agree there are many considerations when choosing a library, but conciseness does come up. For example, I was recently impressed with how concise http-kit is. The author seems proud of it too: http://www.http-kit.org/http-kit-clean-small.html You and I probably just have different values on this matter. Your comment implies that conciseness is merely "nice", so I'm guessing you just don't value that aspect of code…

We'll have to just disagree.

I place zero value on the detail of the implementation of a library; only on the API that I use.

It's like picking a radio at the shop by opening each of them up and inspecting the quality of soldering and board schematics.

...yes, you'll get a better radio if you do, but if you're furnishing a kitchen, you'll spend the rest of the month opening appliances and looking inside them instead of building your kitchen.

I guess it depends what you're doing.

/shrug

Post reply on HN