13 ms·
Um... I didn't write the example. I took it from a site that encouraged developers familiar with a language to submit solutions. The developer of the Java so
by bayareaguy 19y ago
Um... I didn't write the example. I took it from a site that encouraged developers familiar with a language to submit solutions.
The developer of the Java solution posted something I'd consider reasonably representative of the Java I would likely encounter from most Java programmers and I while I have almost no personal experience with Ruby, I have the feeling the Ruby solution is reasonably close to what Ruby programmers write.
While you can write concise code in any language, it seems few Java programmers bother to.
Perhaps you should submit your solution to the original site: http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/
- edgeztv 19y agoUsing an example from a benchmarking suite to illustrate language conciseness doesn't make any sense. We all know that conciseness is inversely proportional to speed. Whoever wrote that Java code was trying to write the most performant, not the most concise code. He did a great job, by the way, since for that particular benchmark, Java outperforms Ruby by a factor of 20! (http://shootout.alioth.debian.org/gp4/benchmark.php?test=sumcol&lang=all http://shootout.alioth.debian.org/gp4/benchmark.php?test=sum...) Sorry for initially assuming that you wrote the code. I wasn't familiar with that site, so I didn't register your original allusion to it.
- bayareaguy 19y agoAu contraire, the very fact that the programming benchmark site neither rewards or punishes conciseness makes it a good place to see how important it is to the average programmer when also dealing with an explicit performance criteria. Also, I think your statement that conciseness is inversely proportional to speed is rarely true. It certainly doesn't hold for the programming examples at the shootout site.