Linux Journal Interview With Brian Kernighan
pndiku writes "Linux Journal has an interesting interview with Brian Kernighan where he talks about AWK, AMPL and how he had nothing to do with the creation of C."
← Back to Stories (view on slashdot.org)
The story has a link to ampl.org, the correct link is ampl.com.
John.
So, we still have K&R, just as before. Only now, maybe some readers understand better that K&R is not the names of the C inventors, but the name of the people who wrote the book about how to use C ;)
The book you are referring to:
The Practice of Programming
Kerningham and Pike
Addison-Wesley, 1999
is a classic text and it's very clearly written. The front cover sums up in three words the core philosophy of the entire book:
Simplicity
Clarity
Generality
It is a delight to read although it uses C/C++ as the example language everywhere and tends, therefore, to be a little C oriented, although there are examples in other languages.
Much of the material will be familiar to people who've done a CS degree (e.g. trees, O-notation, etc.) but the section on testing is very worthwhile if you are planning to write code that will last a long time.
John.
The 1st gets was based on a
while(*buf++=getchar())
type of loop
Once the preprocessor got more goodies, and STDIO was cleaned up, it became:
#define gets(x) fgets(x,BUFSIZ,stdin)
So in the days when there were only 100 or so Unix sites you could declare strings with
char buf[BUFSIZ];
and you couldn't overflow it.
Brian K is a really nice guy, it seemed to me. Another gift of the city of Toronto and the University of Toronto to humanity! I heard him talk at UofT a year or two ago. It seems he teaches Visual Basic in his programming course at Princeton. I'm a C nut so that came as a shock to me. Still, I really admire the guy.
Let's see ...
If you had done as much important work, I think you would be worthy of an interview, too. That's no guarantee that you'd have much to say, of course.
"And this is my boy, Sherman. Speak, Sherman." "Hello." "Good boy."
Can't speak for Mr. Ritchie, of course, but it could be that he was refering to the FreeBSD 4.4 built into MacOS X
The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...
I'd have to agree. I was taking a grad level course on programming language foundations, and the prof did the famous sieve of erasthones in one line (well two lines, since you have to call the sieve function from somewhere) in Haskell:
/= 0]
f (h:t) = h : f [ x | x <- t, x 'mod' h
main = f [2..]
The only reason it's possible is due to Haskell's lazy evaluation, so you can have infinite recursion defining a list, and it's not really a problem, unless you try to grab every member of the infinite list and use its value.
Well, I was impressed. You all may be jaded.
Head down, go to sleep to the rhythm of the war drums...
Why? It is perfectly possible to write a C program that contains int foo, *bar; and performs correctly for all inputs. The same is not true for a C program that calls gets.
Here's an HTML version of Why Pascal is Not My Favorite Programming Language. There's a Postscript version on Kernighan's website
Isn't it odd that I'd recommend to people who want to become programmers to avoid taking Brian Kerningham's class?
... like what you see on Slashdot every day). It's not just a programming course -- it covers pretty much every aspect of the field of computing and its related subjects, though in somewhat limited depth.
I know people who have taken his classes. I live with one of them (a CS type), and used to live with another (a non-CS type). All of them have nothing but good things to say about Kernighan's classes.
The class in which he teaches VB is oriented towards non-CS types, and, from what I saw of my former roommate's coursework, I can't imagine a better course to give people who are basically computer illiterate SOME idea of just what goes on inside the magic box, and some familiarity with all the issues surrounding information technology (legal, ethical, etc.
Complaining about VB's namespace problems in this context is like bitching about giving a toddler a tricycle because he'll never win the Tour de France on anything with three wheels. My former roommate had no problems with his programming assignments that he wouldn't have had in any other language, and, judging from what I've seen of people trying to pick up C and Java for the first time, VB is a far better choice of language for a course that aims to give people a flavor of what computers are all about.
Pascal may be dead, but in Windows-land at any rate its child, Object Pascal lives on. And if you compare how Object Pascal evolved from Pascal to how C++ evolved from C, Pascal wins every time.
The other neat thing (from one perspective, bad from another) is that Pascal was essentially abandoned to Borland. Lacking the need to standardise it, they added many many useful abilities into the language that make it an ideal Win32 workhorse. Unlike MSVC++, when it would have led to better integration with Windows Borland extended it, for instance IDispatch is integrated into the language seamlessly, so you can do:
var WordDocument :OleVariant;
begin
WordDocument := CreateOleObject("Word.Document");
WordDocument.SomeMethod();
end;
ie in order to support COM instead of messy cludges that make you do things manually support for late bound object methods were added to the language.
Of course that means you were essentially tied to one companies compiler, but nonetheless that doesn't make the language any less nice.
He was pointing out (rightly so) my lack of malloc. I was assigning to empty space.
It's true that there is the Mach kernel involved (here's a simplified cake-layer diagram), but from the context that Ritchie provides ("The way I use them, which is as a casual programmer, it doesn't matter--they are all the same...") none of that is really relevant. The APIs that he expects from a unix are there in the FreeBSD 4.4 code layer. (X11 is there too, by the way). He would have to be using the word "FreeBSD" very pedantically to mean that it's FreeBSD/PPC and not the FreeBSD 4.4 in OSX. It doesn't sound like he's being pedantic in this interview.
The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...
Pascal's main problem is that nearly every "real world" implementation of Pascal has dealt with the problems presented in the paper, Unfortunately in different and incompatible ways.