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