Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #163934 > unrolled thread

Best way to learn C?

Started byTorbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com>
First post2021-12-18 12:34 +0100
Last post2021-12-20 22:44 +0100
Articles 13 on this page of 33 — 17 participants

Back to article view | Back to comp.lang.c


Contents

  Best way to learn C? Torbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com> - 2021-12-18 12:34 +0100
    Re: Best way to learn C? Öö Tiib <ootiib@hot.ee> - 2021-12-18 04:25 -0800
      Re: Best way to learn C? Torbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com> - 2021-12-18 13:49 +0100
        Re: Best way to learn C? Öö Tiib <ootiib@hot.ee> - 2021-12-18 06:53 -0800
    Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-18 13:26 +0100
      Re: Best way to learn C? Torbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com> - 2021-12-18 13:49 +0100
        Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-18 15:26 +0100
          Re: Best way to learn C? Guillaume <message@bottle.org> - 2021-12-19 19:11 +0100
            Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-19 19:42 +0100
            Re: Best way to learn C? Jim Jackson <jj@franjam.org.uk> - 2021-12-20 11:33 +0000
        Re: Best way to learn C? Manfred <noname@add.invalid> - 2021-12-18 17:54 +0100
          Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-18 18:32 +0100
            Re: Best way to learn C? Bart <bc@freeuk.com> - 2021-12-18 18:22 +0000
              Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-18 19:43 +0100
              Re: Best way to learn C? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-12-19 02:59 -0800
      Re: Best way to learn C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-12-18 22:19 -0800
        Re: Best way to learn C? Bonita Montero <Bonita.Montero@gmail.com> - 2021-12-19 10:14 +0100
          Re: Best way to learn C? David Brown <david.brown@hesbynett.no> - 2021-12-19 17:21 +0100
        Re: Best way to learn C? David LaRue <huey.dll@tampabay.rr.com> - 2021-12-19 09:20 +0000
          Re: Best way to learn C? David Brown <david.brown@hesbynett.no> - 2021-12-19 22:54 +0100
    Re: Best way to learn C? Torbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com> - 2021-12-18 13:49 +0100
    Re: Best way to learn C? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-12-18 16:17 +0000
    Re: Best way to learn C? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-12-19 02:55 -0800
    Re: Best way to learn C? luser droog <luser.droog@gmail.com> - 2021-12-19 06:18 -0800
      Re: Best way to learn C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-19 15:21 +0000
        Re: Best way to learn C? Manfred <noname@add.invalid> - 2021-12-19 19:02 +0100
          Re: Best way to learn C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-19 20:51 +0000
            Re: Best way to learn C? Manfred <noname@add.invalid> - 2021-12-19 22:31 +0100
              Re: Best way to learn C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-12-19 22:02 +0000
              Re: Best way to learn C? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-12-19 16:10 -0800
              Re: Best way to learn C? scott@slp53.sl.home (Scott Lurndal) - 2021-12-20 15:47 +0000
    Re: Best way to learn C? John Forkosh <forkosh@panix.com> - 2021-12-20 08:50 +0000
    Re: Best way to learn C? Philipp Klaus Krause <pkk@spth.de> - 2021-12-20 22:44 +0100

Page 2 of 2 — ← Prev page 1 [2]


#163940

FromTorbjörn Svensson Diaz <torbjorn.svensson.diaz@gmail.com>
Date2021-12-18 13:49 +0100
Message-ID<spklc1$bae$1@dont-email.me>
In reply to#163934
On 2021-12-18 13:21, Stefan Ram wrote:
> =?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=  <torbjorn.svensson.diaz@gmail.com> writes:
>> What is the best way to learn C? Which are the best tutorials and which
>> are the best books? Can someone please give me a little guidance?
> 
>    Check out
> 
> "Modern C" by Jens Gustedt

Ok. Thanks.


-- 
Torbjörn Svensson Diaz

[toc] | [prev] | [next] | [standalone]


#163961

