Slashdot Log In
An Interview with Brian Kernighan
Posted by
Hemos
on Mon Sep 04, 2000 04:07 PM
from the reading-from-the-masters dept.
from the reading-from-the-masters dept.
Mihai Budiu wrote to us with an interview done with Brian Kernighan, one of the High Creator's of C. Good reading and good perspective on C.
This discussion has been archived.
No new comments can be posted.
An Interview with Brian Kernighan
|
Log In/Create an Account
| Top
| 144 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
|
2
(1)
|
2

Kernighan was not a "creator" of C (Score:4)
>Mihai Budiu wrote to us with an interview
>done with Brian Kernighan, one of the High
>Creator's of C
Brian Kernighan is not a "high creator" of C. All he did was write the book with DMR. Here's an exact quote from the interview, which you obviously did not read:
I can't comment on the ``worse'', but remember, C is entirely the work of Dennis Ritchie
GenChalupa
Aiighh! Apostrophe's! (Score:4)
Mr C (Score:3)
Good Read (Score:3)
Using an IDE (Score:5)
I was interested to see Kernighan say, When I write code on Windows I use typically the Microsoft development environment: they know where all the files are, and how to get all the include files and the like, and I use them, even though in many respects they don't match the way I want do business."
See, you're allowed to use them! It's OK!
---------
eqn - XML (Score:3)
In the interview it says that Kernighan is currently hacking eqn to output XML/HTML (presumably MathML?). This has been suggested as a CS thesis title at my university, fortunately I decided that it was far too sick a task to even think about.
eqn is kinda cool (given that it works wonderfully on pipelines with troff in cunning ways). But, surely by now all old eqn documents have been converted to TeX or MathML anyway? Does anyone outside of Bell Labs actually have any eqn documents?
Early C history (Score:5)
In many ways, Pascal was a better language, but Pascal had some inane limitations that stemmed from Wirth's academic orientation. Even Knuth criticized such things as Wirth's flat refusal to allow a "default" on case statements. "This is mindless pedantism up with which I will not put", Knuth wrote. Pascal also originally came with a lame I/O system designed for the CDC 6600 (a '60s supercomputer), no separate compilation, and no compile-time arithmetic, so you couldn't write "var tab[0..lim-1]" when "lim" was a constant. Unfortunately, that painful version became an ISO standard, leading a generation of programmers to beat their heads against the walls of the language.
This left an opening for C, which came with a system programmer oriented I/O library and, in time, a whole OS with free source code. Still, for much of the 1970s and through the mid-80s, serious researchers used Pascal. The Apple Lisa and the MacOS, for example, were in a dialect of Pascal, as were most early Mac applications. (The Lisa even had an object-oriented variant of Pascal by 1983.)
What killed Pascal, I think, is that Berkeley UNIX came with a truly lame Pascal implementation. Its horribly inefficient subscript checking implementation (a subroutine call for every subscript check) and miserable generated code convinced a generation of programmers that Pascal sucked. Still, the microcomputer world got a lot of work done with Turbo Pascal in the 1980s. It wasn't until the rise of Microsoft (a C shop) and the fall of Borland (a Pascal shop) that Pascal was crushed. One could argue that the decline of Pascal reflects Microsoft's dominance.
2 things I liked about this interview... (Score:4)
Teaching students skills so that they can step immediately into a Windows development shop and are able to write COM programs is just not right. That's not what universities should be doing; universities should be teaching things which are likely to last, for a lifetime if you're lucky, but at least 5 or 10 or 20 years, and that means principles and ideas. At the same time, they should be illustrating them with the best possible examples taken from current practice.
Now if only this interview was posted earlier, we could've used it on the discussion about what makes a good CS project a few weeks ago, which you can find here on Slashdot [slashdot.org].
The other thing is I liked the most about this interview was this quote:
I think I'm gonna frame this and hang it right beside my computer screen. Or append it on any bill we send to our clients.
C / C++ (Score:4)
Neither one is more powerful than the other. What the hell does "power" mean in a programming language, anyway? The word has no definition in a programming context.
The only relevant question, IMO, is which is the right tool for the job?
Sometimes, the job requires procedural programming. For that, procedural C++ or C is called for. Sometimes, the job requires object-oriented programming. For that, C++ or object-oriented C is called for. Sometimes, the job requires generic programming. For that, C++ or really hoary C is called for.
C++ is probably more versatile than C, but it comes at significant cost--compilers become complex, the STL is difficult to maintain, etc.
There is no clear "more powerful" language. Use the right tool for the job.
And insofar as operator overloading in C++... I use it all the time. Where's the problem?
Casting to a void * (Score:3)
Production C++ code ought to use static_cast instead of these C-style casts (enhances type safety). I'm using C-style casts here for ease of reading.
#include <iostream>
using namespace std;
int main(void)
{
int x = 123;
void *y =
int z = *(int *)y;
cout << z << endl;
}
Funny Dilbert with Alice and a unix programmer (Score:3)
The next frame takes place "sometime next week..."
Dilbert and Wally at the copier:
Re:Early C history (Score:4)
It's no accident that Apple developped it's Macintosh with Object Pascal.
Demonstrably untrue. (Score:3)
In the early days of Objective C, its performance was piss-poor due to its habitual late binding (putting off as many decisions to run-time as possible). C++ won, in part, because its early binding made for much faster code.
If you can't write C++ code which blazes by faster than a jackrabbit on amphetamines, that's a problem with your skill, not the language.
The importance of balance (Score:3)
I think more of the newer users of Linux should read a little more about people like this and a few other more important "personalities"
I agree in a big way. Ever notice how the really important people, when asked about their favorite language/editor/IDE/window-manager/etc, usually answer along the lines of, "Oh, I'm comfortable with about all of them; I can switch languages as needed; I use more than one of <whatever>."
I was re-reading a 1995 issue of IEEE-CS "Computer" magazine, and one of the articles was pointing out that bigots and advocates of a single method or a single approach or a single tool (e.g., langugage, editor, what have you) were invariably beginners and novices with little experience or useful education. Skilled programmers and designers know how to be flexible.
The newer users of Linux, as you say, should take note of this before starting the next flame war.
Re:Early C history (Score:3)
Modula is fully capable of support systems programming: you can write OSes, drivers, whatever. In that regard, it is as powerful as C. Unlike C, it has an excellent syntax and superlative large-project structures. You haven't experienced wonderful programming until you've experienced interface modules that are kept completely seperate from the corresponding code modules.
Oberon is an OS and language, combined. I don't know enough about it to provide any greater detail.
Modula-3 is a DEC initiative to develop the best p ossible large-project/team-project programming language. There are a *lot* of ideas and tools in the Modula-3 world that should be liberally stolen and redeployed in other languages.
I might also mention that Turbo Pascal is, in most ways, just a Borland interpretation of Modula-2. Indeed, it was originally suppposed to be named for Modula, but the marketing 'droids realized that pretending it was Pascal was a wise and politic move.
--
Re:Early C history (Score:4)
Okay, let's see. First of all, it's available for download here [oberon.ethz.ch], if memory serves me right. It runs as an application under Windows, Mac OS and Linux, as well as natively on PCs and on the ETH's own architecture.
For those who haven't programmed in Modula: it feels quite a bit like Pascal. But in a good way. It's high(er)-level, safe(r), "really" OO - all those things that C/C++ isn't. It's a joy for programming big systems, although a bit cumbersome for small ones - you do find yourself wishing you were using Perl. The OS itself is quite different from anything I'd ever used before, both its UI (not window-based, rather more reasonable, and I suppose it'd be easier to learn for a newbie, but I'm addicted to this damned WIMP paradigm, so I had a hard time with it) and its guts (it's a truly open system; everything is a module, written in the same language, communicating directly through the language primitives - no need for dumb-ass IPC, marshaling or "lowest common denominator" file formats; it reminds me a bit of Symbolics' Genera OS that ran on Lisp Machines).
I can't really say much more about it, but I do recommend that the reader downloads it and tries it out for himself.
I had him as a professor (Score:5)
He is an incredibly endearing fellow. In the first class, to demonstrate the concept of an algorithm, he had the class (of 400+) shout out instructions on how to make him trim his beard. He spread out several instruments of cutting (including a small chain saw...the guy has a nice sense of humor) on the desk in front of him, and would ignore any directions that comprised more than one action. So, if somebody would say "Pick up the scissors!" he would reply, robot like, "What are scissors?"
So, you'd have to say things like "Extend your right hand 4 inches", etc. In the end, he even cut of a small amount of his beard, to the immense cheers of the class.
He's one of the more intriguing characters in CS history, the "k" in "awk", always tagging along on some of the more interesting projects in (C, Unix), but never really striking out on his own.
The cool thing is, he is very self deprecating and would be the first person to admit his shortcomings.
Awesome professor, as his enthusiasm for even the simple aspects is always evident. He loves the stuff, and thus you want to love it as well.
A cool note, he is the person who invented the concept of creating a program to print "Hello world".