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

  • From: mbhangui@xxxxxxxxx (Manvendra Bhangui)
  • Date: Wed Sep 30 14:30:44 2009

On Wed, Sep 30, 2009 at 2:12 PM, Manvendra Bhangui <mbhangui@xxxxxxxxx>wrote:

On Wed, Sep 30, 2009 at 1:50 PM, Kapil Hari Paranjape 
<kapil@xxxxxxxxxxx>wrote:

C is neither easy to write nor easy to read!

Quite the other way around. C is a very structured language. And there are
almost no rules in 'C'. You can assign an char to a integer, integer to a
char. Do a unstructured goto like in other languages or do a sophisticated
goto like longjmp().

How easy you find a language, depends on how you learnt it and how much
passion you have for it. For me 'C' is like poetry. Just do an strace on a
perl program and an equivalent 'C' program and you will be surprised to find
the amount of gunk that is there in the higher level languages.

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


-- 
Regards Manvendra - http://www.indimail.org
Sent from Chennai, TN, India

Other related posts: