Slashdot Mirror


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."

24 of 333 comments (clear)

  1. Correct AMPL link by JohnGrahamCumming · · Score: 4, Informative

    The story has a link to ampl.org, the correct link is ampl.com.

    John.

  2. Woah by Sir+Haxalot · · Score: 5, Funny

    '...and how he had nothing to do with the creation of C'
    That's something to be proud of!

    --
    I have over 70 freaks, do you?
  3. Hey, we have something in common! by Anonymous Coward · · Score: 5, Funny

    I had nothing to do with the creation of C either!

  4. If I were Brian... by stevens · · Score: 5, Funny

    ...and someone asked me about the wisdom of gets(), I'd also be pointing at Dennis Ritchie and yelling, "It was him! Burrrn him!"

    1. Re:If I were Brian... by AlecC · · Score: 4, Interesting

      int foo, *bar; creates an integer named foo, and a pointer to an int named bar. Right? Or am I wrong?

      So you have one declaration line which created variables of two totally disinct types. Fine for the opriginal creator, lousy for the maintainer, who sees a line declaring ints and had to do a serious double take to find that some of them are actually pointers. Abuse further as

      int foo, *bar, flash, *bang, up, *down, left, *right;

      Without reading the line again, what was the type of "up"?

      And as for the other, I can never define any sort of function pointer in one line: I always have to typedef tthe function and then have a pointer to it. While I can work out, with a manual in hand, how to do it in one line, the syntax is so unintuitive that I never do it: I will just have to reach for the manual again wh
      en I maintain it.

      The mistake I would junk is allowing enum {fred=36, bill=19, joe=333} ; Which confuses predefined constants with the classic enumeration. The cost saving of a lookup table to convert the 0, 1, 2 sequence is tiny, and the knock on effects are horrible.

      --
      Consciousness is an illusion caused by an excess of self consciousness.
    2. Re:If I were Brian... by ajs · · Score: 4, Interesting
      You are exactly correct, and I have no idea what the original poster's problem with it was.
      [ajs@put /tmp]$ cat > /tmp/c.c
      #include <stdio.h>
      void
      main(int argc, char *argv[]) {
      int i, *j;
      i = 1;
      *j = 2;
      printf("i=%d, j=%d\n", i, *j);
      exit(0);
      }
      [ajs@put /tmp]$ gcc -o /tmp/c-test /tmp/c.c
      /tmp/c.c: In function `main':
      /tmp/c.c:3: warning: return type of `main' is not `int'
      [ajs@put /tmp]$ /tmp/c-test
      i=1, j=2
      Perhaps he was thinking of "int *i, j" which isn't all that bad in terms of confusion until you started seeing stroustrup's style, which I *hated* from day one of, "int* i" which of course lead to people using, "int* i, j".

      You can write badly obfuscated code by abusing visual association in just about every language, but this particular gotcha should have tipped off Stroustrup VERY early on that his style was agegeously misleading, and a good technical editor should never have let him publish a book with such incomprehensible gibberish.

      That very thing is one of the primary reasons I didn't use C++ for years (not to mention that I regretted it when I did). My thinking was that if the creator of the language didn't see how damaging it was to introduce confusion in his published writing, then he wasn't likely to avoid such in a programming language. I think ANSI C++ stands as a monument to the correctness of my thinking on that point!
    3. Re:If I were Brian... by Zan+Zu+from+Eridu · · Score: 5, Insightful
      So what is wrong with:

      int foo, flash, up, left;
      int *bar, *bang, *down, *right;

      Or even better:

      int foo;
      int flash;
      int up;
      int left;

      int *bar;
      int *bang;
      int *down;
      int *right;

      Just because a language allows a construct doesn't mean you have to use it. This is a coding-style argument, which are of course all subjective.

      I can never define any sort of function pointer in one line: I always have to typedef tthe function and then have a pointer to it. While I can work out, with a manual in hand, how to do it in one line, the syntax is so unintuitive that I never do it: I will just have to reach for the manual again wh en I maintain it.

      This is a valid problem that has to do with operator precedence. In C the operator precedence is arranged in such a way most commonly used expressions can be written without a lot of brackets. I think this is more convenient, because normally you don't define a lot of function pointers, but you do use at least some pointer arithmetics.

      The mistake I would junk is allowing enum {fred=36, bill=19, joe=333} ; Which confuses predefined constants with the classic enumeration.

      A constant in C is not the same as an enum. Simply put constants are addressable, enum items are not. One could choose to introduce yet another construct for unaddressable constants, but this is far more practical.

      And again, you don't have to use every feature in a language just to make your code more interesting. C was designed as a language-of-choice, not as a bondage-and-discipline language. If you don't like your freedom, don't use it, but please don't start whining you've got too much freedom.

  5. SCO sueing Brian Kernighan by Anonymous Coward · · Score: 5, Funny

    Isn't SCO already suing Brian, both for being involved in a Linux OS, and because "C" happens to be found in the middle of SCO's trademark name?

  6. Re:It's official by Lazar+Dobrescu · · Score: 5, Informative
    It is well known that Kernigham had nothing to do with the creation of C. The K&R you are referring too are the authors of the BOOK, "The C Programming Language", that Kernigham wrote with Dennis Ritchie(which is the main inventor of C).

    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 ;)

  7. Re:BWK by JohnGrahamCumming · · Score: 4, Informative

    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.

  8. Great people are so humble! by civilengineer · · Score: 5, Insightful

    He says " I wound up at Princeton" and "through good luck I got a job at Project MAC at MIT" and "probably because of the MIT experience, I got a job at Bell Labs in the Computing Science Research Center". Princeton, MIT, Bell Labs?? not easy!

    --

    New year Resolution: Don't change sig this year
  9. Re:expressive by ryants · · Score: 4, Funny
    what you think the most expressive language is (efficiency aside)?
    Chinese. In no other language can one syllable mean anything from "chicken" to "the interlocking fates of all beings in the celestial orb".

    And let's not forget crisitunity.

    --

    Ryan T. Sammartino
    "Ancora imparo"

  10. Re:Points in article: by DogIsMyCoprocessor · · Score: 4, Informative
    Why'd they interview him?

    Let's see ...

    • He invented Awk, a spiritual godfather to Perl
    • He co-authored The C Programming Language
    • He co-authored The UNIX Programming Environment
    • He co-authored Software Tools, an early manifesto of the "Unix Way" of using small, interoperable tools.

    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."

  11. Simplicity by devphil · · Score: 5, Funny


    One of my favorite Kernighan quotes of all time:

    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  12. Re:He teaches VB! by $rtbl_this · · Score: 4, Funny

    I'm a C nut...

    Just be glad you're not dyslexic as well. :)

    --
    "Are you being weird, or sarcastic?" said Emma. I said I didn't know because I get the two feelings mixed up.
  13. Atleast Windows is safe. by Niadh · · Score: 5, Funny

    ... since C is now owned by SCO, so is everything written in said language

    That explains why SCO isn't going after Microsoft.
    Windows being written in VB and all.

  14. Holy shit, batman, where's your flame-proof suit?? by Rinikusu · · Score: 5, Funny

    Let's see:
    1) He mentions he writes interfaces for.. Visual Basic
    2) He mentions he writes code in Java
    3) He mentions Microsoft in a positive light
    4) He admits to owning a Mac

    Fuck, man, the only thing he didn't do is say "vi" or "emacs".

    Does this mean that, in reality, all of the contention regarding languages, operating systems, and idealogies is completely artificial and that we should really just use what we like instead of jumping on a particular bandwagon and denying the legitimacy of anything else?

    Man, I think I want to go back to bed.

    --
    If you were me, you'd be good lookin'. - six string samurai
  15. Why Pascal is Not My Favorite Programming Language by NearlyHeadless · · Score: 5, Informative

    Here's an HTML version of Why Pascal is Not My Favorite Programming Language. There's a Postscript version on Kernighan's website

  16. totally. I like this guy. by rebelcool · · Score: 5, Insightful

    Very practical. He wants to use the computer as a tool. Not a propaganda platform. Windows is fine and dandy for some applications, Unix for others. It all depends on what you're trying to do.

    --

    -

  17. Re:expressive by jfengel · · Score: 5, Insightful

    You've got to be careful with your terminology here. All languages are equally expressive in the sense that anything you compute in one can be written in another. (At least in terms of computability. Access to hardware is a different matter.)

    In your context, you might mean "expressive" in the sense of "saying as much in as few words as possible." Since C is a typed languge with explicit memory management, it's going to be more verbose than an untyped garbage-collecting language like Lisp or Perl. (Well, they have very limited typing, especially once you start adding constructs on top of the core language.)

    Or you could mean "expressive" in exactly the opposite sense, where you have to be more "expressive" about the types of things. In this sense C is far less expressive than strongly typed languages like Haskell or even C++/Java.

    Or you could simply be referring to the verbosity of the language, where COBOL holds the title of most ugly language and APL is without a doubt the shortest. (APL is indistinguishable from line noise.)

    In the end the value of a "language" has less to do with the core language and much to do with the libraries for hardware access (memory, screen, disk, network) and compatibility with common features provided by the OS (clipboard, windowing, etc.)

    So you pick your language for a host of reasons few of which have anything to do with a core "expressiveness".

  18. Re:Holy shit, batman, where's your flame-proof sui by machine+of+god · · Score: 5, Funny

    You read the article didn't you. DIDN'T YOU. Never do that again.

    (It led you to assume that the rest of slashdot will.)

  19. these guys by Anonymous Coward · · Score: 5, Interesting

    My aunt used to work with these guys at the Labs here in NJ quite often. Shes dieing now and we sit for hours and talk about how she used to program in C and how much she loved unix. Hours on end of stories about these guys and different projects. I work with a guy now who worked with her, lots of stories from him as well. Awesome stuff, true geniuses. Gotta thank these guys for changing the world.

    -- chris

    http://elusive.filetap.com

  20. VB and Kernighan's course by Serf · · Score: 4, Informative

    Isn't it odd that I'd recommend to people who want to become programmers to avoid taking Brian Kerningham's class?

    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. ... 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.

    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.

  21. Slashdot should retitle the article by Comatose51 · · Score: 4, Insightful

    It should read, "Conversation with God (or a God)".

    Jokes aside, the names Kernighan and Ritchie are firmly planted in the minds of most CS majors. We have "celebrities" like Torvald or Stallman but at the end of the day, professors always say "Read page XXX in Kernighan and Ritchie", which we always proceeds to ignore until our code doesn't work. Then once again, we reach for the pretty little white book and thank someone or something for the well written proses. Unlike many other CS books, K&R seem to have cover most of the possible contingencies a fledgling CS major might have. I hate books that tell you how to do things only in one way, their way. K&R was written so well that I didn't have to.

    --
    EvilCON - Made Famous by /.