4 ms·
This article does not measure what it professes to measure. When comparing a language to itself and for large programs (>1000 lines), line count is a decent met
by Locke1689 14y ago
This article does not measure what it professes to measure. When comparing a language to itself and for large programs (>1000 lines), line count is a decent metric for expressibility. However, for a short amount of code (like that found in Rosetta) and for comparing one language to another, you want to compare both line count and character count.
If you space a few lines of very expressive code out, you don't want that to penalize the results. Similarly, you don't want someone to cheat by just having one huge line.
Edit: I stopped reading when he started describing the fetching/parsing process. My objection is covered later on. Thanks to carlob for pointing this out.
I'll also note that being the best may actually be a bad thing. Perl can be quite succinct, but also quite noisy at times.
Similarly, while I'm a fan of K/J (and I pretty much guarantee that K is more succinct than Mathematica), I think that the code can be very difficult to read sometimes.
- carlob 14y agoDid you read the whole article? Towards the end it says: While the “Large tasks – Line count ratio” gives the most impressive result for Mathematica, I think that the “Large tasks – Character count ratio” is the really the fairest comparison.
- jacquesm 14y agoThis is a fairly meaningless comparison. Rosetta code is not written for terseness, there is no fair comparison about code length to be made based on these example solutions to common problems. You can be as terse or as verbose as you want in many languages (think forth, perl, apl). If you want to do a meaningful comparison pick a non-toy problem and write a full sized application, something that in the worst language is a few thousand lines with a proper UI, a web app, a desktop application and a large simulation of something or other. You will still have to account for language gifts such as libraries or built-ins somehow. And you tell the devs they get points for producing short code. Then you can compare along several axis, performance, code maintainability (closely related to how easy it is to read) and so on. That's useful data. This isn't, regardless of whether mathematica looks good. edit: ok. point taken.
- Locke1689 14y agoNo, he was right, I stopped reading when the author started discussing the mechanics of crawling web pages. I assumed that the blog post would be structured sensibly (analysis, then implementation).
- taliesinb 14y agoPerl's noisiness would probably be penalized by the token count metric from the article. Although you really need to have language specific lexers to do this properly.