:: Re: [DNG] C and learning C
Pàgina inicial
Delete this message
Reply to this message
Autor: nick
Data:  
A: dng
Assumpte: Re: [DNG] C and learning C


Here I will jump in with my 2c about learning C and what is a good book.



My recommendation would be to go to K&R: The ANSI C programming language. See:

https://archive.org/details/the-ansi-c-programming-language-by-brian-w.-kernighan-dennis-m.-ritchie.org



Originally this was published as "The C Programming Language" and being by inventor of C (Dennis Ritchie) it was the bible and the vehicle by which many programmers including myself learned the language. Although the original language as documented was slightly behind the language as practiced, e.g. structure assignment was not in the book but all major compilers including Ritchie's could do it.



It's short and sweet -- the physical book was quite slim and the pages were less than A4 size. It has a chapter on each major C feature. And I guess it was updated for ANSI C which brought a few changes, notably the ability to use float for calculations (earlier version used double for calculations and float as a storage type only) and the ability for the compiler to type check function calls which was previously a separate tool (lint).



If you were looking for more of a tutorial I could recommend Herb Schildt e.g. "A Book on C" but do note that Schildt is polarizing, some people hate him and he has been caught out making some technically incorrect statements in the process of simplifying things for beginners. I personally don't think it matters and I like Schildt a lot.



As someone with a longstanding love affair with C I would be happy to answer any more questions you may have. For now, suffice it to say that C is essentially an abstract model of a CPU (all major CPUs of today conform to this model at least in a general sense). For that reason it is perfect for embedded and systems programming but not as good for high level or applications programming, because it's deliberately machine-friendly rather than programmer-friendly. That said, it isn't completely programmer-UNfriendly.



To know more about the history of C you can dig into Unix history by reading the C related papers from Bell Labs and you can fire up early Unix versions such as V6, V7 and read the source code of the compiler itself. This gives considerable insight into the challenges faced by Ritchie and Thompson (who worked on early versions of C when it was called B, some of this is available too) and how they addressed those challenges.



You can also look at Martin Richards's BCPL site if you want to go even further back.



Kind regards,

Nick



PS Thanks to those who returned my greeting mail. We are on the same page!








>
> On 24 Sept 2024 at 10:00 pm, dng-request <dng-request@???> wrote:
>
>
> Send Dng mailing list submissions to
> dng@???
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> or, via email, send a message with subject or body 'help' to
> dng-request@???
>
> You can reach the person managing the list at
> dng-owner@???
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Dng digest..."
>
>
> Today's Topics:
>
> 1. Re: Learning C (o1bigtenor)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 24 Sep 2024 06:02:16 -0500
> From: o1bigtenor <o1bigtenor@???>
> Cc: dng@???
> Subject: Re: [DNG] Learning C
> Message-ID:
> <CAPpdf5_czHqfRodN1XnFmmEUY=ueGuxn7+3TvY+0ZcmxcYkasA@???>
> Content-Type: text/plain; charset="utf-8"
>
> On Tue, Sep 24, 2024 at 3:44?AM Didier Kryn <kryn@???> wrote:
>
> > Le 24/09/2024 ? 04:05, o1bigtenor via Dng a ?crit :
> > > learning Gnu C
> >
> > The title looks bad, sorry. I have a great admiration for Gnu in
> > general, but there shouldn't be a thing named "Gnu C". There is C and
> > there is a C standard and it is not set by Gnu. Maybe there is no other
> > ressource on the web. However, when looking at this web resource I see
> > it refers to C99 and Gnu extensions and this seems very outdated.
> >
> > In the mean time we had C11 and now the current standard is C17
> > which corrects some errors of C11. The C compilers and C libraries
> > nowadays are working on implementing the next standard, C21, IIRC.
> >
> > The GU C resource I found on the web also states that GCC is the
> > "Gnu Compiler Collection", but, a few years ago, for the second time in
> > history, GCC has divorced from the FSF, because of issues with RMS.
> >
>
> Had heard of that particular kerfuffle - - - seems to me to be mostly
> related to personality issues rather than technical stuff.
>
> >
> > In general there are two references for C programming: the C
> > standard and the POSIX standard. All OSes aim to more or less comply to
> > both, and I recommend avoiding as much as possible GNU extensions or
> > whatever extension.
> >
> > Refering to the standard is not the proper way of learning though.
> > I consider the best way is to take lessons, and the second best way is
> > to use a good book. A book about C only, not "C and C++".
> >
>
> Hmmmmm - - - so there are a whole pile of 'secret handshakes' and the
> like in the learning of 'C' to necessitate the need for lessons - - -
> that's
> too bad. Having read many reports of poor quality C programming I am
> somehow then even less impressed.
> You're recommending a good book - - - - imo there are likely a
> plethora of books - - - how does one determine which are good ones without
> previous understanding? (Seriously - - - to accurately determine the
> quality
> of a didactic text takes expertise and when one is starting the learning
> process what one is exactly short of is that - - - expertise!)
>
> Over to you for more information.
>
> Regards
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://mailinglists.dyne.org/cgi-bin/mailman/private/dng/attachments/20240924/1d135890/attachment.htm>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>
>
> ------------------------------
>
> End of Dng Digest, Vol 120, Issue 31
> ************************************
>