FromLew Pitcher <lew.pitcher@digitalfreehold.ca>
Date2021-12-18 16:17 +0000
Message-ID<spl1jm$pcg$1@dont-email.me>
In reply to#163934
On Sat, 18 Dec 2021 12:34:49 +0100, Torbjörn Svensson Diaz wrote:

> Hello!
> 
> What is the best way to learn C?

Write lots of code. Tackle small projects at first, then move on
to larger projects that progressively challenge your skills and
knowledge.
Make mistakes, find out /why/ they were mistakes, and then correct them. 
Refine your skills.

> Which are the best tutorials and which are the best books?

That's mostly a matter of personal opinion, usually governed by the
student's skills and preferences.

> Can someone please give me a little guidance?

Others here will have better advice.
-- 
Lew Pitcher
"In Skills, We Trust"

[toc] | [prev] | [next] | [standalone]


#163984

FromMalcolm McLean <malcolm.arthur.mclean@gmail.com>
Date2021-12-19 02:55 -0800
Message-ID<a39197f7-90f6-4ca6-8f0f-45672680e6d5n@googlegroups.com>
In reply to#163934
On Saturday, 18 December 2021 at 11:35:01 UTC, Torbjörn Svensson Diaz wrote:
> Hello! 
> 
> What is the best way to learn C? Which are the best tutorials and which 
> are the best books? Can someone please give me a little guidance? 
> 
It just depends what sort of background you have. I was an assembly language
programmer before I learned C. So in my case it was "What's the funny asterisk?"
"It's the indirection operator." "Oh", and I understoof pointers.

If you've never used a language that allows direct memory access before, that's
unlikely to be adequate. From experience, pointers cause a great deal of trouble
to many newbies. But they are the heart of C. Once you understand them, pretty
much everything else just works as anyone would expect - you've got loops,
if statements, and subroutine calls, like any other pricedural language.

[toc] | [prev] | [next] | [standalone]


#163987

Fromluser droog <luser.droog@gmail.com>
Date2021-12-19 06:18 -0800
Message-ID<713a16cf-d9e0-4056-a70e-e8c7b93727den@googlegroups.com>
In reply to#163934
On Saturday, December 18, 2021 at 5:35:01 AM UTC-6, Torbjörn Svensson Diaz wrote:
> Hello! 
> 
> What is the best way to learn C? Which are the best tutorials and which 
> are the best books? Can someone please give me a little guidance? 
> 

Others have given good book suggestions. For the best /tutorial/, I'd recommend
Brian Kernighan's original tutorial paper. It's a little outdated and quirky. But it's
well written and *short*. It gives a reasonably complete overview that should 
make a more modern text easier to follow.

  https://www.lysator.liu.se/c/bwk-tutor.html

[toc] | [prev] | [next] | [standalone]


#163988

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2021-12-19 15:21 +0000
Message-ID<8735mopqm9.fsf@bsb.me.uk>
In reply to#163987
luser droog <luser.droog@gmail.com> writes:

> On Saturday, December 18, 2021 at 5:35:01 AM UTC-6, Torbjörn Svensson Diaz wrote:
>> What is the best way to learn C? Which are the best tutorials and
>> which are the best books? Can someone please give me a little
>> guidance?
>> 
>
> Others have given good book suggestions. For the best /tutorial/, I'd
> recommend Brian Kernighan's original tutorial paper. It's a little
> outdated and quirky. But it's well written and *short*. It gives a
> reasonably complete overview that should make a more modern text
> easier to follow.
>
>   https://www.lysator.liu.se/c/bwk-tutor.html

No, I can't agree.  At time, maybe, but not now.  Amongst the big
problems are: no function prototypes, implicit int, old-style function
definitions, the old =<op> syntax, unique structure tags (because they
are all interchangeable), no initialisation of structures nor of local
variables and '\0' as an end-of-file marker.

But then there's almost no use of library functions, no unsigned types,
no typedef, no long, no void, no const and all local declarations have
to be at the start of a function.  Some of these would, perhaps, be
deliberately omitted from a first tutorial, but I would not students to
learn that C has only four types: char, int float and double.

