Know Your Programming Style
Father of C++ says programming still matters
BY MARGO McCALL
C++ creator Bjarne Stroustrup believes the sweet spot for writing software is located somewhere between generic programming, object-oriented programming, and concurrency. However, until there’s more clarity on concurrency, software developers will have to make do with finding the sweet spot between generic and object-oriented programming styles.
“Where this is all going to end I don’t know. What makes it complicated is lacking the third axis that will tell us where the sweet spot is,” Stroustrup told attendees at SD West 2008.
Stroustrup shared his perspectives on the two different styles. He said those who focus on algorithms will naturally drift over to generic programming, while those more concerned with relationships will fall into object-oriented programming.
But picking one or the other isn’t always the answer. “There are enough complementaries that it makes sense to use both,” Stroustrup said, adding that “if you want to be considered a professional in this game, you shouldn’t know just one language.”
The Texas A&M computer-science professor said programming styles can’t be evaluated in the abstract. Rather, it’s important to see how well they perform against an ideal. In the software development industry, the Holy Grail is correctness, productivity, performance, scalability, generality, and being easy to teach and learn.
Programmers have a long list of wants. They want a programming language that allows additions without code modifications, takes up minimal space, runs fast, allows for automatic verification and parallelization, is minimal yet readable, and requires no build times.
But, Stroustrup said, “We can’t have all that. It’s impossible. This is an engineering discipline and essentially it’s all about tradeoffs. Anybody who talks about the perfect programming language — they’re out to sell you something.”
Languages aren’t perfect. And Stroustrup said programmers should be aware of what languages can and can’t do for you. He prefers nonintrusive techniques. “If I can avoid touching your code, I can probably avoid breaking it. If you don’t cut it open, you’re probably safe,” he said.
Despite pervasive rumors to the contrary, Stroustrup is of the view that programming still matters. “I think the traditional programming skills that have the properties we want will remain relevant for a huge part of the software industry for the foreseeable future.” CW (March 2008)