Re: About programing, a general question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 17 December 2010 09:41, Ralf Corsepius <rc040203@xxxxxxxxxx> 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
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux