About programing, a general question

John Haxby john.haxby at gmail.com
Fri Dec 17 10:00:08 UTC 2010


On 17 December 2010 09:41, Ralf Corsepius <rc040203 at freenet.de> wrote:

>
> That said, I'd choose "C" to getting started. It's a bit of a rough ride
> in the beginning, but it pays off in longer terms.
>
>
Actually, no, C is dead easy to start but it gets really difficult really
quickly.  Consider these for a beginner:

  * Write the declaration of signal(3) -- it takes two parameters, an
integer and a pointer to a function that takes an integer paramater and
returns void.  Explain why the parentheses are needed.

 * Why does "a + b == 0" work the way you expect but "a & b == 0" does not?
 Are you sure it doesn't?

 * What is the difference between "const char *s" and "char * const s"?

 * What is the difference between "char *s" and "char s[]"?

Admitedly the very first of these is not likely to come up as a beginner,
but the other three will, and they'll bite you good and hard.

C is not a simple language, it has a lot of subtlety and it is incredibly
expressive, but I would not use it as the beginning language for someone who
wants to learn to program.  I'd start with a language that was designed
carefully.  There aren't any Algol68 compilers any more :-) but I'd choose
python or java to learn to program.  Once you know what you want to do then
you can go for something else, something applicable to what you want to do.
 When you know the basics those questions about C are still difficult, but
at least you're not trying to understand them at the same time as knowing
what happens to a parameter when you pass it to a function or, for that
matter, what a function is.

jch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20101217/7e77b6df/attachment.html 


More information about the users mailing list