Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.c

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2012, 04:24 PM
Sleepy Duke
Guest
 
Posts: n/a
Default Self-taught C

What are the best methods you all have found for teaching yourselves how to code proficiently in C?
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 02-03-2012, 06:54 PM
Bl0ckeduser .
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 3, 12:24*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:
> What are the best methods you all have found for teaching yourselves how to code proficiently in C?


I'm a teenager who writes in C as a hobby. Obviously my advice
won't be worth much, but here it is:

K&R was more in-depth than the web tutorial I first read.
I also learnt a few things from reading the old Unix sources
(http://minnie.tuhs.org/cgi-bin/utree.pl). I'm pretty sure writing
a lot of code helps.

Reply With Quote
  #3 (permalink)  
Old 02-04-2012, 12:38 PM
Malcolm McLean
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 3, 5:24*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:
> What are the best methods you all have found for teaching yourselves how to code proficiently in C?
>

Basically do it.

If you're sitting in a bedroom on your own, the most likely thing
you'll want to code is a game. So get graphics working as fast as you
can. It's harder now than it was to get a simple character-based
raster that can be used for moving space invaders round the screen.
But that's usually the best place to start.
Reply With Quote
  #4 (permalink)  
Old 02-05-2012, 11:32 AM
Nick Keighley
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 3, 5:24*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:

> What are the best methods you all have found for teaching yourselves how to code proficiently in C?


write lots of code.

the best way I found was already knowing anothe couple of programming
languages, but this probably doesn't help...
Reply With Quote
  #5 (permalink)  
Old 02-05-2012, 11:34 AM
Nick Keighley
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 3, 7:54*pm, "Bl0ckeduser ." <bl0ckedusers...@gmail.com> wrote:
> On Feb 3, 12:24*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:



> > What are the best methods you all have found for teaching
> > yourselves how to code proficiently in C?

>
> I'm a teenager who writes in C as a hobby. Obviously my advice
> won't be worth much, but here it is:


if you are a competent C programmer then your advice may well be
useful. It probably helps that you learned C recently so you have a
better memory of the process

> K&R was more in-depth than the web tutorial I first read.


yes. Most web tutorials are, sadly, crap. K&R is great, though some
find it a bit heavy going. They don't waste words.

> I also learnt a few things from reading the old Unix sources
> (http://minnie.tuhs.org/cgi-bin/utree.pl).



> I'm pretty sure writing
> a lot of code helps.


absolutely. Learn by doing.

Reply With Quote
  #6 (permalink)  
Old 02-06-2012, 11:23 AM
gwowen
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 5, 12:32*pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
wrote:
> On Feb 3, 5:24*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:
>
> > What are the best methods you all have found for teaching yourselves how to code proficiently in C?

>
> write lots of code.


That.

It'll help to have a project or something that you want to accomplish,
and work htowards that goal.

Set your compiler to its most picky settings, and understand every
single diagnostic message it gives you. And them eliminate them,
figuring out what misunderstanding led to them occuring in the first
place.

Then run the code under valgrind or some similar bounds/leak checker
and understand all its diagnostics too.
Reply With Quote
  #7 (permalink)  
Old 02-07-2012, 04:34 AM
Joe Pfeiffer
Guest
 
Posts: n/a
Default Re: Self-taught C

gwowen <gwowen@gmail.com> writes:

> On Feb 5, 12:32Â*pm, Nick Keighley <nick_keighley_nos...@hotmail.com>
> wrote:
>> On Feb 3, 5:24Â*pm, Sleepy Duke <josh.izz...@gmail.com> wrote:
>>
>> > What are the best methods you all have found for teaching yourselves how to code proficiently in C?

>>
>> write lots of code.

>
> That.
>
> It'll help to have a project or something that you want to accomplish,
> and work htowards that goal.


I think that's the most important single advice that can be given.

> Set your compiler to its most picky settings, and understand every
> single diagnostic message it gives you. And them eliminate them,
> figuring out what misunderstanding led to them occuring in the first
> place.
>
> Then run the code under valgrind or some similar bounds/leak checker
> and understand all its diagnostics too.

Reply With Quote
  #8 (permalink)  
Old 02-07-2012, 08:26 AM
Fritz Wuehler
Guest
 
Posts: n/a
Default Re: Self-taught C

> > It'll help to have a project or something that you want to accomplish,
> > and work htowards that goal.

>
> I think that's the most important single advice that can be given.


Agreed. But working at a support role where you have to read lots of code
and fix it is even better than that and along with it, you'll have it all.

Reply With Quote
  #9 (permalink)  
Old 02-07-2012, 09:18 AM
Nick Keighley
Guest
 
Posts: n/a
Default Re: Self-taught C

On Feb 7, 9:26*am, Fritz Wuehler
<fr...@spamexpire-201202.rodent.frell.theremailer.net> wrote:
> > > It'll help to have a project or something that you want to accomplish,
> > > and work htowards that goal.

>
> > I think that's the most important single advice that can be given.

>
> Agreed. But working at a support role where you have to read lots of code
> and fix it is even better than that and along with it, you'll have it all..


dunno, being a maintenance programmer on a nasty pile of code can be a
dispiriting experience. I wouldn't suggest i was necessarily a good
way to learn.
Reply With Quote
  #10 (permalink)  
Old 02-07-2012, 11:53 AM
James Kuyper
Guest
 
Posts: n/a
Default Re: Self-taught C

On 02/03/2012 12:24 PM, Sleepy Duke wrote:
> What are the best methods you all have found for teaching yourselves how to code proficiently in C?


1. Study "The C Programming Language" by Kernighan & Ritchie. However,
I've heard that this is not a good introductory book for someone with no
previous experience in programming. I wouldn't have noticed if that were
the case - C was my fourth programming language, after FORTRAN I (sic),
Basic, and APL.

2. Write lots of code while trying to achieve very specific goals. If
you don't have a specific goal you're trying to achieve with the code,
you won't learn as much while writing it.
--
James Kuyper
Reply With Quote
  #11 (permalink)  
Old 02-07-2012, 01:05 PM
Stefan Ram
Guest
 
Posts: n/a
Default Re: Self-taught C

Sleepy Duke <josh.izzard@gmail.com> writes:
>What are the best methods you all have found for teaching
>yourselves how to code proficiently in C?


Reading C books (including the C specification), Reading
books on software engineering (not C specific), Reading and
porting code (e.g., C code from other systems to the Amiga
or from other languages to C), writing C code, talking with
friends about C, Reading the C source code of a computer
game while playing it to find the tricks (how to play and
win), and giving C classes (my next C class starts this
thursday [the day after tomorrow] in Berlin; it's a real
C class [not a C++ class]).

--
Stefan Ram http://www.purl.org/stefan_ram/
Programmierkurse http://www.purl.org/stefan_ram/pub/berlin-kurs

Reply With Quote
  #12 (permalink)  
Old 02-07-2012, 01:29 PM
notbob
Guest
 
Posts: n/a
Default Re: Self-taught C

On 2012-02-03, Sleepy Duke <josh.izzard@gmail.com> wrote:

> What are the best methods you all have found for teaching yourselves
> how to code proficiently in C?



There are good beginning tutorials online. Here's a few:
http://how-to.linuxcareer.com/c-deve...x-introduction
http://www.cprogramming.com/tutorial/c-tutorial.html
http://www.codingunit.com/the-history-of-the-c-language

Chew on these till you milk them dry, then look for some books. Read
the reviews on Amazon. If you have a B&N or good library, go there
and read 'em before buying. I once bought a C book that was highly
recommended and was not happy with it.

As another poster recommended, learn with a goal in mind. Excellent
advice. I've dabbled unsuccessfully in coding for yrs and never
really learned anything cuz I never had a reason. I've recently
discovered arduino hobby electronics, a hands-on fun end to my means.
It can be done in C. I think this stuff is a hoot and it got me back
into learning programming. Some examples:

http://ardrone.parrot.com/parrot-ar-drone/usa/

http://www.adafruit.com/products/170

http://www.adafruit.com/products/332 (watch the belt video)

http://tinyurl.com/7p886h5

This is all stuff that can be done with Arduino electronics and C
coding. I'll never get to the point of those amazing formation flying
q-copters, but it fires one's imagination and provides inspiration.

Oh! .....also learn code debugging as you go. Nothing is more
discouraging than debugging bad code, so learn how early.

notbob --geezer learning C way too late, but still trying

--
Fight internet CENSORSHIP - Fight SOPA-PIPA
Contact your congressman and/or representative, now!
http://projects.propublica.org/sopa/
vi --the heart of evil!
Reply With Quote
  #13 (permalink)  
Old 02-07-2012, 04:26 PM
Barry Schwarz
Guest
 
Posts: n/a
Default Re: Self-taught C

On 7 Feb 2012 14:29:21 GMT, notbob <notbob@nothome.com> wrote:

>On 2012-02-03, Sleepy Duke <josh.izzard@gmail.com> wrote:
>
>> What are the best methods you all have found for teaching yourselves
>> how to code proficiently in C?

>
>
>There are good beginning tutorials online. Here's a few:
>http://how-to.linuxcareer.com/c-deve...x-introduction


This one has some really confusing examples (e.g., the discussion
regarding the ++ operator).

The discussion of pointers has major errors such as:

Next, we dereference ptoi, meaning we say "stop pointing to x and
start pointing to y".

and

when working with arrays, you don't have to use pointers, but it's
nice to do so, because operations will be faster,

and

Another important aspect is that any character array in C ends with
the null character

and it gets worse.

--
Remove del for email
Reply With Quote
  #14 (permalink)  
Old 02-07-2012, 04:45 PM
notbob
Guest
 
Posts: n/a
Default Re: Self-taught C

On 2012-02-07, Barry Schwarz <schwarzb@dqel.com> wrote:

> The discussion of pointers has major errors such as:


That's why I provided several sites. I've taken formal college C
programming classes twice and have yet to encounter a single learning
method that isn't flawed, somehow. If not blatant mistakes, then
outright omissions, like I will somehow absorb the correct approach
and/or code syntax by magic. One teacher used both C and C++ code as
if they were the same. Similar experiences with 2 books I've bought.
I've discovered having several sources for the same info usually
provides the answer, if only by consensus.

nb

--
Fight internet CENSORSHIP - Fight SOPA-PIPA
Contact your congressman and/or representative, now!
http://projects.propublica.org/sopa/
vi --the heart of evil!
Reply With Quote
  #15 (permalink)  
Old 02-07-2012, 04:55 PM
Stefan Ram
Guest
 
Posts: n/a
Default Re: Self-taught C

notbob <notbob@nothome.com> writes:
>method that isn't flawed, somehow. If not blatant mistakes, then
>outright omissions,


Some omissions are necessary in teaching, mistakes are not.

Reply With Quote
 
Reply

Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 04:56 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.