Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Learning C

Reply
Thread Tools

Learning C

 
 
mfasoccer@gmail.com
Guest
Posts: n/a
 
      03-10-2006
I am sorry if this is an inappropriate place to put this post, if so
please delete it.

I am wondering about a few things. Do you guys recommend learning C as
a second language, as someone who already knows java very well. And
what is the best way to learn C, books, tutorials, or what?

Thanks, any response would be great.

 
Reply With Quote
 
 
 
 
Micah Cowan
Guest
Posts: n/a
 
      03-10-2006
"(E-Mail Removed)" <(E-Mail Removed)> writes:

> I am sorry if this is an inappropriate place to put this post, if so
> please delete it.


Well, this is an entirely appropriate place for this post, but if it
had not been, deleting the post would be impossible (once you post to
USENET, it stays there, for the most part. Even "cancelling" a post
you made will may affect some but not all servers).

> I am wondering about a few things. Do you guys recommend learning C as
> a second language, as someone who already knows java very well. And
> what is the best way to learn C, books, tutorials, or what?
>
> Thanks, any response would be great.


I'd be willing to bet that most of the folks on this group began
learning C with a book. Unfortunately, there is a very high ratio of
crappy C books to useful C books. I strongly recommend you buy a copy
of K&R C ("The C Programming Language", by Kernighan and Ritchie, 2nd
edition), written by the actual inventors of C. The C language has
actually changed since then, but the language described there is still
the most portable version of the language, and that book is the most
widely recognized

When you've worked through that, you should probably buy a copy of "C:
A Reference Manual" by Harbison & Steele.

See also http://c-faq.com/resources/books.html, which gives a few
pointers on finding good books on C.

Participating in this newsgroup, or on alt.comp.lang.learn.c-c++, can
also be /very/ beneficial, /provided/:

1. You thoroughly familiarize yourself with the
rules-of-conduct/posting for the group. This can be accomplished
by reading about 2 weeks' worth of posts before posting
yourself. See what kinds of posts get good responses, and which
get poor ones.

2. You have the humility and good grace to receive constructive
criticisms, both of your code and of any errant behavior on the
group.

HTH,
Micah
 
Reply With Quote
 
 
 
 
mfasoccer@gmail.com
Guest
Posts: n/a
 
      03-10-2006
Thanks alot for the response, a few minutes after posting I searched
this group and found hundreds of other threads about the same topic. I
apoligize as well for double posting, that was a mistake even though
I'm sure it must look like I tryed to bump my thread.

I wanted as well, to bring forth another concern that I have with
programming in general. Many people say that ACTUALLY PROGRAMMING
real-world programs is the best way to get better. That theory makes
sense, but when I sit down to write a program in java, I often realize
that I have mastered the sytnax and searching and sorting algorithms,
yet I cannot apply this to a real-world program. Are there any books
for C or websites that explain the analytical thinking or other tactics
involved in practical uses of C?

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      03-10-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) said:

> Are there any books
> for C or websites that explain the analytical thinking or other tactics
> involved in practical uses of C?


Your best starting point is the book Micah mentioned. It has a bunch of
exercises scattered throughout each chapter. Do them. It's astoundingly
good training for practical C use. As for analytical thinking, you could do
worse than stick around in comp.lang.c - some of the regular contributors
are fine exponents of the art. (See also Knuth's "The Art of Computer
Programming" - all three volumes - and don't be put off by the mathemagical
flavour.)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      03-10-2006
"(E-Mail Removed)" wrote:
>
> Thanks alot for the response, a few minutes after posting I searched
> this group and found hundreds of other threads about the same topic. I
> apoligize as well for double posting, that was a mistake even though
> I'm sure it must look like I tryed to bump my thread.
>
> I wanted as well, to bring forth another concern that I have with
> programming in general. Many people say that ACTUALLY PROGRAMMING
> real-world programs is the best way to get better. That theory makes
> sense, but when I sit down to write a program in java, I often realize
> that I have mastered the sytnax and searching and sorting algorithms,
> yet I cannot apply this to a real-world program. Are there any books
> for C or websites that explain the analytical thinking or other tactics
> involved in practical uses of C?


