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


Groups > comp.lang.c > #23097

Re: Learning C by reading

From Phil Carmody <thefatphil_demunged@yahoo.co.uk>
Newsgroups comp.lang.c
Subject Re: Learning C by reading
Date 2012-07-06 01:15 +0300
Organization A noiseless patient Spider
Message-ID <87d34926sy.fsf@bazspaz.fatphil.org> (permalink)
References <87bok3u4lj.fsf@gmail.com>

Show all headers | View raw


Sergi Pasoev <s.pasoev@gmail.com> writes:
> Hello
> 
> What are the programs you think make a good reading to learn the
> language by studying and modifying the source code ? I often try to
> understand the things in the standard library, and apart from doing this
> kind of search myself, I would be glad to hear some ideas from more
> experienced programmers. I think there must be many Free Software
> programs which have some well-written, easy to understand code. 
> 
> Or any good place to search for some code to learn from.

I would say 'busybox'.

Basically, you've got the source code to a hundred useful programs,
but each one of them has been stripped down to the bare essentials.

Compare the length of the source code for GNU 'true' with busybox's
'true'. Ditto 'false'. Ditto 'yes'. Etc. etc. ...

Don't think busybox's programs are functional enough? Great - that's 
your programming exercise!

Unfortunately, the maintainers of busybox do include hackish 
microoptimisations simply because they make the x86 binaries
shrink, with no care for the portability of the optimisation.
(I've not checked, maybe it's because all other architectures
are carp, that's a common excuse.)

Phil
-- 
> I'd argue that there is much evidence for the existence of a God.
Pics or it didn't happen.
-- Tom (/. uid 822)

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Learning C by reading Sergi Pasoev <s.pasoev@gmail.com> - 2012-06-28 14:13 +0400
  Re: Learning C by reading James Kuyper <jameskuyper@verizon.net> - 2012-06-28 06:59 -0400
    Re: Learning C by reading Andrew Cooper <amc96@cam.ac.uk> - 2012-06-29 00:56 +0100
      Re: Learning C by reading James Kuyper <jameskuyper@verizon.net> - 2012-06-28 20:21 -0400
  Re: Learning C by reading Johann Klammer <klammerj@NOSPAM.a1.net> - 2012-06-28 18:08 +0200
  Re: Learning C by reading Aaron W. Hsu <arcfide@sacrideo.us> - 2012-06-28 15:00 -0500
  Re: Learning C by reading Rui Maciel <rui.maciel@gmail.com> - 2012-06-29 02:48 +0100
  Re: Learning C by reading rouben@shady.(none) (Rouben Rostamian) - 2012-06-29 08:55 +0000
  Re: Learning C by reading Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-07-06 01:15 +0300

csiph-web