Tips on gaining proficiency in C

A

AB

Hi,

Regret the fact that this post may be slightly OT to c.l.c, but I am sure
that people there would give GREAT advice...

I am working as a QA (Automation), which generally involves writing mundane
Perl scripts for automated testing of a C Utility.

Bored with the kind of work I am doing, I would love to learn C Programming
(I have theoretical knowledge, thanks to a Bachelor's in CS), with the
intention of, to start with, learning enough to enable me dabble in systems
programming (Linux/Unix) (and hopefully, a job switch ...quickly :) )

I have a few books

- Design of the Unix OS, Bach
- APUE , (Richard Stevens)
- Network Programming (Richard Stevens)

Which I read now and then.

I have also gone through the C Faqs (All of it), but naturally, since I
haven't actually coded, it is not very useful.

Request suggestions/tips/hints on
- how I could go about getting some proficiency in C/Systems.
- Any suitable *projects* which would be worth doing (I tried sourceforge),
- the order (If there is any .. :) in which the above material is best read.
- (Any pointers to other good books are welcome, too ! )


Thanks a lot !

Abhi
 
A

Alwyn

AB said:
I have a few books

- Design of the Unix OS, Bach
- APUE , (Richard Stevens)
- Network Programming (Richard Stevens)

Which I read now and then.

Excellent books all three, but how about adding another classic to the
list: 'The C Programming Language' (2nd ed.) by Kernighan and Ritchie?


Alwyn
 
R

Richard Bos

AB said:
Bored with the kind of work I am doing, I would love to learn C Programming
(I have theoretical knowledge, thanks to a Bachelor's in CS), with the
intention of, to start with, learning enough to enable me dabble in systems
programming (Linux/Unix) (and hopefully, a job switch ...quickly :) )

Systems programming is not something you start with.
I have a few books

- Design of the Unix OS, Bach
- APUE , (Richard Stevens)
- Network Programming (Richard Stevens)

Which I read now and then.

K&R. Don't read it now and then; begin at the beginning, and continue
until you get to the end. Then, and only then, stop.
Request suggestions/tips/hints on
- how I could go about getting some proficiency in C/Systems.

Practice. Practice, practice, practice.
- Any suitable *projects* which would be worth doing (I tried sourceforge),

For a complete beginner? Write Wumpus. Write a text adventure. Write a
Turing machine. Don't start on industrial-scale projects until you know
the language quite well.

Richard
 
A

AB

Alwyn said:
Excellent books all three, but how about adding another classic to the
list: 'The C Programming Language' (2nd ed.) by Kernighan and Ritchie?

Aah yes ! The Bible .. Shouldn't have missed that one.

Will be rushing to the bookstore immediately.

Thanks
Abhi
 
J

John Bode

AB said:
Hi,

Regret the fact that this post may be slightly OT to c.l.c, but I am sure
that people there would give GREAT advice...

I am working as a QA (Automation), which generally involves writing mundane
Perl scripts for automated testing of a C Utility.

Bored with the kind of work I am doing, I would love to learn C Programming
(I have theoretical knowledge, thanks to a Bachelor's in CS), with the
intention of, to start with, learning enough to enable me dabble in systems
programming (Linux/Unix) (and hopefully, a job switch ...quickly :) )

I have a few books

- Design of the Unix OS, Bach
- APUE , (Richard Stevens)
- Network Programming (Richard Stevens)

Which I read now and then.

I have also gone through the C Faqs (All of it), but naturally, since I
haven't actually coded, it is not very useful.

Request suggestions/tips/hints on
- how I could go about getting some proficiency in C/Systems.

Write a lot of code, make a lot of mistakes, write more code.

Seriously, programming is a skill, and skills require practice.
- Any suitable *projects* which would be worth doing (I tried sourceforge),

*Simple* database apps (tracking CDs and DVDs, say) touch on a lot of
different areas. A simple newsreader will give you experience in
network communications.
- the order (If there is any .. :) in which the above material is best read.
- (Any pointers to other good books are welcome, too ! )

Everyone's mentioned K&R. My favorite *reference* manual (not a
tutorial) is Harbison & Steele's "C: A Reference Manual", currently
5th edition.
 
T

Tabrez Iqbal

AB said:
Aah yes ! The Bible .. Shouldn't have missed that one.

Will be rushing to the bookstore immediately.

Thanks
Abhi


Along with TCPL by Kernighan and Ritchie, also pick-up the Answer Book
to the same book by Tondo. completing the exercises of K&R with the
help of the Answer Boor will give you lots of confidence.

