Re: why learn C?



arnuld wrote, On 22/02/07 16:29:

Please do not snip the attribution lines, the bits that say who posted what. They are useful to the rest of us to follow the conversation.

<snip>

2. with C one will learn about pointers and algorithms.
pointers: yes
algorithms: why ?

why not ?

Because whatever programming language you are using you are using algorithms, so why C in particular?

1. i tried some Common Lisp where i never had to worry about
algorithms.

In that case you were not developing your software properly. Stages of software development:

1) What is the problem?
This is requirements analysis
2) What method do I use to solve the problem?
This is algorithm development
3) How should I put things together to implement this method?
This is design
4) Write the code

Note that I have missed out a lot of things deliberately, since software development plans, test plans, testing and so on would complicate my point.

2. in C++, you get read-made algorithms from Standard Library, so
around 95% of the times, you only need to do "#include<algorithm>".

Where is the ready made algorithm to do histogram equalisation of a greyscale image? How about the ready made algorithm to calculate the gain and offset I need to apply to the incoming image so that 5% of pixels are white, 5% black, and the rest somewhere in between? If you can find those, then I can find other algorithms I have needed which are *not* part of which ever language you choose to select.

whereas in C, you have design the algorithms, from scratch.

but may be i am biased, as i did not take the case of other languages
like OCaml, Haskell, Mercury or Eiffel here.

If anything you are biased by only doing programs where the language provides you with a ready made solution. Write any program of any significant complexity (say 100 lines, to pick a figure out of thin air) and you will have done at least some algorithm development whether you realised it at the time or not.

" i think algorithms and data-structures are more important than
learning a new programming language.

[SNIP]

/arnuld/ is not an experienced programmer, so i feel difficulty in
believing his words. i want to know the views of people here,a s much
of the post belong to C.

On algorithms: it depends what mean 'learning about algorithms'.

i meant, "applying the specific algorithm, in the language your are
working with".

What is most important depends on what level you are working at. If you are implementing a design that has been produced and reviewed by others then there is sod all algorithm development to do whatever language you are working in. If, on the other hand, you are trying to be the technical lead on a project then if you do not understand the algorithms that need to be developed you are worse than useless, but not knowing all the details of a given programming language is less important because you will find it easy to pick up what you need (prefferably be reading good material on the language).

<snip>

Moreover, I am under the
impression that the 'good' software design is not langage-independant.

good software design is language-independent,as i said already, *and*
some programming languages are a not a good-fit for a particular
design but a perfect-fit for some other designs.

Here I more or less agree with you. However, if you know you are going to implement something in C or Pascal (possibly due to some external project restraint, maybe having to add it to part of an existing product) then you might choose a different design to if you are going to be implementing it in Lisp.

At leats, learning C is usefull because the is C, a kind of universal
programming langage known by all, a little bit like 'English' in
natural langages.

Is this the only benefit you think of C (except pointers) ?

i guess, there are more.

C is a higher level than assembler (which is a higher level than machine code) which is an advantage, but one shared by many other languages.

C allows you to get close to the metal when required which is an advantage, but one shared by many other programming languages.

C has been standardised which is an advantage shared (in one form or another) by many other languages.

Any advantage you can find for C will be shared by at least one other language apart from C having been ported to probably more targets than any other language, which leads from it often being the first language (or first after the assembler for that specific target) ported to any given target. Assembler does not count because each assembler language is different.

BTW, thanks for the critique.

The two things this group is best IMHO at in order are
1) C
2) Critiques.
--
Flash Gordon
.



Relevant Pages

  • Re: casts
    ... Visual Basic or politics. ... Please restrict your posts to the C language. ... It is true that the "kernel" approach in OS design, ... programming language and saved us all a great deal of time for nobler ...
    (comp.lang.c)
  • Re: Queries and OO
    ... >> language other than the programming language. ... regular expression engine is encapsulated and does not pollute the ... FitNesse has such a design. ...
    (comp.object)
  • Re: The PL design space is not that simple (was: Re: Alternatives 4)
    ... solution, including a programming language. ... Implicit in the fact that a newsgroup specific to Lisp ... I don't believe that the PL design space is that simple. ...
    (comp.lang.lisp)
  • Re: why learn C?
    ... i think programming is different from Software Engineering. ... then I can find other algorithms I have needed which are ... *not* part of which ever language you choose to select. ... and you will have done at least some algorithm development whether you ...
    (comp.lang.c)
  • Re: Using Python for programming algorithms
    ... interpreted programming language ... programming all my algorithms in Python. ... I can't tell but you'd be surprised by the quantity of available Python ...
    (comp.lang.python)