
The Arc Challenge in Ruby - wheels
http://blog.directededge.com/2009/12/19/the-arc-challenge-in-ruby/
======
jamesbritt
So, just how much code can I hide in a 3rd-party library or framework before
the LOC count begins?

That Ruby example clearly will not work without a bunch code (i.e., the whole
of Sinatra) that's not shown, and is not part of Ruby's std-lib.

See:

<http://news.ycombinator.com/item?id=1005162>

but also

<http://news.ycombinator.com/item?id=1005155>

~~~
antirez
In the first place the rule that all the libs should be standard libs is non
sensical from the point of view of comparing languages power, so I think we
can safely suppress it and still consider the attempts valid.

Proof: if you want to measure the power of a language with this test,
enforcing that everything should be in the standard lib, and a language fails
at it, adding some code to the standard lib will change the power of the
language, but this is not possible because the syntax, semantic and behavior
of a language (i.e the language itself) is not changed by additions to the
standard library.

~~~
houseabsolute
But if you look at it another way, a significant portion of what's used in the
arc examples would not reach the bar of what's included in the standard libs
of some other languages. The fact is that what is in the standard lib of a
language is a totally arbitrary decision, and measuring any language's power
in a way that's dependent on whether or not a necessary library is in the
standard lib is silly.

The real test should be, "How short can you make this code using libraries
available for the language which would be generally useful working on some
other task as well."

~~~
geekles
The challenge should be LOC total, including the LOC of the libraries used.
That is the only possible way to compare apples to apples. Otherwise, what is
to stop you from wrapping the entire solution into a "library" and just making
a simple call-out to said library.

What is the total LOC of the implementation, period. Remove all ambiguity.

~~~
xtho
With respect to ambiguity: Wouldn't the LOC count have to also include the
code of the interpreter or how would you compare an interpreted language where
some method is "built-in" with another language where the method has to be
implemented in a library?

Anyway, LOC count is a fetish that wreakes havoc in language communities like
ruby. I'd be more interested in readability and clarity. Show the code to
somebody who knows the language only superficially and take the time the
person needs to figure out what the code does.

