On 05/01/2016 13:44, Josh Kamau wrote:
Here is an extremely simple example:
Problem: add a list of numbers
java: You put something like this in a class in a method
int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;
int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
sum = sum + i;
A proper comparison extends beyond a lines of code comparison. Clojure is a
functional language, while Java is object oriented. If you haven't seen it,
an excellent talk comparing the 2 approaches can be found here:
https://www.youtube.com/watch?v=Tb823aqgX_0
Aria Media Sagl
Via Rompada 40
6987
While these examples are good (there is also a good one in Suart Halloways
book for instance) I think it would be better to look at the difference for
a whole project. There is for instance a talk from Nokia Bristol a few
years ago (Now MixRadio) where they went from 44K LOC to 4K LOC with more
On Jan 5, 2016 7:49 AM, "gvim" wrote:
>
> On 05/01/2016 13:44, Josh Kamau wrote:
>>
>> Here is an extremely simple example:
>>
>> Problem: add a list of numbers
>>
>> java: You put something like this in a class in a method
>>
>> int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;
>>
>> int sum = 0
On 05/01/2016 13:44, Josh Kamau wrote:
Here is an extremely simple example:
Problem: add a list of numbers
java: You put something like this in a class in a method
int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;
int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
sum = sum + i;
Here is an extremely simple example:
Problem: add a list of numbers
java: You put something like this in a class in a method
int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;
int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
sum = sum + i;
}
return sum;
clojure: You put this in a clojure names
Dear,
In order to good understand the powerful of Clojure,
I have heard that compare to a code in java you need only few lines in
clojure.
Is that true ?
If it is the case, have you a sample of the 2 codes ?
I appreciate your help.
My Kind regards,
Thomas
--
You received this message because y