in reply to Re^3: compiling perl scripts aka why is perl not as fast as C
in thread compiling perl scripts aka why is perl not as fast as C

C is a much simpler language than Perl and much easier to learn.
Surely you must be joking.

Not at all. But remember what the C language is without its standardish libraries - some simple control structures, a handful of data types, some arithmetic operators, some bitwise operators and some boolean operators. The core language is very small. Perl's core language on the other hand is huge and contains all sorts of subtle special magic. I agree it is harder to use C than Perl, but that is not the same as learning the language.

No, it's because it's immensely easier to write tests in Perl than in C.

I admit I write C++ rather than C so I don't know how hard or otherwise it is to write tests in C. However, in C++ using easily available test frameworks it's not a lot different to write test code in C++ than it is in Perl.

The bug defect rate tends to be constant per SLOC.

That would be my first thought too. However Perl rather encourages concatenating the odd map, grep, join, split and so on together into a single succinct line - what could be written over several lines collapses to one. Therein lies the problem with SLOC and Perl exacerbates the issue by often allowing the code to be as readable in the compact single line form as in the multiple line form.


True laziness is hard work
  • Comment on Re^4: compiling perl scripts aka why is perl not as fast as C