Slashdot Mirror


Interview With Brian Kernighan of AWK/AMPL Fame

Reader oranghutan brings us another in Computerworld's series of interviews with icons of the programming world, this one with Brian Kernighan, who helped popularize C with his book (co-written with the creator Dennis Ritchie) The C Programming Language, and contributed to the development of AWK and AMPL. In the past we've chewed over a few other interviews in this series, including those with Martin Odersky on Scala and Larry Wall on perl. "In this interview, Brian Kernighan shares his tips for up-and-coming programmers and his thoughts on Ruby, Perl, and Java. He also discusses whether the classic book The Practice of Programming, co-written with Rob Pike, needs an update. He highlights Bill and Melinda Gates as two people doing great things for the world enabled through computer science. Some quotes: 'A typical programmer today spends a lot of time just trying to figure out what methods to call from some giant package and probably needs some kind of IDE like Eclipse or XCode to fill in the gaps. There are more languages in regular use and programs are often distributed combinations of multiple languages. All of these facts complicate life, though it's possible to build quite amazing systems quickly when everything goes right.' 'Every language teaches you something, so learning a language is never wasted, especially if it's different in more than just syntactic trivia.'"

45 of 117 comments (clear)

  1. The Practice of Programming by BadAnalogyGuy · · Score: 5, Interesting

    There are a few books I recommend to kids just starting out in the industry.

    Code Complete
    Writing Solid Code
    Programming Pearls
    and The Practice of Programming

    Even old stalwarts like Kernighan's The C Programming Language aren't as useful in the longterm as the 4 books above are.

    Anyone who wants to make the jump from "code monkey" to professional should really take the time to read the books.

    1. Re:The Practice of Programming by morgan_greywolf · · Score: 5, Interesting

      Right. The four books you mentioned aren't books for teaching you about a programming language or a particular technique, unlike K&R, which focuses just on C. They are designed to teach how to think like a programmer and how write code like professional software developer. They are more about the fundamental nature of coding; they're not as much about trying to teach you the basics as they are about trying to teach you what you really need to know to successfully take a programming project through the development cycle as a coder.

    2. Re:The Practice of Programming by Nazlfrag · · Score: 3, Informative

      Thats because you're comparing training manuals to technical manuals. K&C is still useful to this day as a standard reference that still works all these years past. The only thing similar is Knuths works, one of the few compsci works created that serves as both a training and technical reference. (kids - read Shannon thouroughly as well, starting with "A Mathematical Theory of Communication")

    3. Re:The Practice of Programming by ComputerPhreak · · Score: 2, Informative

      I think you're missing the point of "The C Programming Language." It wasn't (isn't) a book about programming, it basically set the standard for the C programming language at the time. It's a reference manual, not a guide on how to write code.

    4. Re:The Practice of Programming by Bromskloss · · Score: 2, Informative

      kids - read Shannon thouroughly as well, starting with "A Mathematical Theory of Communication"

      Interesting, for sure, but what does it have to do with programming?

      Link, by the way: A Mathematical Theory of Communication

      --
      Swedish plasma phys. PhD student; MSc EE; knows maths, programming, electronics; finance interest; seeks opportunities
    5. Re:The Practice of Programming by yankpop · · Score: 2, Insightful

      unlike K&R, which focuses just on C

      If you just skim through K&R, then yes, I can see why you'd think it was 'just on C'. But if you actually sit down and work through the problems, you'll find a lot more depth. Of course, it's all C code, but some of those exercises are deceptively challenging, and they really helped me to move beyond the mechanics of the language and start thinking about coding in a more sophisticated way.

      The other books mentioned provide important insights into different aspects of programming, but to describe K&R as just a reference book for a single language is a serious understatement. Maybe the thought processes involved in solving those problems are second-nature to experienced programmers, but it was a real mind-opening experience for me, something I've not experienced with other "language references".

      yp.

    6. Re:The Practice of Programming by Nazlfrag · · Score: 2, Informative

      What does information theory have to do with information science you ask? More than a little is my answer.

  2. "Need" an IDE by betterunixthanunix · · Score: 2, Insightful

    If a programmer needs to use an IDE, as opposed to just using one for convenience, something is very wrong.

    --
    Palm trees and 8
    1. Re:"Need" an IDE by OzPeter · · Score: 3, Insightful

      If a programmer needs to use an IDE, as opposed to just using one for convenience, something is very wrong.

      Once you cover the basic needs of food and shelter, everything after that becomes a convenience

      --
      I am Slashdot. Are you Slashdot as well?
    2. Re:"Need" an IDE by drbinofski · · Score: 2, Insightful

      If a programmer needs to use an IDE, as opposed to just using one for convenience, something is very wrong.

      Once you cover the basic needs of food and shelter, everything after that becomes a convenience

      So this would be the application of Maslow's Hierachy of Needs to programming!?

    3. Re:"Need" an IDE by characterZer0 · · Score: 4, Insightful

      I need an IDE to do my job. I could lay out graphical forms by hand, but it would take long enough as to not be profitable.

      --
      Go green: turn off your refrigerator.
    4. Re:"Need" an IDE by mauddib~ · · Score: 4, Interesting

      In my very humble opinion, tools such as Emacs and vi are precursors to larger development environments, such as Eclipse or Delphi. In your case, and assuming my argument is true, we would all be going back to flipping switches and pressing buttons, since that's the only true way of understanding the code.

      If you don't accept my argument, then why are syntax highlighting, :make macros and identifier matching part of every vi install nowadays? And don't even get me started about emacs, which design purposes was to help programmers write better code. So, if you don't accept my premise, where do you draw the line?

      For me, this development can't go fast enough. I'm looking forward to languages that integrate completely with an IDE, and leave simple character representation (ASCII e.a.) behind.

      --
      This is a replacement signature.
    5. Re:"Need" an IDE by skrolle2 · · Score: 3, Insightful

      Bullshit, you only make this argument based on your comfort zones and your levels of trust.

      When you write code in a language that is not machine code you require some sort of text editor, you require some sort of file system for organizing your text files, and you require a compiler and a linker for making executables out of your human-readable code.You need to trust that all your tools actually do what they're supposed to do, and you need to be comfortable in that environment.

      An IDE is simply one more tool in the chain that might organize your files differently, that might automatically invoke your compiler, and that might automatically highlight and analyze your code for your benefit. It's still just tools in the chain, and you still need to trust them. An IDE does not bring anything fundamentally different.

      You only make your argument that an IDE is unnecessary because you are comfortable not using one, and because you probably don't trust them. And from that you argue that "real programmers" shouldn't use an IDE, because you don't, and you consider yourself a "real programmer".

      However, I might as well make the argument that "real programmers" don't need text editors or compilers or linkers. How can you trust your compiler, hm? No way, a programmer should be able to enter machine code directly, and that text editor and compiler should only be for convenience, not necessity. And get off my lawn!

      But that argument is of course stupid, text editors and compilers and higher level languages add to the productivity of the programmer, in the same way that IDEs add to the productivity of the programmer. Not using the best tools available is just stupid masochism.

      Then again, in 10 or 20 years there will be something on top of IDEs that make them look as primitive as a simple text editor does to Eclipse, and I'll probably be whining about the young folks and their newfangled thingies, and I won't trust them, because my comfort level is in an IDE as we know them today. Hopefully, I'll not be as old and stuck in my ways as you are though.

    6. Re:"Need" an IDE by Anonymous Coward · · Score: 5, Insightful

      I think you draw the line when a language "requires" an IDE so bloated that it runs slow on a Core 2 Duo machine, and makes you want to code in Notepad instead, except you can't because the language is too convoluted.

    7. Re:"Need" an IDE by corbettw · · Score: 2, Interesting

      How can we have a flame war about the definition of a Real Programmer© without a link to the story of Mel, the original Real Programmer©?

      --
      God invented whiskey so the Irish would not rule the world.
    8. Re:"Need" an IDE by Anonymous Coward · · Score: 3, Insightful

      Bullshit, you only make this argument based on your comfort zones and your levels of trust.

      Profanity, straw-man, pseudo-psychology.

      When you write code in a language that is not machine code you require some sort of text editor, you require some sort of file system for organizing your text files, and you require a compiler and a linker for making executables out of your human-readable code.You need to trust that all your tools actually do what they're supposed to do, and you need to be comfortable in that environment.

      Appeal to the obvious.

      An IDE does not bring anything fundamentally different.

      Opinion presented as fact.

      You only make your argument that an IDE is unnecessary because you are comfortable not using one,

      Straw man.

      and because you probably don't trust them.

      Straw man.

      And from that you argue that "real programmers" shouldn't use an IDE, because you don't, and you consider yourself a "real programmer".

      Changing the content of parent comment.

      However, I might as well make the argument that "real programmers" don't need text editors or compilers or linkers. How can you trust your compiler, hm? No way, a programmer should be able to enter machine code directly, and that text editor and compiler should only be for convenience, not necessity.

      Extending parent's position to absurdity.

      And get off my lawn!

      Ad hominem.

      But that argument is of course stupid, text editors and compilers and higher level languages add to the productivity of the programmer, in the same way that IDEs add to the productivity of the programmer. Not using the best tools available is just stupid masochism.

      Ridiculous comparison between programming languages and GUI widgets.

      Then again, in 10 or 20 years there will be something on top of IDEs that make them look as primitive as a simple text editor does to Eclipse, and I'll probably be whining about the young folks and their newfangled thingies, and I won't trust them, because my comfort level is in an IDE as we know them today.

      Unjustified extrapolation.

      Hopefully, I'll not be as old and stuck in my ways as you are though.

      Ad hominem.

    9. Re:"Need" an IDE by MaraDNS · · Score: 3, Interesting

      The original Usenet posting from 1983 actually wasn't pseudo-poetry; it was prose. The original groups.google.com article has disappeared, but a web version of the article in its original prose is here.

      --
      MaraDNS is an open-source DNS server.
    10. Re:"Need" an IDE by Angst+Badger · · Score: 2, Insightful

      While I'm not sure what the low-level representation of the code has to do with anything -- that's a detail that ideally ought to be hidden by the IDE anyway -- I couldn't agree more. There's nothing wrong with better tools, and there are tasks that are flat-out impossible without better tools. Is there something "very wrong" if a traveler can't get from NY to LA in a single day without using an airplane? Of course not.

      I've been programming since the punch card era, and I used to think that the greatest menace to our profession was the new kid who hadn't learned his history. Thirty years and a lot of new ideas later, I still think ignorant newbies are a problem, but I've come to recognize an equal menace in ignorant oldbies who found something they liked and then stopped learning. Machismo and arrogance are just as harmful in software engineering as they are in every other area. Brian Kernighan is still picking up new languages and tools and doing so with an inquisitiveness, humility, and grace that one rarely sees in much less talented developers. Let's hope it catches on.

      --
      Proud member of the Weirdo-American community.
    11. Re:"Need" an IDE by Just+Some+Guy · · Score: 4, Insightful

      I'm looking forward to languages that integrate completely with an IDE, and leave simple character representation (ASCII e.a.) behind.

      Oh, me too! I can't wait until diff and patch no longer work, and every version control system has to explicitly support every distinct language, and examples on Stack Overflow are files you have to download and open in an IDE before you can examine them, and Google has to learn each language's binary serialization so that it can search code snippets.

      In a time when every other type of file is moving to standardized formats, I just love the idea of my industry balkanizing into a million crap representations. That is certain to make us all more productive.

      --
      Dewey, what part of this looks like authorities should be involved?
    12. Re:"Need" an IDE by not-my-real-name · · Score: 2, Interesting

      Try looking into "literate programming". There is a character representation at the lowest level, but the output is all nicely formatted and typeset.

      I played around with Haskell a bit. It has a built-in feature where you can integrate it with LaTeX and produce some really nice program listings complete with typeset documentation.

      --
      un-ALTERED reproduction and dissimination of this IMPORTANT information is ENCOURAGED
    13. Re:"Need" an IDE by corbettw · · Score: 3, Interesting

      From the postscript at the end of this version: "The original submission to the net was not in free verse, nor any approximation to it --- it was straight prose style, in non-justified paragraphs. In bouncing around the net it apparently got modified into the `free verse' form now popular. In other words, it got hacked on the net. That seems appropriate, somehow."

      --
      God invented whiskey so the Irish would not rule the world.
    14. Re:"Need" an IDE by Abcd1234 · · Score: 3, Insightful

      I think you draw the line when a language "requires" an IDE so bloated that it runs slow on a Core 2 Duo machine, and makes you want to code in Notepad instead, except you can't because the language is too convoluted.

      1) Uh, since when did the nature of a language dictate how fast/slow an IDE implementation is?
      2) Why, dear god, would a slow IDE be evidence that a language sucks?
      3) What language are you using that is "too convoluted" to use outside of an IDE? Because I've used quite a few, and I've yet to come across *any* language that "requires" an IDE.

    15. Re:"Need" an IDE by skrolle2 · · Score: 2, Insightful

      If you "need" to use a compiler, then you're limited to working in environments where one is available!

      An IDE is a tool just like a compiler is a tool. There really is no difference, other than the fact that some people don't like IDE's.

      I don't need a compiler to write my code, but it would be extremely time-consuming to do my work without one, so in practice I need one to be able to reach a meaningful level of productivity. In the same way I don't need an IDE write my code, but it would be extremely time-consuming to do my work without one, so in practice I need an IDE to reach a meaningful level of productivity.

      But what the GP was saying is that I'm somehow less of a programmer because I can't do my job without an IDE, but if that's the case, I'd rather have a job and produce code in my IDE, than be a "real programmer" without a job.

    16. Re:"Need" an IDE by rsborg · · Score: 4, Insightful

      For me, this development can't go fast enough. I'm looking forward to languages that integrate completely with an IDE, and leave simple character representation (ASCII e.a.) behind.

      That platform arrived in the 70's and it was called Smalltalk. All current mouse-based GUI systems are an offshoot of the original Smalltalk system. Wiki link. In reference to your dream-system, things like this were pretty potent and ahead of their time:

      Smalltalk is a structurally reflective system whose structure is defined by Smalltalk-80 objects. The classes and methods that define the system are themselves objects and fully part of the system that they help define.

      This would obviously allow you to edit your IDE/OS in real-time/at runtime.

      --
      Make sure everyone's vote counts: Verified Voting
    17. Re:"Need" an IDE by spitzak · · Score: 5, Informative

      I'm looking forward to languages that ... leave simple character representation (ASCII e.a.) behind.

      I worked on such a thing in 1983 at DEC (look up my MIT thesis to see). Structural editing.

      Conclusion: it was an absolute disaster. Programmers cannot use this. Most of the work was in altering it to be as much like a plain text editor as possible.

      Don't think you have an amazing new idea.

    18. Re:"Need" an IDE by DuckDodgers · · Score: 2, Insightful

      Most employers these days seem to favor specific experience over general skills. The chances that someone working on funky Javascript websites for a few years will find their next job writing server side C code is damned small.

      I made the move from C++ to Java four years ago. I'd like to move back, or at least out of Java, simply for some variety. But I have a family to support, and the potential employers I've talked to that don't use Java would only be willing to bring me in at about half my current salary. I'm looking to contribute to an open source project that uses some language other than Java, both for fun and to boost my resume. Until then, I'm stuck with the kind of work I do today indefinitely.

    19. Re:"Need" an IDE by AuMatar · · Score: 4, Interesting

      When the hell did laying out graphical forms become programming?

      --
      I still have more fans than freaks. WTF is wrong with you people?
    20. Re:"Need" an IDE by Anonymous Coward · · Score: 2, Funny

      3) What language are you using that is "too convoluted" to use outside of an IDE? Because I've used quite a few, and I've yet to come across *any* language that "requires" an IDE.

      INTERCAL

  3. Brian Kernighan of AWK/AMPL Fame by Anonymous Coward · · Score: 5, Insightful

    Not the Brian Kernighan of "The C Programming Language" fame, then?

    1. Re:Brian Kernighan of AWK/AMPL Fame by Anonymous Coward · · Score: 2, Funny

      I like this meme, don't let it die.
      Here's some ammo:
      Bill Gates of DONKEY.BAS fame.
      Linus Torvalds of git fame.
      Steve Jobs of NextStep fame.

  4. As Brian entered the room... by MrKaos · · Score: 3, Funny

    Cries of "We're not worthy, We're not worthy" were heard.

    --
    My ism, it's full of beliefs.
  5. Seriously by Anonymous Coward · · Score: 4, Insightful

    This is frickin slashdot. Who here needs an introduction of Brian Kernighan?

    1. Re:Seriously by Dionysus · · Score: 2, Funny

      This is frickin slashdot. Who here needs an introduction of Brian Kernighan?

      People with userid# over 20 000?

      --
      Je ne parle pas francais.
    2. Re:Seriously by rgo · · Score: 3, Funny
      Why don't you old people just let us live in peace!? Do you think we are all idiots?!

      Btw, what is C programming language? Is it an obsolete computer language like Visual Basic 6 or machine code?

    3. Re:Seriously by MrKaos · · Score: 4, Funny

      Nah, we know who Kernighan is.

      It's rumored he invented Al Gore.

      --
      My ism, it's full of beliefs.
    4. Re:Seriously by sconeu · · Score: 3, Informative

      Reflections on Trusting Trust is by Ken Thompson, not Brian Kernighan.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    5. Re:Seriously by shutdown+-p+now · · Score: 3, Funny

      Btw, what is C programming language? Is it an obsolete computer language like Visual Basic 6 or machine code?

      It's actually a tool created by communist conspirators to enable the creation of the infamous Lunix operating system intended to subvert our free society. That is why you're well advised to stay away from it if you ever see it, stick to God-blessed, corporate-backed tools such as Java and .NET, and report any sightings of C programmers in the wild (generally identified by the beard) to BSA and NSA.

    6. Re:Seriously by Haelyn · · Score: 2, Insightful

      Slashdot is the only place where you can win a dick size war by having the smallest one ;)

    7. Re:Seriously by Tri · · Score: 2, Funny

      Fake!

      Brian Kernighan would have checked the return value of that printf.

    8. Re:Seriously by Sir_Lewk · · Score: 2, Funny

      the infamous Lunix operating system intended to subvert our free society.

      Thought you were RMS there for a second. ;)

      --
      "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
  6. hello, world by jDeepbeep · · Score: 3, Funny

    I am most impressed with his fine work writing the first known 'Hello, world!' program.

    --
    Reply to That ||
  7. Labview by AliasMarlowe · · Score: 2, Insightful

    I'm looking forward to languages that integrate completely with an IDE

    Try Labview. And weep.

    and leave simple character representation (ASCII e.a.) behind.

    That's Labview - no plaintext representation at all. You'll be begging for one soon enough, with or without an IDE, unless your programs are at the "hello world" level of complexity. Some of the reasons are specific to Labview's failings. For instance, version management and project organization exist only as pathetic useless pretences, which obstruct rather than assist. Other reasons are intrinsic to the non-character representation. Try doing a diff between two Labview files, or even try getting a rough estimate of the amount of difference between them; sorry, no can do.

    There may be a non-character-based program representation (useful for developing and maintaining non-trivial projects) in the future, but I fear we'll all be retired or expired by then.

    --
    Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    1. Re:Labview by Doctor_Jest · · Score: 2, Insightful

      Having used LabVIEW for about 15 years now, I can safely say that it ain't all that bad. The diagrams are intuitive, and for what it does, it does well. Doing a Diff is as simple as using the "compare" tool in LV itself. (It even circles the differences for you...) It doesn't replace python for my text manipulation and other quick turnaround code, and LV CERTAINLY doesn't replace C for the good stuff. (I prefer Vi, but I can use emacs just as well..) It pays not to be pigeon-holed. :)

      Is it perfect? Far from it. :) It's got its quirks (what language doesn't?) But for rapid complex data analysis, I've not found much that'll beat it on speed (you could always spend the day writing Matlab, I suppose...)

      Version management requires a separate tool (we use Clearcase here), and if you're having trouble reading code diagrams, perhaps you need more instruction on how LabVIEW works. I have no trouble reading other people's VIs, understanding the inputs and outputs, and the logic flow. The data-flow paradigm is easy to dismiss as junk, but once you get a handle on it.. it is as intuitive as breathing when you're writing a VI to control a device (or 10). :) it just sounds like you don't like LabVIEW because it's graphical (I had the same prejudice when I started using it), but taking the time to master it means you can write just about anything with it... and that's the mark of a good language.

      --
      It's the Stay-Puft Marshmallow Man.
    2. Re:Labview by shutdown+-p+now · · Score: 5, Interesting

      There may be a non-character-based program representation (useful for developing and maintaining non-trivial projects) in the future, but I fear we'll all be retired or expired by then

      This has been tried numerous times. It just doesn't work, period.

      More recently, I recall reading an interesting interview with Microsoft "project Oslo" guys. Oslo is supposed to be a DSL framework for .NET. Now, existing releases already have something called "DSL SDK", integrated into VS, but the "DSLs" that it lets you create are purely graphical, like flowcharts, and have to be "coded" using a visual designer.

      That didn't exactly catch on, and Oslo guys explained that one of the most repeated customer feedbacks was that, while visual designers are occasionally useful, in the end it's still faster and easier to spend half an hour training, and then write DSL code as actual text in a text editor. Note: not for a programmer, but for a business analyst, or some other guy who haven't ever seen any code before!

      So they ditched the visual designer idea in Oslo, and instead came up with the tried and proven approach of parser generators (going for LL(*) over LALR as it's simpler to use and less restrictive, even if slower), and coupled it with a text editor that can load a grammar for the parser generator, and automatically provide syntax highlighting and simple completion for it.

  8. "Need" != "Helpful tool" by betterunixthanunix · · Score: 3, Interesting

    I personally use Emacs, with syntax highlighting and various other modes, because it is helpful and speeds up the process of writing code. There have been times, however, where I have not been able to use Emacs for some reason (e.g. I had to write some code on a system that did not have it installed). Once I was reduced to using a line editor to write some code (yes, in the 21st century), and while I hope to never experience such a situation again, I was able to deal with it and get the work done.

    All too often I see programmers who are completely helpless when they cannot use their favorite IDE, which is the problem I was alluding to. An IDE is a great tool that can save a lot of time, but when it gets to the point where people cannot figure out how to run a Java program without starting up Eclipse, something very bad is going on.

    --
    Palm trees and 8