For the past eight years, Dr. Kernighan has taught a Computer Science course on advanced programming techniques that is meant to reflect how programming is used in the real world. Over time, the course has become more and more stretched between important old material and new unproven material that might be important. With more and more material to cover within a fixed time period, Dr. Kernighan acknowledged that he wrestles continually with the issue of what matters, what old information to preserve, and what new techniques and approaches to cover. In his February 13 Lunch ‘n Learn talk, he illustrated some of the challenges and discussed ways in which we might use complexity and rapid change to our advantage.
The good news, he notes, is that we have available more memory, processor power, disk space, and bandwidth. The bad news is that these advances don’t encourage good programming practices and, on top of that, expectations are changing. Programmers expect more elaborate features and environments that facilitate quick delivery. Kernighan quotes a New York Times article that a web site cobbled together in just a week is now pulling in a million dollars a year for its programmer. “How to prepare students when the creation of such a simple application can have such a profound effect upon the world?” he asked.
The rapid evolution of languages, tools, interfaces, components, and methodologies presents major challenges and opportunities for programmers and for software engineering education. Back in the 1930’s, American Linguist Benjamin Whorf observed that “Language shapes the way we think and determines what we can think about.” He was thinking primarily about the natural languages of native Americans in the southwest, but his observation is also true about all the languages we invent to tell our computers what to do. The nature of a language strongly biases what you can accomplish well.
And so, what languages do our students need to know? C is useful, a lingua franca, and brings programmers close to the machine. Many institutions favor Java the introductory programming language, but starting with Java may spoil students from learning how to program well ever again. C++ is the choice for industrial strength programs and therefore something that ought to be known.
Another important class of languages is emerging, though rarely in academic settings. The way we write code today is simply different than the common approach 10-20 years ago. Scripting languages such as Perl, Python, PHP, and Ruby have real advantages that support common web needs. They are more expressive than Java, they handle text far better than C and C++, and the ease with which it’s possible to create arbitrary data structures. The scripting languages have drawback, of drawbacks course. There are few tools, comparatively speaking. And they are slower, but that tends not to matter because Moore’s Law continues to rescue us from programming inefficiencies.
At Princeton, joked Kernighan, rather than teach programming, we expose students to languages and expect somehow that they will learn everything subliminally. Ten years ago, we probably would have favored Perl and today, probably, Python. But Javascript is another interesting choice. It has no academic standing, and does have significant drawbacks, notably a risky object model and inconsistent implementation across browser types. Nevertheless, its widespread use on the web makes it something that students probably ought to know.
In particular, AJAX, or Asynchronous Javascript and XML, is the basis for much interesting software we run today. It allows us to talk about many important programming concepts such as event-driven programming, callbacks, and closures. Google Maps is perhaps the best example of AJAX in action. It always seems to show exactly what you want to see because AJAX is checking on the client side continuously and asynchronously to see what data you are likely to request.
This approach has other interesting applications. As an example, Dr. Kernighan demonstrated a plausible Princeton course site. With just a few lines of AJAX code, he created a site that brings up information as users type, anticipating their needs. Typing “CS” would bring up all Computer Science classes. Adding “Tu Th 11am” brings up only those classes that meet on those days and times.
Tools are extremely useful for the mechanization of repetitive or tedious tasks such as counting and sorting. They can be glued together into larger assemblages. Unix introduced the idea of creating and using tools like grep, diff, wp, sort, and uniq. Microsoft popularized IDE’s (integrated development environments). Their Visual Studio consolidated in one package all of the tools that a programmer would need, from editing and compiling through and testing and debugging. Such thorough testing and debugging environments are very large, but they offer real advantages. They lessen the mundane tasks associated with writing large programs, and they supplement or even replace the documentation by providing automatic lists of possible next steps. These heavyweight systems that may make it hard to accomplish simple tasks and sometimes hide what is really going on.

To build web pages and web services, there are new software systems that take care of many of the mechanical tasks. They handle what users may see on the client side, orchestrate the flow of information back and forth. They also provide administrative tools to assist site owners. Within the past three years, systems like Ruby on Rails now permit users to create complex sites within minutes. With the Google Web Toolkit, developers write in Java, arrange the way their site will look, and then compile. The result will be all the html and Javascript code needed to sustain the site across browsers. Amazingly, there are now more than 130 such frameworks.
Kernighan also noted that many online services such as Amazon, Google, and Ebay have their own programming interfaces that make it possible to access their underlying data in interesting ways. And so, it’s possible to integrate Google maps within other applications. These APIs are critical aspects of what students ought to learn to do, but the reality is that they are rarely taught in CS courses and students seems to lack enthusiasm for the subject.
From Kernighan’s perspective, the most intriguing aspect of deciding what language to use is that his Princeton students seem to migrate to reasonable decisions. Last year, Kernighan simply mentioned that there were interesting tools such as Ruby on Rails, Google’s web toolkit, and Django’s Python web framework and students used them efficiently without any further guidance. He acknowledged that the effort involved has become so easy that he’s casting about looking for ways to make the assignments a bit tougher.
Brian Kernighan is a Professor of Computer Science at Princeton University. He is especially well known for his contributions to the development of Unix at Bell Labs with Ken Thompson and Dennis Ritchie. He is also coauthor of the AWK and AMPL programming languages and coauthor with Dennis Ritchie of the first book on C. The presentation and a podcast are available.
Posted by Lorene Lavora



If you have a calculate machine, you don't need to know how to calculate on your own?
If you have a type machine, you don't need to know how to write on your own?
I think that everyone, in the first place, needs to learn C in the name of good programming practices.
'C is useful, a lingua franca'
Yes because it abstracts the machine.
'starting with Java may spoil students from learning how to program well ever again'
Not 'may' - 'has'.
'C++ is the choice for industrial strength programs'
Industrial strength bugs.
'and therefore something that ought to be known'
In order to know what to avoid. C++ has done more damage to computer science than any language ever. In fact it might be the only truly destructive language ever. With the possible exception of Pascal which it seems to have a love affair with.