ptkwt
11/19/2003 7:24:00 AM
In article <20031118183857.GB18667@student.ei.uni-stuttgart.de>,
Mauricio Fernández <batsman.geo@yahoo.com> wrote:
>On Tue, Nov 18, 2003 at 07:04:19AM +0900, Martin Weber wrote:
>> On Tue, Nov 18, 2003 at 06:47:00AM +0900, Josef 'Jupp' SCHUGT wrote:
>> > (...)
>> > The essential mistake is counting lines. What one should count is the
>> > number of characters.
>>
>> Sure.
>>
>> for (LI n=b.begin(); n != b.end(); ++n)
>> if (_a[nd].find(*n) != _a[nd].end())
>> ec++;
>>
>> The essential mistake is trying to count something. Go feel & figure.
>
>Somebody proposed the number of tokens as quite a reasonable measurement,
>to be taken with a grain of salt as all metrics.
>
And as I mentioned in the original post, the Ruby snippet is much more
'comprensible' (readable?) at a glance than the C++ one.
And just to introduce another measure: productivity. I did the original
Ruby prototype in 2 hours (including debugging the algorithm) and then set
out to 'translate' it to C++. It took me a couple of days (well,
probably about 10 to 12 hours total) to get it all working in C++. Now,
sure, I don't program in C++ every day so I might be a bit rusty, but
even if I double my C++ productivity, I'd still be more than 2 to 3X more
productive in Ruby.
Phil