I suppose it's still possible that this is the best tutorial but that
says more about the others than it does about the suitability of this
one (there are a lot of awful ones out there).

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#163990

FromManfred <noname@add.invalid>
Date2021-12-19 19:02 +0100
Message-ID<spns2v$vsl$1@gioia.aioe.org>
In reply to#163988
On 12/19/2021 4:21 PM, Ben Bacarisse wrote:
> luser droog <luser.droog@gmail.com> writes:
> 
>> On Saturday, December 18, 2021 at 5:35:01 AM UTC-6, Torbjörn Svensson Diaz wrote:
>>> What is the best way to learn C? Which are the best tutorials and
>>> which are the best books? Can someone please give me a little
>>> guidance?
>>>
>>
>> Others have given good book suggestions. For the best /tutorial/, I'd
>> recommend Brian Kernighan's original tutorial paper. It's a little
>> outdated and quirky. But it's well written and *short*. It gives a
>> reasonably complete overview that should make a more modern text
>> easier to follow.
>>
>>    https://www.lysator.liu.se/c/bwk-tutor.html
> 
> No, I can't agree.  At time, maybe, but not now.  Amongst the big
> problems are: no function prototypes, implicit int, old-style function
> definitions, the old =<op> syntax, unique structure tags (because they
> are all interchangeable), no initialisation of structures nor of local
> variables and '\0' as an end-of-file marker.
> 
> But then there's almost no use of library functions, no unsigned types,
> no typedef, no long, no void, no const and all local declarations have
> to be at the start of a function.  Some of these would, perhaps, be
> deliberately omitted from a first tutorial, but I would not students to
> learn that C has only four types: char, int float and double.
> 
> I suppose it's still possible that this is the best tutorial but that
> says more about the others than it does about the suitability of this
> one (there are a lot of awful ones out there).
> 

In short, along the lines of the same reasoning, could one say that K&R2 
is still among the best choices available?

[toc] | [prev] | [next] | [standalone]


#163997

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2021-12-19 20:51 +0000
Message-ID<87lf0gnwro.fsf@bsb.me.uk>
In reply to#163990
Manfred <noname@add.invalid> writes:

> On 12/19/2021 4:21 PM, Ben Bacarisse wrote:
>> luser droog <luser.droog@gmail.com> writes:
>> 
>>> On Saturday, December 18, 2021 at 5:35:01 AM UTC-6, Torbjörn Svensson Diaz wrote:
>>>> What is the best way to learn C? Which are the best tutorials and
>>>> which are the best books? Can someone please give me a little
>>>> guidance?
>>>>
>>>
>>> Others have given good book suggestions. For the best /tutorial/, I'd
>>> recommend Brian Kernighan's original tutorial paper. It's a little
>>> outdated and quirky. But it's well written and *short*. It gives a
>>> reasonably complete overview that should make a more modern text
>>> easier to follow.
>>>
>>>    https://www.lysator.liu.se/c/bwk-tutor.html
>> No, I can't agree.  At time, maybe, but not now.  Amongst the big
>> problems are: no function prototypes, implicit int, old-style function
>> definitions, the old =<op> syntax, unique structure tags (because they
>> are all interchangeable), no initialisation of structures nor of local
>> variables and '\0' as an end-of-file marker.
>> But then there's almost no use of library functions, no unsigned types,
>> no typedef, no long, no void, no const and all local declarations have
>> to be at the start of a function.  Some of these would, perhaps, be
>> deliberately omitted from a first tutorial, but I would not students to
>> learn that C has only four types: char, int float and double.
>> I suppose it's still possible that this is the best tutorial but that
>> says more about the others than it does about the suitability of this
>> one (there are a lot of awful ones out there).
>> 
>
> In short, along the lines of the same reasoning, could one say that
> K&R2 is still among the best choices available?

K&R2 is among the best introductions, but I don't see much of the same
reasoning.  For one thing, my recollection is that there are other good
books out there, so it is not faute de mieux.  For another, you won't
learn much from K&R2 that a modern C compiler will throw out.  You'll
miss out on a few things, but you'd have a reasonable grounding.

