Brian Kernighan Q&A – Computerphile

Brian Kernighan Q&A – Computerphile

>>Sean: We have had a few questions in from our
Computerphile viewers – our loyal viewers. There are some obvious joke ones, which
we may get to at the end, but starting with: “How did you start programming? Where did you start?”
>>BWK: It goes back a very long way. I think this would go back into the early
1960s, or something like that, and therefore memory is both dim and rosy. I think my first programming was probably
[in] Fortran. I tried it when I was in,
probably, my third year at university, so it was a long, long time ago,
and I don’t remember very much about it. One thing I do remember is: you read the
book, you read the manual. This is McCracken’s Fortran books, which are
really, really good. And you read them and you think you understand it completely.
And then you set finger to whatever, in this case key punch, and you say: “Wait a
minute – what do I do? I don’t know how to get started!” And I
think that conceptual hump of ‘how you get started’ is still there for an awful lot
of people. You sort of know the rules of the language but you don’t know how to say
anything. Once you’re over that then it’s easy and that’s sort of true then for
all subsequent languages. But that first step was hard. So I think my first
language was Fortran; it was probably at university; and I also spent a summer
working at what was, at the time, Imperial Oil, which is a branch of Esso, and so on,
in Toronto, and I wrote COBOL there. I was probably the world’s worst COBOL
programmer. Indescribably bad. And I haven’t actually written any
COBOL since but those were the kind of early days. I think I didn’t really learn
to program properly until I went to Princeton as a graduate student and then
I actually wrote Fortran programs that did something, and that was more useful.
>>Sean: That was how you started programming. This kind of leads on nicely from that. What
did you think of C when you first encountered it?
>>BWK: Again it’s one of those
things where I don’t remember and it was also special in that I kind of snuck up
on it because I was in the environment where it was going on, I had written a
little … I had spent one summer at MIT when I was a graduate student. I was
there as, in effect, a summer intern. And at that point I had written in a
language called MAD, the Michigan Algorithm Decoder,
which a lot of the CTSS system had been written in. It was really nice
because it was so much cleaner and neater than Fortran. And then at the Labs
I wrote a little bit of B, which was a precursor to C. B was kind of like a
stripped-down version of BCPL, which was done by Martin Richards at Cambridge. And
I never, I think I never wrote any BCPL, but I wrote a little bit of B and it was
kind of neat and I liked it. And then when C came along, it was at that point
a relatively easy transition into using it, and I pretty much have repressed all
of the details but I wrote programs early on that were doing text
processing, and although C’s not the greatest language in the world for text
processing, at the time it was a lot better than any of the alternatives that
were available to me and I think period. And so I would I found it quite
comfortable and actually enjoyed it at that point and stayed that way for many many
>>Sean: Let’s move on to the hardest challenge. So what has been the hardest
challenge for you in your life as a computer scientist, which helps narrow it
down somewhat.
>>BWK: Yeah. Geez. I, I mean what are the problems
in computing are: “How do you write programs that work” and then “How do you
make it possible for other people to write programs that work?”. And it’s sort
of those are the kinds of things I’ve been interested in all along. So I want
to write my own programs and know that they work in some reasonable way. And
that leads to, you know, building better languages, building better tools for
helping programmers, and so on. So that’s one aspect of it. And the other is how do
you help other people write their programs too, because programming is hard
to do, programs are hard to use sometimes, and so that leads to, let’s call it
the documentation side of life: writing books about programming. So that’s
roughly what I would say. Those are hard problems, they’re not solved yet. I think
most people have the same kinds of problems in various ways. And programming
is different today than it was say 40-ish years ago, in the early days of UNIX.
In the early days of UNIX you had a very self-contained environment. Things were
relatively small because you didn’t have much computing power to deal with. You
didn’t have any networking issues so you didn’t have to worry about things far
away not working or attacking you or anything like that. So life was
simpler and in some ways it was more fun because you could build really
interesting things — not huge but interesting useful things fairly quickly,
fairly small. Today a lot more programming is enormous collections of
libraries that you have to …. basically what you’re doing is gluing together
things that other people wrote, and then you’re going to Stack Overflow to see
why they don’t work. And then you’re adding somebody else’s random glue into
your own glue. And it’s in some ways not nearly as much fun, I think.
>>Sean: Leading on
from a question before about programming languages and how it was
when you encountered C, which programming language is the best successor of C or
the most influential?
>>BWK: Those are different questions or they have different answers.
“Best” is a loaded word so I’ll probably ignore it but there’s some obvious
things that derive from C. First, C++, which has been enormously
influential. It was done by Bjarne Stroustrup while he was at Bell Labs. Lots of
people say that C++ is too big and too complicated, and etc., etc., but in fact it
is a very powerful language and pretty much everything that’s in there is in
there for a really sound reason. It’s not somebody doing random invention; it’s
actually people trying to solve real-world problems. And a lot of the
programs that we take for granted today, that we just use, are C++ programs. If
you use anything from Microsoft’s Office suite, for example, those are C++ programs.
You pick your favorite browsers, those are C++ programs. So C++ is in some ways,
I would argue, one of the most important and influential derivatives and it’s the
first of the derivatives. Another is Java, which in some ways is a reaction to C++.
Because C++ is big complicated, etc., and so Java was an attempt to simplify what
was in C++, to make more of the decisions for the programmers, so that the
programmer didn’t have to make them himself or herself. It also took
advantage of kind of ten years of hindsight, because Java came along the
early 90s; C++ is the early 80s, so there’s a decade of improvement both
in our understanding of what we’re doing, but also a decade of Moore’s law, giving
us, you know, an order of magnitude or so of resources to work. And therefore Java could use a virtual machine, which C++
was never able to do. So there’s another example of a derivative of C which, very
important, very influential, an awful lot of the services that you use at all of
these big websites, are written in Java as opposed to C++. What is another
one? I guess the obvious next one would be JavaScript, which takes the surface
syntax of C, as many other languages do, but takes the surface syntax, makes some
decisions differently — still an interpreter for the most part — but
shares that C heritage in a lot of ways and then goes off on its own direction.
And Javascript is, in terms of just lines of code being executed per day,
probably dominates all the others. And then a tiny bit of
self-serving, the AWK language that Al Aho and Peter Weinberger and I did,
takes the surface syntax of C and then wraps it up in a different style. It’s an
interpreter but it looks like C with some variations to make it possible to
do other interesting things. So at least those. Oh! and then [a] more modern one: ‘Go’, for
example, a language that dates at this point from, I think, 2007, so it probably
hit the streets in 2009. So, call it a decade old. And so Go in many ways looks
like a modern C; some people call it ‘C for the 21st century’, and it has its own
nice properties and so on. And one of the things that it retains that some of the
other languages don’t is more the minimalism that C had originally. So
big spectrum of languages that came from C, inspired positively, negative
reactions, whatever, but all from that single source.

