Re: How to improve C skill?



weidongtom@xxxxxxxxx said:

Hi,

I have just finished reading some tutorials on C, I am wondering how I
could improve my skill. Is there any advice? Is reading others' codes
the best way?

Crank up the warning level of your compiler as high as it will go, and
write lots and lots of programs. Remember that much of what your
tutorials taught you is likely to be wrong. Most C tutorials are
written by people who don't know C. Come to think of it, so is most C
code. So, whilst "reading others' code" can be helpful, get into the
habit of thinking "why is this code bad? What don't I like about it?
What diagnostic messages does it cause my compiler to emit? Do I
understand those messages? What don't I understand about the code
itself? *WHY* is the author doing such-and-such?"

I have been reading quite a few
books on the programming language C, but when I tried to start a
project of my own, I find myself to be incompetent.

Honesty will get you everywhere! :-) Seriously, true competence (in
*any* field worth pursuing) takes about ten years of diligent study and
*practice*. Ten years to be a competent doctor, lawyer, programmer,
whatever.

Devise a project of your very own - e.g. a simple text processor - and
define N things you'd like it to do (where N is initially at least 4).
Implement those features, one at a time, learning all about diagnostic
messages as you go! When you've implemented all N features, think up
another N/4 features (rounded down), and notice how awkward it is to
fit them in. Re-factor the code to make adding the new features much
more pleasant, and now you're starting to learn about programming. Once
all 5N/4 features are implemented, let N = 5N/4 and go round again,
until you start to hit practical limits. This is feature creep with a
vengeance! But it will introduce you gently to large programs.

What should I do?

Write C programs.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.



Relevant Pages

  • Re: Stripping all formatting from Word doc
    ... >> Fast startup, fine features, and easy to edit. ... > familiarizing yourself with Word 2004, from some notes titled "Bend Word to ... > They started off in 2001 when, screaming, I made the migration from Word ... Look forward to reading what you compiled. ...
    (microsoft.public.mac.office.word)
  • Re: Stripping all formatting from Word doc
    ... >>> Fast startup, fine features, and easy to edit. ... >> website. ... > Look forward to reading what you compiled. ... How right you are, Kurt! ...
    (microsoft.public.mac.office.word)
  • Re: Multimeters
    ... idea for those features but I wondered if somebody can explain to me ... i would guess is just a filter to keep the reading ... motor drive measurement, seems like nobody here knows and neither do ... How will it know when you want it to speak? ...
    (alt.home.repair)
  • GUI4CBM4WIN 0.6.0 Release
    ... I've made a major bug fix related to the migration to .Net as well as added a few features: ... Fixed problem with reading the output file when detecting drives in the Options window ... Capture stdout and stderr through pipe redirection instead of reading temp files in most cases. ...
    (comp.sys.cbm)
  • Re: Multimeters
    ... idea for those features but I wondered if somebody can explain to me ... i would guess is just a filter to keep the reading ... motor drive measurement, seems like nobody here knows and neither do ... The one I posted a link to has a button on the positive lead to ask for a measurement. ...
    (alt.home.repair)