tabrez
 
B

Billy N. Patton

AB said:
Hi,

Regret the fact that this post may be slightly OT to c.l.c, but I am
sure that people there would give GREAT advice...

I am working as a QA (Automation), which generally involves writing
mundane Perl scripts for automated testing of a C Utility.
If you write in perl, learning c will be NO problem. They are very
close. You could "almost" get perl code to compile in c by removing the
$ from scalars. %'s and @'s and regexp will be a different problem.

THere a ton of free libraries available. I have been writing in c and
perl for @ 12 years. I'm switching to C++ for everything except the
simplest of scripts. (long story but perl version is a major problem
here at work)
Bored with the kind of work I am doing, I would love to learn C
Programming (I have theoretical knowledge, thanks to a Bachelor's in
CS), with the intention of, to start with, learning enough to enable me
dabble in systems programming (Linux/Unix) (and hopefully, a job switch
...quickly :) )

I have a few books

- Design of the Unix OS, Bach
- APUE , (Richard Stevens)
- Network Programming (Richard Stevens)

Which I read now and then.

I have also gone through the C Faqs (All of it), but naturally, since I
haven't actually coded, it is not very useful.

Request suggestions/tips/hints on
- how I could go about getting some proficiency in C/Systems.
- Any suitable *projects* which would be worth doing (I tried
sourceforge), - the order (If there is any .. :) in which the above
material is best read.
- (Any pointers to other good books are welcome, too ! )


Thanks a lot !

Abhi


--
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455, (e-mail address removed)
 
M

Malcolm

AB said:
(I have theoretical knowledge, thanks to a Bachelor's in CS), with the
intention of, to start with, learning enough to enable me dabble in systems
programming (Linux/Unix) (and hopefully, a job switch ...quickly :) )
If you have a degree in computer science then learning a new language
shouldn't be a problem. Simply pick up a primer and go.
To learn all the minutae of the standard is very difficult, but you don't
need this, just as you don't need a degree in linguistics to speak English
competently (though you might use a should for a would occasionally).
 
R

Randy Howard

tabrez19 said:
Along with TCPL by Kernighan and Ritchie, also pick-up the Answer Book
to the same book by Tondo. completing the exercises of K&R with the
help of the Answer Boor will give you lots of confidence.

Technically this one isn't necessary, as web sites with answers to the
book's exercises are available on the web, but not all are authoritative.
If the OP is trying to save money, that one could be omitted. More to
his original posts, enquiries to c.l.c about troubles with K&R exercise
problems are never considered OT there.
 
R

Randy Howard

Request suggestions/tips/hints on
- how I could go about getting some proficiency in C/Systems.

You have a lot of good answers so far, mostly consisting of "practice"
and repeat. That is good advice, it's really the only way until
someone figures out to make a potion which can be injected in the
arm to short-circuit the "experience" requirement.

Since you are working in QA and want to get into development (that
is a relatively common career path btw), you might consider asking
one of the people currently writing code for which you are doing
QA work to let you look at the source after you get some of the
"rust" knocked off from the books you plan to study. Read it,
understand it, compile it, etc. You might even find some good bugs
to make the boss happy (and the programmer less so) during the
process. Since the code represents a project for which you are
familiar, provided it is not overly complicated (the use of "utility"
in your description implies that it is not), it should make for a
decent way to get your feet wet with code that is already up and
running.
- Any suitable *projects* which would be worth doing (I tried sourceforge),

Sourceforge has some very good open source projects available, it also a
very large number of terrible ones, or ones that somebody thought would be
a good idea and never completed (or even started). It's a shame it does
not seem to get pruned out over time, but I digress.

One option is to google the web for C programming course homework assignments
once you have mastered the exercises in K&R. The other is to simply think
up programs that would be handy to have and implement them.
- (Any pointers to other good books are welcome, too ! )

C Traps and Pitfalls by Koenig is brief, but full of useful information in
a short space. The c.l.c FAQ is of course a requirement, but hopefully
you are already planning on reading it in total (not just looking for answers)
as well.

--
Randy Howard (To reply, remove FOOBAR)
"At the core of liberalism is the spoiled child - miserable,
as all spoiled children are, unsatisfied, demanding, ill-
disciplined, despotic and useless. Liberalism is a philosophy
of sniveling brats." -- P. J. O'Rourke
 
M

Michael Wojcik

If you write in perl, learning c will be NO problem. They are very
close.

This must be the largest value for "very close" ever recorded.