75 thoughts to “Brian Kernighan Q&A – Computerphile”

  1. Thanks for your work, Mr. Kernighan. I'm a big fan.
    I feel like I'm at that step he describes that you have to get over, where you know the rules but don't know how to start.

  2. I'm happy he throw the Go plug in there at the end… I was just waiting for it… I was like "Come on, you wrote the book on it, just say it!"

  3. When it comes to C and C++, I get where C++ people are coming from, but my take is that, well… I'm sure Brian doesn't need to be reminded of good design and adding features. The fact is, I still prefer C to C++, despite C's limitations, and I say that with my hands on the keyboard in both languages. With C, I don't have to keep as many language rules in my working memory (and their interactions). By now though, I'm looking to switch over to Rust; I just need to find the time to learn its linear typing properly. Speaking of, I was surprised to see Brian claim JavaScript as a C derivative, but not Rust, but then again, so many languages have some C heritage, I guess it's hard to remember them all.

  4. Lol, at the end he was asked what is the newest language he uses? Where is the answer? That's a great question.

  5. i have a career because of this guy. its trippy that i learned about him in school and he is younger than my grandpa

  6. Mr. Kernighan thanks a lot for the work and the help you gave to young students. C and Unix boosted and helped Internet to grow rapidly. Thanks a lot to you, Mr. Ritchie and Mr. Thompson😊
    Wonderful memories … 😉

  7. 4:37
    Pretty much, Brian, yeah
    You're no longer building the bricks, but finding the right mix of glues to set a bunch of other people's bricks together.

    Perfect description. Brought a tear to my eye, jeez

  8. I really like this idea of doing Q&As. It makes the videos feel much more personal. I hope to see a Mike Pound Q&A and many others.

  9. Disappointed he didn’t name Objective-C as one of the best C successors. It’s a great language and is a superset of C.

  10. I have C/CPP programs that started written in dos then once ported to visual studio 1.5 I just kept recompiling the same code on every version of visual studio everytime a newer version came out and the file size doubled with each new version of visual studio with me not changing a thing.

  11. Hi! I was wondering if you could get Brian's thoughts on Rust as a programming language. Not to compare it to other languages (which is better/etc) but just as a language on it's own.

  12. C++ is very important on being terrible — so it is a drive force to do better.
    Why nobody talks about D is beyond me — best direct successor of C.

  13. Read The C book by Dennis and Brian when I was in Grad School at the (CCM) Center for Contemporary Music at Mills College, Oakland, CA., 1983. It was really my first deep dive into several programs like Forth, Cobalt, and C (which was my favorite). Also did a lot of BASIC. I enjoy this channel a lot.

  14. would like to add c# and d to the list of c successors. At least c# has a pretty big number of projects done in it, especially in the windows world.

  15. 3:26 So I take it he doesn’t agree with Dijkstra’s proclamation that “computer science is as much about programming as astronomy is about telescopes” (if I recall rightly). As if programming is somehow merely part of the flooring of the subject, rather than lying at its heart. (I don’t agree with Dijkstra either.)

  16. 6:14 Unfortunately, the Java specification is barely smaller than the C++ one. So much for trying to “simplify” — it just introduced its own complications …

  17. C is the language that changed everything in computing. There would not be an internet (as we know it) without C.

  18. 4:38 Modern programming is mostly just gluing together other people's code. We memorize more (the API, how people named things, etc), and understand less (how things work under the hood).

  19. Is it bad that I only use awk to strip necessary whitespace and os line endings from my python code before committing to git?

  20. I constantly refer to my 1984 copy of "The UNIX Programming Environment" by Kernighan & Pike. It's just as relevant today.

  21. cgi in C (common gateway interface). I developped on that approach to interactivity for IIS and HTTPD server in 1998.
    php was not there. Perl was… nightmare … Cgi that was so fast.

Leave a Reply

Your email address will not be published. Required fields are marked *