Our own Richard Heathfield has published such a book in "C
Unleashed". So have Kernighan & Pike "The Practice of
Programming". One of the best is Wirths "Algorithms + Data
Structures = Programs".

Get in the immediate habit of including adequate context in any
replies. Don't let the fact that you are posting through that
abortion of a usenet interface offered by google faze you. Read my
sig. below, and read the referenced URLs. Google IS NOT usenet.

All usenet articles need to stand by themselves. There is no
guarantee that any particular other article has ever reached, or
ever will reach, the reader. Even if it has, it may have been
deleted, or just be awkward to view. So quote adequately, and snip
quoted material that is irrelevant to your reply. Do not top-post,
your answer belongs after (or intermixed with) the material to
which you reply.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>

 
Reply With Quote
 
mb1471
Guest
Posts: n/a
 
      03-10-2006
I hear it is very important to use a linux machine for c programming,
is this just a common myth or is there any truth there. I have been
considering switching to linux for this reason, but I'm not sure if
it's worth it..?

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      03-10-2006
mb1471 said:

> I hear it is very important to use a linux machine for c programming,
> is this just a common myth or is there any truth there.


It's a common myth - and like many myths, it has a huge amount of truth
behind it.

C is a portable language. Any box you can find a C compiler (or
cross-compiler) for, you can use for C programming. And if you write your
code carefully, very often the only thing you have to do to get your
program working on a different system is to recompile on the new system.
So, for example, you write your Widgetalyser on a Mac, get it working, copy
it over to a mainframe, recompile, and hey, presto! It works on the
mainframe too. And, one recompile later, it works on Linux too. And maybe
even on your mobile phone or microwave oven. (Er - maybe.)

> I have been
> considering switching to linux for this reason, but I'm not sure if
> it's worth it..?


Oh, it's worth it all right. But perhaps you should put in a couple of years
on a Windows box first, just so that you'll be *really grateful* when you
change over.

Seriously, I don't like Windows (having used it for many years), I do like
Linux (having used it for a few years), but C doesn't care. You can get
good C compilers for Windows easily enough, legally for free in many cases.
The only thing to watch - er, one of a few things to watch is that you need
to be very firm with your typical Windows development environment. Be sure
to save your files with a .c extension, not a .cpp extension. Typical
Windows compilers will see a .cpp extension as an invitation to use C++
rules instead of C rules when compiling - with, as the saying goes, the
usual hilarious results.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
 
Reply With Quote
 
Richard G. Riley
Guest
Posts: n/a
 
      03-10-2006
"(E-Mail Removed)"posted the following on 2006-03-10:

> Thanks alot for the response, a few minutes after posting I searched
> this group and found hundreds of other threads about the same topic. I
> apoligize as well for double posting, that was a mistake even though
> I'm sure it must look like I tryed to bump my thread.
>
> I wanted as well, to bring forth another concern that I have with
> programming in general. Many people say that ACTUALLY PROGRAMMING
> real-world programs is the best way to get better. That theory makes
> sense, but when I sit down to write a program in java, I often realize
> that I have mastered the sytnax and searching and sorting algorithms,
> yet I cannot apply this to a real-world program. Are there any books
> for C or websites that explain the analytical thinking or other tactics
> involved in practical uses of C?
>


One great way is to analyse existing systems. You mentioned moving to
Linux : this is a great idea because you can compile and step through
existing apps with the debugger. Nothing brings you down to the real
"warm fuzzy" feeling that C can bring you : remember that C is a
compromise between high level and efficiency - when you know what you
are doing you can write C almost as efficiently as if you had hard
coded it in assembler. Efficiency aside, you will learn some good (and
bad) structures : the bottom line being, did you understand the flow
of the program after analysing it? If you did it might well be well
architected. I say might ... but that call comes with experience.

