Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming IT Technology

An Interview with Brian Kernighan 144

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

Comments Filter:
  • by GenChalupa ( 150051 ) on Monday September 04, 2000 @12:19PM (#805815)

    >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
  • by frogstar ( 6731 ) on Monday September 04, 2000 @12:23PM (#805816)
  • by l33t ( 225843 ) on Monday September 04, 2000 @12:25PM (#805817)
    I'd hardly call him a high creator. The man is 5' 6", tops. That's hardly tall. I'd say I could take him (I mean this in a non-homosexual way). Why is slashdot even mentioning his height? This is hardly 'News for Nerds' now is it? Now ESR, he's a tall man. Not to mention RMS. FDR wasn't that tall I believe, sat down a lot anyhow. Lincoln, well of course he was tall, what with that hat. I don't think he was involved in the development of C.
  • by cansecofan22 ( 62618 ) on Monday September 04, 2000 @12:27PM (#805818) Homepage
    It was a real good article. 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" of the Unix and programming and networking worlds. It will give you a much higher appreciation of the roots of Unix and therefore Linux also.
  • No, you're mistaken. I think C is much, much more powerful than C++. Not to mention easy to use. I mean, have you even looked at operator overloading in C++?! Whoever developed that was having a laugh... who the hell would ever remember that?
  • Who *wouldn't* be delighted to be one of the creators of C++?
  • C++ sucks, but I love bearded guys!
  • ...is C?

    Well, I think C scores impressively highly considering its age, but
    surely scheme beats it! It's far more expressive, and gives pretty
    good resource predictability, due to its simple execution model,
    uniform syntax and treatment of data. And, if I had just one compiler
    on a desert island, I can't think I'd choose one without garbage
    collection :-



  • Hemos, damnit. Reading the actual story is more important to your web site than reading about bestiality for jerk off material.

    If you can't make up more than two lines about the interview, then it's obviously not worthy to be featured on Slashdot.

    That's my opinion. Flame me!
  • by Anonymous Coward
    Thank God for the perpetuation of the use of an apostrophe as warning of upcoming pluralization's.
  • by update() ( 217397 ) on Monday September 04, 2000 @12:42PM (#805825) Homepage
    Every time KDevelop, Kylix, Code Warrior or another GUI programming tool is mentioned here, we always get comments like this [slashdot.org] saying something to the effect of, "The existence of GUI programming tools is bad. Good code can only be written from the command line."

    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!

    ---------

  • Errr, apparently you can't link to comments in an archived story. See the first post (#7) here [slashdot.org].

    ---------

  • That's my opinion. Flame me!

    Ahem... Please consider yourself flamed... Don't really want to do this, but since you asked, I'll oblige.

  • by tobyjaffey ( 132850 ) on Monday September 04, 2000 @12:47PM (#805828)

    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?

  • Oh, please. C++ is (basically) a superset of C. You can do anything you can do in C in C++, and you can take advantage of *some* CC features (e.g., references, function templates, etc) even without having to use classes and OOP. Stop spreading your FUD.
  • Although it is quite old now, there aren't many compilers that fully support the C++ standard. I know of Kai's compiler as the only one that currently support the full standard on linux.

    Hence there is still a need for C if you need portability across platforms and compilers. C++ doesn't offer cross-compiler portability on a meaningful scale just yet.

  • Warning: I am a C++ hacker, and I like it a hell of a lot.

    Answer: People are using C++. Every single program in The C Programming Language is a perfectly good and valid C++ program; in fact, Bjarne Stroustrup himself recommends reading The C Programming Language as a way to improve one's C++ skills.

    The advantage of C++ is that it's a hell of a toolbox. You've got hammers, screwdrivers, chisels and even a fully-functioning wood lathe (watch me turn this chunk of hoary code into a table leg!). Good programmers use the right tool for the job.

    And if the right tool for the job happens to be procedural programming, C (or procedural C++) is an entirely reasonable thing to do.
  • Scheme is a dialect of Lisp, which dates back to the time of FORTRAN and COBOL. It's hardly new. (I happen to prefer Common Lisp myself)
  • by Animats ( 122034 ) on Monday September 04, 2000 @12:55PM (#805833) Homepage
    C was a successor to BCPL [cam.ac.uk], a rather lame programming language from 1967. (In some circles, it was known as the British Cruddy Programming Language.) Some important early work was done in BCPL, including the low-level code for the Xerox Alto. BCPL didn't really have types; everything was a "word", much like assembler or PL/M. With Pascal available to show the way, C was the next logical step - sort of a BCPL with types.

    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.

  • I really liked this interview, as it gave me some insight on how those Old Masters of Coding of the Days of Yore think. Or, at least, one of them. Here's the first thing that got my attention:
    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:
    ...the areas that are difficult are only two: one that it's too hard to write programs that work, and the other that it's too hard to use computers. So if you want things to work on, these are two that you could try.

    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.

  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Monday September 04, 2000 @01:01PM (#805835)
    C is a loaded gun aimed at your foot; C++ is a Gatling gun aimed at your head. Describing C as much, much more powerful than C++ isn't just wrong, it's ridiculous.

    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?
  • What is your goal? How time do you have? Who do you have on staff? How many line of code are expected? Answer these question and you would know why you would pick C over C++ or C++ over C. Ok
  • Actually, in a maximized Netscape window at 1600x1200 the topic is a little over a half a line.

    -Antipop
  • Your comment sounds a little bogus. I have never seen a young /.er eulogizing the use of cat(1) and sed(1) for program development. Yes, a sizeable amount of them extol the virtues of vi(1) (supposedly to stay truthful to the nature of UN*X, as if vi(1) were an original part of UN*X) as a great programming tool, but I would hardly call vi(1) a command line program.
    --
  • by Anonymous Coward
    You really took that quote out of context. He says that he prefers to use text tools and UNIX, but on Windows the MS development tools already know where to find all of the files, so he uses those. He says "in many respects they don't match the way I want do business", which does not suggest deep love for the tools. I'm not saying that IDEs are bad, but this quote really doesn't say they're good.
  • flamebait. Go back to the old country, wherever it is, and slap the professor who taught you English grammar.
  • I don't know whether knowing the history of Linux/Unix is necessary to appreciate the operating system, but it probably doesn't hurt. I do agree with you that this was an excellent interview. It is very obvious that the interviewer had done his homework and came with many good questions. If Mihai is reading these comments: thanks a lot!
  • Sure, but Common LISP doesn't compare so well with C in terms of
    leanness and predictability.

    I posted before I read Kernighan's comments about ML (nicely put, I
    guess I agree with him), and if Scheme is less an `academic' language
    than ML, you do need to grok higher-order functions to get the most
    out of it. My own guess is that in the very long term, functional
    languages will win out, but that's a long, long way off yet.

  • I read /. for the occasional good link. Whenever I read the comments or pay close attention to the writeups, I get VERY ANGRY (like now).

    Slashdot is a good source of links, but is fundamentally content-free. Reading it like this [pootpoot.com] is just as useful.

  • by Anonymous Coward
    Has anyone read the pdf by Rob Pike mentioned in the interview ? The page is gone, but you can access it via http://linux.usc.edu/~ehovland/utah2000.pdf .

    I found it very interesting (as I was getting sick of BillG overusing the word "innovation"), but after reading it I kinda agree with him. Now who has any new open-source ideas ?

  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Monday September 04, 2000 @01:21PM (#805846)
    Note that in the below code, the value of x is cast to a void pointer y (implicitly, not explicitly--bad programming form, but done here only to show it can be done without the compiler complaining; explicit casting can similarly be done), and y is cast back to an integer variable. This code is legal ANSI C++, and compiles under egcs-2.91 with -Wall -ansi -pedantic without error or warning.

    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;
    }
  • Go back to the old country, wherever it is, and slap the professor who taught you English grammar.
    Now, now... it's not fair picking on someone just because he doesn't write English as well as you'd like. It's not as if it's easy to learn proper English merely by taking a couple of courses at school! Even less when we're probably dealing with some indio bajado del cerro a tamborazos.

    However, I have to agree, he's an idiot, and as far as I'm concerned, it's open season on them all year long.
  • ... you'd bury your own garbage?

  • by AFCArchvile ( 221494 ) on Monday September 04, 2000 @01:34PM (#805849)
    I remember a Dilbert with a Unix programmer, bearded, with suspenders, told a boring story about programming. At that point, Alice takes the pudgy programmer by the suspenders and says, "Look you bearded road apple, one more pointless anecdote like that and I'll snap you into next week!!!"

    The next frame takes place "sometime next week..."

    Dilbert and Wally at the copier:

    Wally: (looking at the wall) "Hey, that looks like a rift in the space-time continuum."
    Dilbert: "Did you just hear a snap?"
  • My take is that only a small percentage of programmers have ever really got the oo paradigm.
  • by Anonymous Coward
    1. What females would you choose, in order from my favorite downwards?

    Natilie Portman
    This chick from sales with big tits
    Miss Feburary 1974 (from playboy)

    2. Why would you choose those females?

    N.P - It is Miss Portman; I mean *duh!*
    Sales Chick - she is a hottie
    Miss 1974 - She was in the first Playboy I ever owned/found; she is a life long dream.

    3. What kind of stone (or other immobile substance, natural or manmade) would you transform them into?

    N.P - bronze
    Sales Chick - Balsa Wood
    Miss 1974 - bronze plated aluminum

    4. Describe the pose each girl would be in.

    N.P - casual stance
    Sales Chick - Sitting
    Miss 1974 - on all fours in the doggie-style position

    5. Describe the facial expression each girl would have.

    N.P. - a normail relaxed expression
    sales Chick - a bored, what-am-I-doing-here look
    Miss 1974 - a look of total extacy

    6. Explain what each girl would be wearing, if anything.

    N.P. - A mini skirt and a blouse that show-cases her tits.
    Sales Chick - Standard issue work outfit
    Miss 1974 - totally nude

    7. Explain what you would do with the girls after they were petrified.

    N.P. - Go out have have tacos. Light conversation.
    Sales Chick - I would sit her next to me in my car so I could use the HOV lane on the Dulles Toll Road and on 495.
    Miss 1974 - Hard core sex

    Thanks for your participation!

    You are welcome, I hope I helped!

  • You have to use an anchor instead, like so: slashdot.org/articles/00/05/04/0458238.shtml#7 [slashdot.org]

    --

  • by Pig Hogger ( 10379 ) <pig.hogger@g[ ]l.com ['mai' in gap]> on Monday September 04, 2000 @01:47PM (#805853) Journal
    In many ways, Pascal was a better language, but Pascal had some inane limitations that stemmed from Wirth's academic orientation.
    Fortunately, BORLAND sufficiently hacked at Pascal, and turned it into a much more useful product than C.
    It's no accident that Apple developped it's Macintosh with Object Pascal.
  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Monday September 04, 2000 @01:47PM (#805854)
    While C++ may lose to C in the executable size, C++ has minimal loss to C when it comes to speed. The mantra of C++ is you don't pay for what you don't use, and most compilers do a pretty good job of living up to it.

    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.
  • So get a C compiler with garbage collection. Better yet, just get a li brary [freshmeat.net] for it.
  • Borland may have been a Pascal shop, but they had a damn fine C compiler in the early eighties.
  • I'd like to note that this was a *great* interview and I'd love to see more interviews done by Mihai.

    There are so many wannbe tech journalists out there that it's good to read an interview conducted by someone who know the subject's favourite subject.

    Yes, I am aware that Brian did most of the talking. But hey, only the right questions trigger interesting answers.

    So thanks Mihai. If your career in research fails, consider making interviews with the heroes of computer science. :-)

    ------------------
  • No, I think he would eat it.
    But would C match the F-Plan [viva.org.uk] diet?

  • >Creating a 'high-level' language in which the >rogrammer must worry about allocating memory and leaks is a bad thing. Please. What do you want- garbage collection? Back then it would have taken more of the processor than the application. Even now its a noticeable lag. Memory leaks are a problem only if you cant program worth a damn, or your specs are totally FUBAR. >Creating a language where no one can quite determine how multiple inheritence works is a bad thing. I understand it perfectly. Class C, inherited from both A and B, has all the public/protected members of both. Not hard. >In a high level language, one should be able to implement a stack in under 8 lines. Now this is bad reasoning. Thats completely opinionated. You can't do it in C, C++, Pascal, or Java. You can do it in perl only because of the push and pop functions. Please tell me why a language needs to be able to do a stack in 8 lines, Im dying to know. >They should have left it there and gone on with lisp or ML. God no. ML? ANd have to have the output of every if statement the same on both the if andd else parts? To have to have an else? Its useless in the real world. Go back to academia.
  • C was a successor to B, which was a successor to BCPL. The "B" just came from the first letter of BCPL. It was deliberately left unspecified whether the choice of "C" was the next letter in the alphabet, or the next letter in BCPL (i.e., would C's successor be "D" or "P").

    Trivia for you: the // end-of-line comments came from either BCPL or B, were removed in C, and were re-added in C++.

    There's some really cool stuff on the history of C on Dennis Ritchie's homepage. Which I can't find right now.
  • Well, watch closely. I can't stand vi. 'cat' and 'sed' are excellent tools. But I think what *he* was talking about was using some sort of text-based, interactive editor *from* the command line, and using the compiler entirely from the command line, and writing your program that way.

    Hey, why isn't vi a CLI program, eh? Just 'cause it has that "EIGHT KILOBYTES of cursor positioning code"? I mean, really, what's wrong with xvi? Is it that megabyte of display-independent graphics code? Oh well. Ed. Ed is the standard. Text editor. ;)
    ---
    pb Reply or e-mail; don't vaguely moderate [ncsu.edu].
  • I honestly don't know why the functional languages don't succeed. For instance ML, which is arguably the best combination, perhaps the one that ought to succeed: [..] I will oversimplify a lot, and probably offend my friends, by saying that the only thing people do with ML is to make ML compilers.

    A nice example of what functional languages can be used for--besides compiler construction is--the current Internatiobal Contest for Functional Programming [cornell.edu]. The task was to build a ray tracer within 72 hours. The entry [inria.fr] of the Objective Caml [inria.fr] team is especially impressive.

  • by devphil ( 51341 ) on Monday September 04, 2000 @02:25PM (#805863) Homepage

    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.

  • stack S;
  • In a high level language, one should be able to implement a stack in under 8 lines.

    What is STL?

  • Yes, but Scheme doesn't look like C. Read the article again, and replace 'ML' with 'Scheme', or whatever your favorite functional language is.

    Also, remember:

    1) BWK is sympathetic to your plight.

    2) Think that perhaps one reason why he picked 'C' is that he could probably write Scheme in C if he really had to, but you could never write C in Scheme, and if you did, it'd be too slow. If you ever manage to write an optimizing C compiler in Scheme, though, hat's off to you. I'd be impressed just by the assembler... Therefore, in the long run, I think he'd be better off with his choice.

    But yeah, I kinda like Scheme too. I might try writing it in Perl sometime. ;)
    ---
    pb Reply or e-mail; don't vaguely moderate [ncsu.edu].
  • Pretty much every day I still use eqn(1). It provides a clean, straight-forward, easy to remember way of describing equations. It's about 600% faster than using MS Word's whacked out equation editor.

    I'll note here that unlike TeX, Word Perfect, MathML, MS Word, WordStar or whatever other thing you've got, my eqn/tbl/troff from 1977 still formats correctly and gracefully. The only thing about my documents had that changed were SCCS became RCS.

    Those who use fads to create their documents (MS Word version XXX for example) don't plan on reusing their words which is just as stupid as not reusing code.

  • What the hell does "power" mean in a programming language, anyway? The word has no definition in a programming context.

    Let's look at the general physics definition, taken from the American Heritage dictionary.

    power: n - The rate at which work is done, expressed as the amount of work per unit time and commonly measured in units such as the watt and horsepower.

    I'd suggest that power exhibited in the programming-language context would be something like this:

    power: n - The rate at which programming work is done, expressed as the amount of programming tasks written per unit time and commonly measured in units such as statements or lines of source code.

    This is only one interpretation, mind you. Higher-level languages would thus be deemed more powerful than lower-level languages, as the source-code to machine-code ratio is more extreme. It takes fewer statements or lines of source code to express a program task in a more powerful language.

  • How old are you? 19? Are you studying cs? I bet you are a 19-year-old studying cs who just learned scheme. Every 19-year-old-learning-cs-who-just-picked-up-scheme (myself included) in the WORLD at one point or another convinces himself that scheme is the world's best computer language.

    At some point though, the novelty of it wears off and you realize you can't get anything really useful done in it and you move on to something will powerful APIs and something natively supported by your OS (such as C).

  • No! That's just what they WANT you to think! Its really all a conspiracy. See, if you use their IDE, they can then implant subliminal messages in your code to take over the minds of those who run your program.......

    In fact, how do I know they didn't do that to this web browser? They're everywhere


    -RickHunter
  • by FFFish ( 7567 ) on Monday September 04, 2000 @02:49PM (#805872) Homepage
    Might as well continue the Pascal thread, by mentioning that Wirth then went on to address Pascal's deficiencies by creating Modula, and then Oberon.

    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.


    --
  • You can hardly put TeX and MathML in the same category as the rest?

    MathML is a totally clean, portable way of describing equations. AFAIK it's much cleaner than eqn with it's idiosyncracies.

    Meanwhile, TeX is the choice of most mathematicians for publishing papers. It's changed very little over recent years, hardly like Word.

  • Come on language, it should be like english. I know I should be dead, but I haven't got there yet.
  • by Li0n ( 110271 )
    "I think that the open-source movement is in general a good thing. I am not sure that it will ever replace tailored, professional, rock-solid commercial products sold for profit."

    Where can I get that?! :P

    ---
  • <snark mode on>
    (A great programmer, on the other hand, uses a very high-level-language (ie. Python), and then profiles the code and rewrites the bits that really need the speed in a lower level language (ie. C/C++). The programmer thus achieves far greater productivity. The time saved can be dedicated to improving the code even more, or adding additional functionality, or performing very extended fault/bug testing, or moving onto another project.)
    <snark mode off>

    Erm. Ah, did anyone hear anything?

    Oh. I thought not. Nevermind, it must have just been my imagination. Sorry.


    --
  • I do appologise, for my previous comments, my excuse is I'm pissed
  • by Kaufmann ( 16976 ) <rnedal&olimpo,com,br> on Monday September 04, 2000 @03:14PM (#805878) Homepage
    Oberon is an OS and language, combined. I don't know enough about it to provide any greater detail.

    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 know, because I recently asked this question on the OSI license discussion list. The major flaws in the Plan 9 license being that AT&T can require you to provide your private changes (ones that you havent distributed to anyone), and also revoke your ability to use the code should you file suit against AT&T.

    I only bring this up because the interview incorrectly refers to this OS as "Open-source". It isnt.

  • I'm sorry, but you really need to address this to the guys in Congress and your own armies who need the military-industrial conspiracy to keep their careers going. Normal Americans couldn't give a flying rat's ass about South America and don't really care if their neighbor does a little coke, although at this point it's relatively passe in polite company.

    Unfortunately it'll probably be the peasants who gets killed more than anyone, and unfortunately that's probably not you. You can blame everyone else for your troubles but if you had the backbone to get rid of the corrupt dictators that run your banana republics you might have a chance at a stable democracy. And it would help, if you want anyone to take you seriously, if you could drop the macho attitude which stereotypes Latin males as hot-headed assholes. Your people really deserve better; you could help by not being such an asshole yourself.

  • Man reading this interview I am utterly inspired by Brian Kernighan. He has seen so much stuff with his very own eyes. For god sakes, he KNOWS the guy that wrote vi!!

    God, he was at the center of everything, and still is quite in touch with the state of computer science and computing today. As cheesy as this sounds: he is my idol!!

    I am also quite in awe of the whole research environment over there at Lucent. I really wish I could get a shot at working there. I sort of guess I will be doomed to be a web programmer for ever... :(

  • He didn't create it, but he was a large part of making it popular. I pretty much learned C from 'the C bible'. This is true of many other people. The book defined what Ritchie created. People followed it (partly to remain compatible with Unix, partly because this was the document.

    He may not have been a high creator, but he could definitely be called a high priest of the C language.

  • (define *sig* "The real Kaufmann doesn't post often enough to have any impostors.")

    Hah! Shows what you know!

  • Warning: I am a Java hacker, and I like it a hell of a lot.

    Not trolling here: you are blinkering yourself it you don't see any validity in bringing Java into a conversation about C/C++.

    • People are using C++.

    Java skills are now in higher demand than C/C++ skills in the UK - taken from a recent survey of the job adverts in the IT sector over the previous year.

    • The advantage of C++ is that it's a hell of a toolbox. You've got hammers, screwdrivers, chisels and even a fully-functioning wood lathe (watch me turn this chunk of hoary code into a table leg!). Good programmers use the right tool for the job.
    As a Java programmer, I preffer the C toolbox to the C++ toolbox. The C toolbox contains all your hammers, screwdrivers, chisels, etc. The C++ toolbox contains this lot and also sticks of dynamite, nooses of rope and gattling guns. Useful, I expect, but everything ends up as the same machine code at the end of the day, and the C++ toolbox is a bit risky for some people's liking [subjective opinion].

    cheers,
    G

  • It was a real good article. 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" of the Unix and programming and networking worlds. It will give you a much higher appreciation of the roots of Unix and therefore Linux also.

    This is pretty necessary in my view -- too many of these so-called "experts" (which is rumoured to be the E in MCSE*) have no idea about the history of computing.
    I once made reference to BWK to a friend of mine (a CN[AE] no less) who had no idea who I was talking about. I ended up teaching him about The Gods of Murray Hill for about half an hour (he didn't know of DMR and Ken Thompson either.) The poor bastard.

    * MCSE = "Minesweeper Consultant/Solitare Expert"
  • Good comment, although System 3 does have a window-based GUI as well as the track-viewer interface. Oberon is the bomb. If you are a real programmer and examine Oberon critically you will understand this. If there is anyone who disagrees let him post.
  • I the point of the original posters comment was to say exactly what you just said power isn't defined in any useful way concerning programming languages.

    For example, I have to disagree with your, higher-level=more powerful definition, as well as your less-programming-time=more powerful definition. I think the ultimate power tool (besides writing out opcodes by hand) is assembler. My reasoning? You can do ANYTHING in assembler. If you can't do it there, it can't be done. Unfortunately, it sure violates your less-programming-time principle. In terms of what you can accomplish with it (it may not be easy tho') its more powerful then high-level languages.

    Spyky
  • by Anonymous Coward
    ...Brian Kernighan coined the name "UNIX" as a joke in responce to Ken Thompson's stripped down MULTICS kernal that he created to play his spacewar game on an abandonded PDP-7. Maybe not a big deal, but most things don't survive without name, let alone one that piques curiosity, so maybe so.
  • by rjh ( 40933 )
    I didn't mention that I'm a Java hacker, because I didn't see it was particularly relevant. :)

    My general attitude on Java is "those who do not understand C++ are condemned to reinvent it, poorly" (sorry, Henry Spencer)--this is a reasoned opinion, one I've come to after some study of the issues involved; I only bring it up now to make sure that you're aware of my bias. ;)

    As a Java programmer, I [prefer] the C toolbox to the C++ toolbox. The C toolbox contains all your hammers, screwdrivers, chisels, etc. The C++ toolbox contains this lot and also sticks of dynamite, nooses of rope and [Gatling] guns.

    Wholeheartedly agreed. Anyone who tries to sell C++ (specifically, object oriented C++) as being the One True Way is probably smoking too much ganja. At the same time, though, there are occasions when you need pure, unadulterated power, and for those times, C++ exists.

    Java seems, to my mind, to almost be a subset of C++, one in which the most dangerous features of C++ have been removed--pointers, generic programming, multiple inheritance, etc. There's something to be said for this approach, in that very few C++ programmers can use multiple inheritance, generics and so on well. But those of us who can use them well get really annoyed that Java denies them to us. ;)

    My biggest objection to C++ is that it takes a very long time--on the order of years--to become a good C++ programmer. I think, though, that it's plenty worth the effort.

    As usual, most people who say "language foo is better than language bar" don't understand foo, bar, or the problem they're trying to solve in languages foo and bar. The world is filled with interesting problems to be solved. Languages are tools; and there's a lot to be said for personal preference, and comfort level, with one's tools.
  • using some sort of text-based, interactive editor *from* the command line,

    gee, I use my ide from the command line:

    [frymaster]/home/frymaster:%> cwide &

    ta-daaa!!

  • In many ways, Pascal was a better language, but Pascal had some inane limitations that stemmed from Wirth's academic orientation....
    Wirth didn't really intend for Pascal to be a general-use language [kzoo.edu] (second paragraph). It was intended as quick, cheap general-purpose language that was easy to compile for and easy to learn, while allowing students to play with most of the early concepts of CS. The expectation was that, once they learned Pascal, students would go on to a 'real' language like Algol/68 or (later) Modula.

    The problem is that, once students learned Pascal, they tried to do everything in it, rather than going on to a 'real' language. This human quirk is precisely why many companies will try and get their products into schools and universities -- once people get used to product 'X' they'd rather pay the price of staying with it than learn a new, possibly better, system.

    If you look at Pascal as a light-duty 'introductory' programming language that was supposed to be easy to write compilers for (probably in a language other than Pascal), then it makes LOTS more sense. (e.g. the lack of compile-time math is fine if you want to actually discourage people from using pascal in large systems, and it makes the compiler a bit easier to write). The only place that Pascal really fails is that it's actually 'good enough' that it didn't completely discourage students from using it on real world problems.

  • What killed Pascal, I think, is that Berkeley UNIX came with a truly lame Pascal implementation.

    Pascal is dead? I hope nobody tells my employer. It's paying me a lot of money to document Pascal APIs!

    Seriously, though, you raise an interesting point, if you rephrase from "what killed Pascal" to "why C overtook Pascal as a standard language." I don't think you can blame Berkeley Pascal. I can't cite specific figures, but I doubt if Berkeley Pascal was ever as widely used as any commercial Pascal compiler, especially Turbo Pascal.

    Pascal probably suffered more from the ascendency of Unix, which is closely tied to C. And in general, C is better than older dialects of Pascal for writing APIs. Kernighan has a classic paper [virginia.edu] on the topic. (Apologies for the unstable link. Bell Labs appears to be re-organizing their web site.)

    But on rereading "Why Pascal is not my Favorite Program Language" for the first time in many years, I made an interesting discovery. All of Kernighan comments are insightful, but all but one point is now simply out of date. (For example, Borland's Object Pascal is much more extensible than Wirth's original classroom language.) The one point he makes that still applies after a couple of decades is this: Pascal is designed to be compiled in a single pass. Kernighan objects that this makes for source code that reads "from the bottom up" and to related limitations on the order of declarations.

    what makes this interesting is that this one "limitation" of Pascal works out very well in Borland's current Delphi product. In a RAD tool, source code organization is the IDE's problem, not the programmer's. And having a single-pass language means you can have IDE features that rely on on-the-fly parsing, such as automatic code completion. Borland's C++ Builder (which is essentially a tool for writing Delphi programs in C++) also has this feature, but it is much less usable in that product, due to the multiple passes you need to resolve a reference in C++.

    And of course, Pascal programs compile a lot faster than equivalent C++. I was recently playing with a Linux Pascal compiler (I think you can guess which one) and was somewhat bemused to find that roughly 40% of my compile time was used up by the copyright notice displayed at the beginning of each compile!

  • I've met RMS. He appeared to be of average (male) height to me: perhaps 5'10" to 6' tops. FWIW, I'm shorter than average, at 5'7" - RSH
  • but done here only to show it can be done without the compiler complaining

    You got that from the "what's wrong with this code?" Ad they always run in Dr. Dobbs didn't you? Damn, I hate those ads... takes me more time to read them than the rest of the magazine.

    Okay, the compiler doesn't catch it. There's no conceivable reason why you would want to construct something like this anyway (at least not to me!) I could put gasoline in my windsheild washer reservoir, the nozzle fits perfectly... but why the hell would I?

  • :) I know, right? That's why I made those comments about X and ncurses...

    Personally, I like rhide, which is still text-mode, but...
    ---
    pb Reply or e-mail; don't vaguely moderate [ncsu.edu].
  • Wow! I have my own impostor now! I'm so fucking honoured!

  • Okay, the compiler doesn't catch it.

    More accurately, the compiler doesn't erroneously complain about it. It's perfectly valid, syntactically correct C++.

    There's no conceivable reason you would want to construct something like this anyway

    On the contrary, it happens quite a bit. If you've got function F which calls function G, and G needs access to the internal state of F, you pass F's state to G as pointers and then cast them back to the appropriate type of variables. This is a little kludgy, but oftentimes makes for more readable code than if you'd inlined G into F.
  • by dills ( 102733 ) on Monday September 04, 2000 @05:00PM (#805898) Homepage
    I had the old guy as my professor for CS50, which is the first computer class you take at Harvard. It was nice to see him bitch about people being trained in Visual C++; I assume he was complaining about Princeton, because at Harvard it was strictly C on Unix. (C++ was taught in CS51, but still in a Unix environment.)

    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".
  • Man, that's right on. Except that they taught us Dylan (I hear they do Scheme now) at my university.
  • Thank's for you're help!

    --
  • 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.
    Having actually written the entire I/O system, all the device drivers, and a file system for a secure operating system in the original Modula I, I'm not as impressed with it. Neither was Wirth. When he spoke on Modula II, he referred to Modula I as an unsuccessful experiment.

    Modula II wasn't bad. I did a fair amount of embedded-system programming in Modula II, and it really was what you needed when you had to make a EPROM to run the program and had very limited debugging tools. Most of the time, if the program compiled, it ran properly. This is the real advantage of restrictive languages - a higher percentage of the bugs are caught at compile time.

    Modula III [cam.ac.uk], the first object-oriented member of the family, never really caught on outside of DEC's old Palo Alto research operations. A free compiler is available for both NT and Linux, but it's not really maintained. Compaq has stopped all work in that area.

    Oberon [oberon.ethz.ch] is an OS and language, combined. I don't know enough about it to provide any greater detail.
    You're not missing much. Oberon's idea of a user interface is, well, painful. Again, there are free Linux and NT versions, so you can download and try it.

    One always wonders how it would have turned out if the Stanford CS department hadn't denied Wirth tenure.

  • Another funny Dilbert titled "Computer Holy Wars"

    A guy in a dress shirt with glasses approaches a scruffy looking guy: "Hey! The scruffy beard, the long suspenders, the sandals...you're one of those UNIX guys..."

    The scruffy guy in suspenders responds: "Here's a nickel kid. Go get yourself a real computer."

    hee hee hee...

  • OK, I don't know that much about Modula, but wrt your comment, I got to say that at least Python has (reportedly) borrowed a lot from Modula-2. So, if you haven't already, take a look. Python is a programmer's and sys-admins answer to a lot of prayers...
  • TeX wasn't viable in 1977. troff was. LaTeX even later. If I were starting over, perhaps I'd choose TeX. Though many of you will argue, there are people that think that Professor Knuth's vision of typeography isn't the world vision. TeX looks ok. Troff looks ok. Both could probably be better, not that most of us would recognize better if it walked up and bit us.

    MathML is way to new to know if it is going anywhere real -- eligance not withstanding (I like MathML). MS Word version 6.0 is older than MathML is and we know how viable that format is over the long-haul. Now a MathML to troff converter (I've not looked, is there one?) might be interesting in oh say another 5 years after we know if MathML is done or going to suffer from creaping featureism.

    In the end, there are markup languages and there are WYSIWYG editors. The markup languages tend to stabile longer and that makes them a much more viable candidate for words that have any hope of being reused.



    I'll note here (marginally) that if you are under 25 or 30 years old, the idea of a document being a program is probably just weird. Most big documents should be viewed as such. My books, my PhD dissertation and most of my other major documents are under revision control (RCS) and are constructed with make(1). It is neat to be able to go back and get an old paper and know that it can be reprinted reliably, it will look the same, and that I can steal pieces of it with zero trouble. Ponder doing that with a Wordstar document made on your CPM system in 1977...

    Oddly, make(1) has become the largest stability issue to going back to older documents since Berkeley and GNU keep screwing with make in a mis-guided vision of 'oh we'll make it better'. Make is a time dependency file constructor. If you want to make it something else, then call it bmake, gmake, mmake, lmake, fake or weve_lost_sight_of_makes_purpose, just leave the original make alone please.

  • Another advanced guide.
    It's is not, it isn't ain't, and it's it's, not its, if you mean it is. If you don't, it's its. Then too, it's hers. It isn't her's. It isn't our's either. It's ours, and likewise yours and theirs.

    -- Oxford University Press, Edpress News


    --
  • Hm. You mentioned Pascal, and the entire thread is about an interview with Brian Kernighan. I think that makes this link [lysator.liu.se] fantastically topical. It's a paper/writeup/whatever by BWK, entitled "Why Pascal is Not My Favorite Programming Language". Being from April, 1981, it's quite dated, but it shows how to bash stuff in style. A good read. ;^)
  • Your guess is way off.

    I don't get the point about `powerful APIs', but you might have a
    look at the scheme2c compiler which has excellent support for linking
    C libraries into scheme code.

  • One of the goals of the MathML design team is intercovertibility with TeX. Id MathML proves to be a fad, there should already *be* a converter into TeX.
  • Furthermore, look at the headers of any of Dennis Ritchie's posts on alt.folklore.computers. dmr uses Netscape on NT to post to usenet.
  • There is a size vs. speed trade-off, but only if there is enough memory to cope.

    I have continual problems with a C++ system I need to access remotely from work. This is spread across a number of Solaris systems, interlinked by a customer communications protocol running over TCP/IP.

    The problem is that the executables are huge. Each process, which do little more queue up transactions to a number of external systems, is at least 5MB in size. Although I don't have access to the current source code, previous revisions don't contain that much code. The processes isn't that complex, its just all the inlining that causes the problems. It is made worse by the communications library being statically linked (Arrgghh!).

    Its a constant battle freeing up resources on each of the machines, as each process starts and stops. Some days I have not been able to get much done. Not having root to any of the machines (some bozo decided to start a web server on one of them) doesn't help.

    I know this sound like a rant, but programmers and sysadmins are too different beasts, and the requirements of one (really quick code, forget the expense of memory) is not a practicality in the realm of the other.

  • But the Ocaml guys won't win: they've used comments quite blatently on at least a couple of lines, and as soon as the functional community notices, they'll be excommunicated and ostracized for life.

    Just imagine what would happen if it caught on and comments in functional programs became commonplace. People would actually be able to figure out what functions were intended to do, and decades of good work would go down the drain. Heaven forbid!

    But it gets worse: this team has even used descriptive identifiers in a couple of places. Shock horror, whatever next -- code walkthroughs?!

    [PS. This comment may actually be a half-serious answer to the question of why FP has never had an impact outside of academia. Apparently FP programmers don't consider that the "software crisis" and maintainability have any relevance to them.]

    [PPS. I like ML. Languages aren't obscure, only programmers.]
  • Sorry, but this attitude sucks!

    I've heard this excuse many time, concerning memory or bandwidth. Even if it is realatively cheap, it still matters. The allbeit small performance increase caused by inlining, unrolling loops et al goes out of the window as soon as the machine starts to swap heavily. Usually the process works fine when tested in isolatation, but starts to have problems when used in the real world.

    I've also experienced network systems crawling due to no-one having any idea of network bandwidth, and assuming that installing 100Mbit ethernet was the fix, as opposed to eliminating unneccessary traffic.

    Programmers and sysadmins unfortunatly have different ways of thinking.

  • I've also experienced network systems crawling due to no-one having any idea of network bandwidth, and assuming that installing 100Mbit ethernet was the fix, as opposed to eliminating unneccessary traffic. Programmers and sysadmins unfortunatly have different ways of thinking.

    That's not necessarily fair. The sysadmin has been handed an application to support, looked at it and said "if you want to run this application at this level of performance, you require this hardware". And the programmers would have implemented the application they were told to, without needing to think about the "big picture".

    The responsibility lies with the system architect, who from the very beginning should have calculated the usage of the application in a production setting, and made it clear in the specification exactly what was and was not required, so the programmers wouldn't waste resources, and written a business case so that the management would have invested in the infrastructure.

  • Interesting :)

    I actually much prefer coding in Pascal to C. Partly as I find Pascal a very clear syntax whereas even C fans will admit it can look like line noise. Not as bad as Perl but still... Partly, too, that because it's very picky, it's very easy to bugfix. The compiler will catch so many little gotchas which would cause something weird to happen with a C program, as the problem doesn't show up until later... Example: in Pascal, if I try and write past the end of an array it crashes. I can find that _very_ easily by stepping through the code. Do the same in C and it'll normally corrupt the memory. Now, which is easier to track down and sort out?

    I've often thought that C's success is at least partially cultural. I remember when I was first getting into Amigas, everything had to be hand-coded in assembler (or so it sometimes looked, anyway) or you weren't a real coder. Now, C is (in many ways) a platform-independent assembly language. Yes, it's higher level, but there's still a fair bit in common. Anyway. The point is that coding in C there was still enough metal-bashing to make the coder look like a real man. Pascal, OTOH, is just too easy.

    If you're writing an OS or a driver or something else at that sort of level, C makes sense in many ways while Pascal (or most Pascal-derived languages) would have clear limitations. If I'm writing a normal user-space application, though - such as a web browser, considering where this message is being posted - IMO you just don't need the level of control C gives you. If you don't need the control, why should you pay the cost of having the little gotchas to catch? I've just got better things to do with my time, and appreciate the easier debugging. The apps users would, too - same debugging effort produces better quality. What more could you want? ;)

The rule on staying alive as a program manager is to give 'em a number or give 'em a date, but never give 'em both at once.

Working...