(And what's going on with blanks lines?  I keep replying to posts
quoting me, where all the blank lines I put in have gone.  I thought it
might be Google -- always a good bet is Usenet posts are messed up --
but you don't post through Google.)

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#163998

FromManfred <noname@add.invalid>
Date2021-12-19 22:31 +0100
Message-ID<spo8b0$ggc$1@gioia.aioe.org>
In reply to#163997
On 12/19/2021 9:51 PM, Ben Bacarisse wrote:
> Manfred <noname@add.invalid> writes:
> 
>> On 12/19/2021 4:21 PM, Ben Bacarisse wrote:
[...]
>>> I suppose it's still possible that this is the best tutorial but that
>>> says more about the others than it does about the suitability of this
>>> one (there are a lot of awful ones out there).
>>>
>>
>> In short, along the lines of the same reasoning, could one say that
>> K&R2 is still among the best choices available?
> 
> K&R2 is among the best introductions, but I don't see much of the same
> reasoning.

The reasoning would be that it is still among the best despite its age, 
which says something about later books.

   For one thing, my recollection is that there are other good
> books out there, so it is not faute de mieux.  For another, you won't
> learn much from K&R2 that a modern C compiler will throw out.  You'll
> miss out on a few things, but you'd have a reasonable grounding.
> 
> (And what's going on with blanks lines?  I keep replying to posts
> quoting me, where all the blank lines I put in have gone.  I thought it
> might be Google -- always a good bet is Usenet posts are messed up --
> but you don't post through Google.)
> 

(I see now that those lines have gone - I was not aware when I wrote my 
reply. While I'm writing this empty lines are still in)

[toc] | [prev] | [next] | [standalone]


#164001

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2021-12-19 22:02 +0000
Message-ID<877dc0nti3.fsf@bsb.me.uk>
In reply to#163998
Manfred <noname@add.invalid> writes:

> On 12/19/2021 9:51 PM, Ben Bacarisse wrote:
>> Manfred <noname@add.invalid> writes:
>> 
>>> On 12/19/2021 4:21 PM, Ben Bacarisse wrote:
> [...]
>>>> I suppose it's still possible that this is the best tutorial but that
>>>> says more about the others than it does about the suitability of this
>>>> one (there are a lot of awful ones out there).
>>>>
>>>
>>> In short, along the lines of the same reasoning, could one say that
>>> K&R2 is still among the best choices available?
>> K&R2 is among the best introductions, but I don't see much of the same
>> reasoning.
>
> The reasoning would be that it is still among the best despite its
> age, which says something about later books.

I see what you mean.  Yes, I would say so.  Mind you, it's a lot younger
than the C tutorial -- 14 years younger.

>   For one thing, my recollection is that there are other good
>> books out there, so it is not faute de mieux.  For another, you won't
>> learn much from K&R2 that a modern C compiler will throw out.  You'll
>> miss out on a few things, but you'd have a reasonable grounding.
>> (And what's going on with blanks lines?  I keep replying to posts
>> quoting me, where all the blank lines I put in have gone.  I thought it
>> might be Google -- always a good bet is Usenet posts are messed up --
>> but you don't post through Google.)
>
> (I see now that those lines have gone - I was not aware when I wrote
> my reply. While I'm writing this empty lines are still in)

Just to be clear, it's blank lines in quoted material and I think you
only quoted one such line: between your question and my "K&R2 is among
the best..." paragraph.

If you want to test, this post ends with tree paragraphs, all set off
from the one before with a blank line.

I.e. there is one before "Just", one before "If" and one before "I.e.".
I know you are seeing them, I write this so that when it's been quoyed a
few times, people can see what was originally intended.

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#164003

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2021-12-19 16:10 -0800
Message-ID<87y24g5e61.fsf@nosuchdomain.example.com>
In reply to#163998
ram@zedat.fu-berlin.de (Stefan Ram) writes:
> Manfred <noname@add.invalid> writes:
>>(I see now that those lines have gone - I was not aware when I wrote my 
>>reply. While I'm writing this empty lines are still in)
>
>   I edit quotations manually to remove whitespace and empty
>   lines. My intention is to still have it there but take less
>   space, so as to make it clear that it is less relevant now
>   because it's been probably read before and to make the new
>   material stand out.
>
>   OTOH, what I cannot stand is when my posts are modified by
>   the moderation of a moderated newsgroup before publication
>   because in this case people think that I must have written
>   it this way since they cannot see what I actually have
>   submitted. That's why I stopped posting in comp.std.c. The
>   moderation was not even willing to publish a post wherein
>   I wanted to discuss this. 

comp.std.c is not moderated.  comp.lang.c.moderated is, but the
last post I see is from 2014.

I don't know what modifications were made, but there are some I'd
consider reasonable.

Deleting blank lines that mark paragraphs seems like a bad idea.
For example, I wouldn't consider deleting the blank line in
your quote.  I might not quote the whole thing, but I'd mark any
deletions.  I do sometimes re-wrap quoted text.

And indenting original material as you've done here goes against
Usenet convention and hurts clarity.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#164011

Fromscott@slp53.sl.home (Scott Lurndal)
Date2021-12-20 15:47 +0000
Message-ID<JA1wJ.48835$xe2.42390@fx16.iad>
In reply to#163998
ram@zedat.fu-berlin.de (Stefan Ram) writes:
>Manfred <noname@add.invalid> writes:
>>(I see now that those lines have gone - I was not aware when I wrote my 
>>reply. While I'm writing this empty lines are still in)
>
>  I edit quotations manually to remove whitespace and empty
>
>  lines. My intention is to still have it there but take less
>
>  space, so as to make it clear that it is less relevant now
>
>  because it's been probably read before and to make the new
>
>  material stand out.

In other words, you think you know better than the original
author.  Please don't.

[toc] | [prev] | [next] | [standalone]


#164006

FromJohn Forkosh <forkosh@panix.com>
Date2021-12-20 08:50 +0000
Message-ID<sppg5i$lc$1@reader1.panix.com>
In reply to#163934
Torbj??rn Svensson Diaz <torbjorn.svensson.diaz@gmail.com> wrote:
> Hello! What is the best way to learn C?

I haven't read all the other followups,
so forgive if this is just a repeat.
  You ever hear the joke about the tourist
in New York City, walking up Broadway, who
stops a passerby and asks...
    Question: How do you get to Carnegie Hall?
    Answer: Practice.
C programming, and programming in general,
is a craft. Just like playing piano, reading
all the books in the world ain't gonna teach
you how to actually do it. So the best way
to learn C is to write programs, and programs,
and...

> Which are the best tutorials and which 
> are the best books? Can someone please
> give me a little guidance?

Seem to already be lots of useful suggestions.
You, yourself will have to decide which one(s)
actually work best for you and your background,
needs, interests, etc.
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )

[toc] | [prev] | [next] | [standalone]


#164017

FromPhilipp Klaus Krause <pkk@spth.de>
Date2021-12-20 22:44 +0100
Message-ID<spqtfl$4ah$1@solani.org>
In reply to#163934
On 18.12.21 13:21, Stefan Ram wrote:
> =?UTF-8?Q?Torbj=c3=b6rn_Svensson_Diaz?=  <torbjorn.svensson.diaz@gmail.com> writes:
>> What is the best way to learn C? Which are the best tutorials and which
>> are the best books? Can someone please give me a little guidance?
> 
>    Check out
> 
> "Modern C" by Jens Gustedt
> 
>    .
> 
> 

I agree that is a great C book. Though it is a somewhat advanced one. 
I'd suggest to also have a look at "Effective C" by Robert Seacord.

IMO, these two are currently among the best C books.

Also, at some point you might want to have a look at the C standard. It 
is quite readable. Especially the library section in the standard is IMO 
a very good way to learn about the library.

Philipp

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.c


csiph-web