There are oodles of technical books out there
which are language independant including such legendary books as Knuth
- frankly they bore me to tears and are not indusive to a newbie
learning a specific language. The best programming book I ever read
was Kernighan & Ritchies C programming language : look it up on
Amazon. It is concise & practical and doesnt aim to dazzle the newbie
with unnecessary complications : it leads to concise, readable coding
style which makes use of the language as it should be used - not as
some nasty facelift of Java or Pascal.

Just stick with it : for the bang to the buck there are few languages
which come close to C.

Also, you'd better remember to include *some* context in your replies
or the usual suspects will be bombarding the NG with yet more
reminders about how to use googlegroups. Some even have .signatures
dedicated to just that.


--
"A desk is a dangerous place from which to view the world" - LeCarre.
 
Reply With Quote
 
Nick Keighley
Guest
Posts: n/a
 
      03-10-2006
Richard G. Riley wrote:
> "(E-Mail Removed)"posted the following on 2006-03-10:


> > Thanks alot for the response, a few minutes after posting I searched
> > this group and found hundreds of other threads about the same topic. I
> > apoligize as well for double posting, that was a mistake even though
> > I'm sure it must look like I tryed to bump my thread.
> >
> > I wanted as well, to bring forth another concern that I have with
> > programming in general. Many people say that ACTUALLY PROGRAMMING
> > real-world programs is the best way to get better. That theory makes
> > sense, but when I sit down to write a program in java, I often realize
> > that I have mastered the sytnax and searching and sorting algorithms,
> > yet I cannot apply this to a real-world program. Are there any books
> > for C or websites that explain the analytical thinking or other tactics
> > involved in practical uses of C?

>
> One great way is to analyse existing systems. You mentioned moving to
> Linux : this is a great idea because you can compile and step through
> existing apps with the debugger.


could we keep the platform bigotry down to a dull roar? Windows has
perfectly good debuggers available as well. So if you really want to
(I've never had the urge) you can "step through existing apps".

I've developed serious applications on both Linux and Windows. They are

both perfectly adequate. It is completly possible to develop
applications
on windows. For heavens sake Windows was *written* in C!

<snip>


--
Nick Keighley

 
Reply With Quote
 
Jordan Abel
Guest
Posts: n/a
 
      03-10-2006
On 2006-03-10, Richard Heathfield <(E-Mail Removed)> wrote:
> mb1471 said:
>
>> I hear it is very important to use a linux machine for c programming,
>> is this just a common myth or is there any truth there.

>
> It's a common myth - and like many myths, it has a huge amount of truth
> behind it.


You forgot to mention what that truth is.

Linux, as a "unix-like" system, has a great deal of cultural heritage
that is a good "fit" for C, as C was originally developed for UNIX. This
can be useful [it's probably the type of system on which the implement-
ation of the standard functions is going to be most straightforward*],
but also dangerous [a lot of things that aren't really defined by the
standard are going to happen to work the way you'll assume they should]

*Note I wouldn't actually recommend trying to _read_ the glibc source,
though. If you seriously plan on doing that, get a unixy OS other than
linux. Say, FreeBSD. or Mac OSX. or SCO [well, that doesn't come with
source code, but i'm sure its source code is still more readable than
glibc even so]. really, anything.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[I'm learning C]: Learning to use ucontext Andrey Popp C Programming 5 01-31-2012 01:05 AM
Learning C and Learning Make/Configure/Building/Linking Hal Vaughan C Programming 7 03-21-2006 05:07 PM
e-learning, (collaborative learning environment) collinm Java 1 09-08-2005 09:52 PM
Learning about SMS technology... VM Wireless Networking 2 07-02-2004 02:36 PM
learning VHDL Vilvox VHDL 5 07-20-2003 08:59 AM



Advertisments