Perl is an object-oriented high-level scripting language. C is
none of these.

Perl has built-in support for threading, embedded documentation, hash
tables, lists, operator contexts (scalar and list), two forms of
scope (lexical and dynamic), labelled flow control, alternative forms
of "if" statements (unless and elsif), modifier statements (where
body preceeds flow control), computed goto, non-local goto (goto
&name), regular expression pattern matching, and lambdas (run-time
anonymous subroutines). None of those are in C.

Perl has scads of special variables and operators which are not in
C, particularly for string manipulation.

Perl has two different string types, one with some C-like escape
sequences plus various ones not in C, the other without them. It
permits newlines in string constants. It has another entire quoting
mechanism which is completely foreign to C. Perl has a syntax for
numeric literals which is not in C (using the underscore character).

Perl has tons of standard modules which in effect give it a standard
"library" that's far larger and more ambitious than the C standard
library.
You could "almost" get perl code to compile in c by removing the
$ from scalars.

This is only true of the most trivial and non-idiomatic Perl code.
I've never seen published Perl code that did anything useful that
was even close to C.

Perl adopted some of its operators from C (actually, Larry Wall
likely adopted them from the more popular Unix shells, which adopted
them from C), but it's really very little like C.

--
Michael Wojcik (e-mail address removed)

Auden often writes like Disney. Like Disney, he knows the shape of beasts --
(& incidently he, too, might have a company of artists producing his lines) --
unlike Lawrence, he does not know what shapes or motivates these beasts.
-- Dylan Thomas
 
W

Willem

Michael wrote:
) Perl is an object-oriented high-level scripting language. C is
) none of these.
)
) <...>
)
) Perl adopted some of its operators from C (actually, Larry Wall
) likely adopted them from the more popular Unix shells, which adopted
) them from C), but it's really very little like C.

Well, one could claim that most C code would run in perl with very little
modification. One could also claim that for most shell scripts, most awk
scripts, most sed scripts, and probably several other ways of programming.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
A

AB

Randy said:
You have a lot of good answers so far, mostly consisting of "practice"
and repeat. That is good advice, it's really the only way until
someone figures out to make a potion which can be injected in the
arm to short-circuit the "experience" requirement.

<OT>
a-la Matrix ... :)
Since you are working in QA and want to get into development (that
is a relatively common career path btw), you might consider asking
one of the people currently writing code for which you are doing
QA work to let you look at the source after you get some of the
"rust" knocked off from the books you plan to study. Read it,
understand it, compile it, etc. You might even find some good bugs
to make the boss happy (and the programmer less so) during the
process. Since the code represents a project for which you are
familiar, provided it is not overly complicated (the use of "utility"
in your description implies that it is not), it should make for a
decent way to get your feet wet with code that is already up and
running.

Thanks for the advice! My usage of the term "utility" is downright
misleading. It is more of a major project with 10+ full time developers.
Sourceforge has some very good open source projects available, it also a
very large number of terrible ones, or ones that somebody thought would be
a good idea and never completed (or even started). It's a shame it does
not seem to get pruned out over time, but I digress.

One option is to google the web for C programming course homework assignments
once you have mastered the exercises in K&R. The other is to simply think
up programs that would be handy to have and implement them.




C Traps and Pitfalls by Koenig is brief, but full of useful information in
a short space. The c.l.c FAQ is of course a requirement, but hopefully
you are already planning on reading it in total (not just looking for answers)
as well.

I already have read the C FAQs end to end, but most of it passed through
due to the fact that I did not actually write code when reading.

Thanks to everyone for their tips and suggestions !

Regards
Abhi
 
J

Joona I Palaste

Billy N. Patton <[email protected]> scribbled the following
If you write in perl, learning c will be NO problem. They are very
close. You could "almost" get perl code to compile in c by removing the
$ from scalars. %'s and @'s and regexp will be a different problem.

Sorry, but that's like saying "If you write in French, learning Swahili
will be NO problem".
 
B

Benjamin Ketcham

In comp.lang.c AB said:
Aah yes ! The Bible .. Shouldn't have missed that one.

Perhaps the version that is now in print fixes all the known Errata,
I'm not sure. Be aware that the original 2nd Edition had several
significant(?) errors, which have been corrected in a separate Errata
document. Is there a reference in the C-FAQ, perhaps? Available on the web.
 
A

Adrian

