Link to home
Start Free TrialLog in
Avatar of julian2000
julian2000

asked on

comparing Perl and C

How does Perl compare with C in terms of problem solving complexity?  
Please elaborate and discuss about this comparison (generic comparison and/or technical comparison).
And please suggest links to webpages that give extensive information about this comparison. Thank you very much!
(This is not a homework question. This is a discussion topic, so I need information for my research)
ASKER CERTIFIED SOLUTION
Avatar of shlomoy
shlomoy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shlomoy
shlomoy

I feel that They are the same in terms of complexity.
You just need to know what goes behind the scenes.
For example - allocation of memory for variables:
     in C usually, what you ask for is what you get
     in Perl - you get a bit more, as Perl's internals need more room for management and also in case you need that place further in time, a good exmaple for that would be allocation of an array in C vs. allocation of an array in Perl.

Anyway - there is no algorithmic problem you can't solve with either C or Perl - it all depends on the algorithm you devise :-)
in the Preface to the book
             Mastering Algorithms with Perl
             by John Macdonald, et al
they say:

"You can solve complex problems in Perl more quickly, and in fewer lines then in any other language."


Remember though, the nice thing about algorithms is that they don't depend on programming language. Compexity won't change if you write a "closest neighbour" algorithm in Perl or in Assembly, although the assembly code will probably run hell faster - the complexity remains!
Avatar of julian2000

ASKER

Thank you shlomoy

Sure.