3 ms·
Well okay let me elaborate on my question. pg has stated that code brevity is one of the main design goals of arc. But what is pretty obvious is that code brev
by dusklight 19y ago
Well okay let me elaborate on my question.
pg has stated that code brevity is one of the main design goals of arc. But what is pretty obvious is that code brevity is not the only consideration. It is desirable to be able to write very short code, but it should be readable as well. If you write very short code that is difficult for other people to read, that is bad enough. If you write very short code that ends up being difficult even for yourself to read -- then we have a problem.
The above ruby code snippet is a great example of code where reducing the length not only did not reduce readability, but actually increased it. I know some people have complained about it being obfuscated on this board. But to me, and I am sure to a number of other people on this board, it was easy to understand, intuitive even.
so .. in arc, what would be a similar way to create a list of numbers from 1 to 100, and to evaluate the sum of that list?
- tel 19y agoThat question is somewhat interesting just a little off-topic in this thread. In Arc, that line would be: (reduce + (range 1 100)) which is nice, but not much different from Scheme. Pretty readable.