Benjamin said:
Perhaps the version that is now in print fixes all the known Errata,
I'm not sure. Be aware that the original 2nd Edition had several
significant(?) errors, which have been corrected in a separate Errata
document. Is there a reference in the C-FAQ, perhaps? Available on the web.
K and R, although very popular with this ng is definitely no adequate
learning text from a didactical point of view.
 
J

Jens.Toerring

The errata are here:

http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html
K and R, although very popular with this ng is definitely no adequate
learning text from a didactical point of view.

Huh? If you have a bit of exposure to computer programming before you
start with it it's IMHO one of the best written books in that field
_especially_ from a didactic point of view. I wish all the books were
that well-written it would make learning a new language a lot easier.

Regards, Jens
 
A

Adrian

Adrian said:
K and R, although very popular with this ng is definitely no adequate
learning text from a didactical point of view.
I would like to add that as far as C literature goes
"C: A Reference Manual" by Harbinson and Steele ISBN 0-13-089592-x
would seem absolutely essential to have.
 
R

Richard Pennington

AB said:
Hi, [snip]
Bored with the kind of work I am doing, I would love to learn C
Programming (I have theoretical knowledge, thanks to a Bachelor's in
CS), with the intention of, to start with, learning enough to enable me
dabble in systems programming (Linux/Unix) (and hopefully, a job switch
...quickly :) ) [snip]
Abhi

I think your goal is reasonable and very laudable.

I have one question, however. Please don't take this as a personal
criticism. How can one get a Bachelor's in CS and not know C? Have
universities gotten so far out of touch?

What "theoretical knowledge" did they give you? Theoretical knowledge is
great as long as you can apply it.

Again, I'm not doubting you or your skills. I'm just puzzled by the fact
that you have to ask the question.

Maybe I'm too old: In school I started in FORTRAN, 360 asm, picked up
Pascal and C along the way, dabbled in COBOL, and even a little RPG.
This was (at least now in retrospect) a pretty good base to start from.

Today (much much later ;-)) I use and write C, C++, lex, yacc, lisp,
tcl, perl, sh, tcsh, and a few other languages.

Good luck with the job switch. Just remember (and I think you already
know this, by the way): There will always be something new and cool to
learn. When we stop learning and striving, we die.

-Rich
 
A

AB

Richard said:
AB said:
Hi,
[snip]

Bored with the kind of work I am doing, I would love to learn C
Programming (I have theoretical knowledge, thanks to a Bachelor's in
CS), with the intention of, to start with, learning enough to enable me
dabble in systems programming (Linux/Unix) (and hopefully, a job switch
...quickly :) )
[snip]

Abhi


I think your goal is reasonable and very laudable.

I have one question, however. Please don't take this as a personal
criticism. How can one get a Bachelor's in CS and not know C? Have
universities gotten so far out of touch?

There was a course in C, which took us through the language. That was in
the 1st year of the 4 yr course. Unfortunately, the course was more
bookish, and did not have too much practical value.

To answer your question, yes, I do know what C is, what its syntax is, how
pointers work - all on the high level. However, not having applied it too
much to test my knowledge, and now, being out of touch for 4 years, it is
mandatory that I re-learn it with practical experience. (Which is why I
asked for pointers to projects). Unless this is done, I will not be able to
confidently present my case for a job switch :)
What "theoretical knowledge" did they give you? Theoretical knowledge is
great as long as you can apply it.

Again, I'm not doubting you or your skills. I'm just puzzled by the fact
that you have to ask the question.

As mentioned above, the question was more about suggestion related to
learning C with some bias towards systems programming (Which is obviously
OT for c.l.c)
Maybe I'm too old: In school I started in FORTRAN, 360 asm, picked up
Pascal and C along the way, dabbled in COBOL, and even a little RPG.
This was (at least now in retrospect) a pretty good base to start from.

Today (much much later ;-)) I use and write C, C++, lex, yacc, lisp,
tcl, perl, sh, tcsh, and a few other languages.

That is nice :) While i can write a few lines of C. C++, Java, shell
(barely), and am aware that the syntactical knowledge of a language is easy
to gain (relatively)..it is the decision of how best to do a job with the
right tool, that counts (and which comes by experience)...
Good luck with the job switch.

Thank you :)
Just remember (and I think you already
know this, by the way): There will always be something new and cool to
learn. When we stop learning and striving, we die.

True ..Always reminds me of the following lines from a well known poem by
Robert Frost(Any errors are due to this quote being from memory)..

The woods are lovely, dark and deep
But I have promises to keep
And miles to go before I sleep
And miles to go before I sleep ...

:)

Regards
Abhinav

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top