Re: Learning C with Older books ?.

From: Alwyn (alwyn_at_blueyonder.co.uk)
Date: 11/30/04


Date: Tue, 30 Nov 2004 07:23:10 GMT

On Mon, 29 Nov 2004 18:38:13 -0800, Jerry Coffin wrote:

> Alwyn <alwyn@blueyonder.co.uk> wrote in message news:<pan.2004.11.29.15.49.23.676626@blueyonder.co.uk>...
>
> [ ... ]
>
>> > However be aware that it makes many implicit assumptions about the
>> > programming environment.
>>
>> Does it? I thought it only assumed a standard C compiler.
>
> That's somewhat open to question -- in fact, the standard and the
> language itself more or less make some implicit assumptions that the
> environment is at least vaguely similar to UNIX.
>
> Just for example, some environments don't provide anything much like
> command-line arguments and/or environment variables. Admittedly, the
> standard does allow for these to be absent, but if the original
> environment had lacked them, the design would probably be different.
>
> The book also pretty much assumes that they will be present and will
> work (e.g. exercises that tell you to write programs that use
> command-line arguments).

I take the point. I'd never before thought that command-line arguments
were 'a Unix thing'; I always thought of them as 'a C thing'.

<snip>

> I can see where (for example) a person accustomed to MacOS <= 9.x would
> probably find it somewhat difficult to understand some of what they
> assume about how the user interacts with the OS.

Agreed, though many Macintosh programmers of that era would have used
Apple's MPW (Macintosh Programmer's Workbench), which was very Unix-like,
with make files and so forth.

> In fairness, it should also be pointed out that to a large extent, the
> world (at least of general-purpose computers) seems to have converged on
> a model of OSes that's fairly similar to UNIX anyway.
>
> Consider _The UNIX Programming Environment_ applies about equally well
> to Windows with cygwin as to Linux, Solaris, HP-UX, etc.

There was also *Software Tools* by Kernighan and Plauger, which became a
handbook for a generation of programmers and helped popularise the 'Unix
approach' to software design and integration. The experience of preparing
the Pascal edition of this book led Kernighan to write his famous essay on
why Pascal was not his favourite programming language.
<http://www.lysator.liu.se/c/bwk-on-pascal.html>

Alwyn



Relevant Pages

  • Re: Learning C with Older books ?.
    ... > environment had lacked them, the design would probably be different. ... were 'a Unix thing'; I always thought of them as 'a C thing'. ... though many Macintosh programmers of that era would have used ... why Pascal was not his favourite programming language. ...
    (comp.lang.c)
  • Re: How to change peoples minds about LISP?
    ... >>Why are so few system administrators using Lisp as a gluing language, ... > at least offers most Unix system calls, ... How do Lisp streams interact with underlying syscall failures? ... > No wonder then that the result does not appeal to Unix programmers. ...
    (comp.lang.lisp)
  • Re: In-Out Parameters for functions
    ... fixed environment, it is likely that the above code will always ... C/C++ programmers always say, and which you Ada guys sneer at. ... > when specified by RM more probably than when selected by the compiler? ... Removing sources of uncertainty in the language is good. ...
    (comp.lang.ada)
  • Re: (OT) Learning C (in order to patch nethack, so not entirely OT after all)
    ... This may sound very strange coming from a professional Unix ... It's a very restrictive environment, ... no professional (Windows programmers included) who uses it, ... programmers who already know Unix, ...
    (rec.games.roguelike.nethack)
  • Re: Learning C with Older books ?.
    ... >> environment is at least vaguely similar to UNIX. ... >> environment had lacked them, the design would probably be different. ... > the Pascal edition of this book led Kernighan to write his famous essay on ... > why Pascal was not his favourite programming language. ...
    (comp.lang.c)