[Ilugc] .a-tip-a-day (patch - apply diffs and act as inverse of diff)

  • From: steve@xxxxxxxxxxxx (steve)
  • Date: Wed Sep 30 14:50:46 2009

On 09/30/2009 02:29 PM, Manvendra Bhangui wrote:

On Wed, Sep 30, 2009 at 2:12 PM, Manvendra Bhangui<mbhangui@xxxxxxxxx>wrote:
[...snip...]
 e.g.
 You can take the following 'C' program as an example. Write the same in
 perl and enjoy the gunk that comes out.

 int
 main(int argc, char **argv, char **envp)
 {
 __write(1, "hello world\n", 12);
 }


The equivalent program in perl would be
#!/usr/bin/perl
print "hello world\n";

(just two lines instead of 5 lines in the 'C' program. But an strace on both
show
the C programs does the same job with 23 system calls
the perl program takes 160 system calls to just print the line "hello world"
on screen

Come dude ! ...that's a lousy argument and you know it. I, myself, prefer 
python 
to C and C to perl ...but won't ever look at number of syscalls to defend my 
preference.

If you *really* want to go that way and do a 'relevant' one-to-one comparison, 
you have to include the number of syscalls being made by gcc when compiling 
your 
code to binary ...which is essentially what the perl interpreter is doing for 
you for 'free'.

cheers,
- steve

-- 
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/

Other related posts: