Date: Wed, 16 Aug 2000 20:30:56 +0100 From: Mark Ovens <marko@freebsd.org> To: Mike Meyer <mwm@mired.org> Cc: t g <unixboy007@hotmail.com>, questions@freebsd.org Subject: Re: why c? Message-ID: <20000816203056.E254@parish> In-Reply-To: <14745.43302.410395.328073@guru.mired.org>; from mwm@mired.org on Tue, Aug 15, 2000 at 03:33:42PM -0500 References: <8519396@toto.iv> <14745.43302.410395.328073@guru.mired.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 15, 2000 at 03:33:42PM -0500, Mike Meyer wrote: > t g writes: > > i've been trying to learn unix off and on for a while now, and i finally > > trashed windoze ;-) now i'm running freebsd 4.0-release (only... no more > > windows at all!). > > > > anyway, when i was in college (not to long ago) i took a number of > > programming classes and all but one of them used c++. so, my question is, > > why is everything written in c? is it simply because unix was written > > before c++, or is c better for an os? > > Yes, Unix predates C++. I'm pretty sure Unix predated C, as before C > there was B, and before B there was BCPL, and the first C compilers > were written for Unix. However, the history of the two is to tightly > coupled to tell at this distance, so you'd have to ask someone who was > there. > From the Preface to The UNIX Programming Environment by Kernighan & Pike: "...Ritchie also wrote designed and wrote a compiler for the C programming language. In 1973, Ritchie and Thompson rewrote the UNIX kernel in C, breaking from the tradition that system software is written in assembly language." And from the Introduction to K&R 2e: "Many of the important ideas of C stem from the language BCPL, developed by Martin Richards. The influence of BCPL on C proceeded indirectly through the language B, which was written by Ken Thompson in 1970 for the first UNIX system on the DEC PDP-7" > Yes, C is better for OS work than C++. OS code needs to be close to > the hardware, and as efficient as possible. C++ sacrifices efficiency, > and possibly the ability to get close to the hardware, attempting to > provide a higher level of abstraction. C, on the other hand, includes > things so that you can reliably manage hardware. > > > i'm also interested in a good book on programming operating system if anyone > > has a recommendation (doesn't have to be geared toward unix). > > Well, Lyon's book on Unix makes a good one, though it's a bit dated. > > <mike > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- 4.4 - The number of the Beastie ________________________________________________________________ 51.44°N FreeBSD - The Power To Serve http://www.freebsd.org 2.057°W My Webpage http://ukug.uk.freebsd.org/~mark mailto:marko@freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000816203056.E254>