in reply to Re: 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
Define "flexible" in this context. C is a much simpler language than Perl and much easier to learn. C is however much harder to use to do simple things that in Perl you take for granted, like using the contents of a variable as a character, string, integer, float, double, pointer, ... as suits the current purpose.
Programs written in any language are buggy when you don't do things right. Strongly typed languages tend to catch more silly errors at compile time where languages like Perl tend to catch those errors at run time (if at all). On the other hand languages like C allow you to more easily generate much nastier classes of bugs than languages like Perl (bad pointers tromping over memory for example).
It seems to me the reason there is a much stronger ethos of unit testing in the Perl community than in the C community is that the balance between run time and compile time errors is quite different between the languages. Perl requires run time testing to shake out the silly typo type errors that in C are found at compile time. My guess is that per line of code typical Perl tends to pack in more bugs than typical C, just because Perl can do a heck of a lot more work in one line than C can.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: compiling perl scripts aka why is perl not as fast as C
by moritz (Cardinal) on Mar 22, 2010 at 10:06 UTC | |
by Marshall (Canon) on Mar 23, 2010 at 00:52 UTC | |
Re^3: compiling perl scripts aka why is perl not as fast as C
by chromatic (Archbishop) on Mar 21, 2010 at 21:00 UTC | |
by GrandFather (Saint) on Mar 21, 2010 at 22:27 UTC |