Elegant Design - Lessons from a master
Elegant design is beautiful, easy to use, pragmatic, stable, and most of all is useful for the user.
Bjarne Stroustrup the creator of C++ is honest, pragmatic, down to earth, and a genius - in my opinion. I have always enjoyed listening to and reading what he has to say. No wonder C++ is still going strong - because the design philosophies behind it were/are very sound.
Irrespective of what your point of view is on C++ or for that matter for any product - it is always wonderful to understand the ideas, the thoughts, philosophies, design consideration and constraints from the creator/designer's perspective.
I would like to share three of master's talks in chronological order - weather you are a technical manager leading smart software engineers, or an architect, or a systems designer/developer - these are solid gold.
Origins: The Design of C++ , lecture by Bjarne Stroustrup
"C with classes was a medium success and that that turned out to be a problem a medium success is something that is clearly a help to a lot of people but not enough help to pay for an infrastructure in other words somebody who produces a medium design will end up supporting it forever"
design with user and use cases in mind
"...so I was the support and development organization for Siebel classes and I would keep on being that for a long time since since I wasn't too keen on doing maintenance and hotline support for the rest of my life I was looking for a way of getting out of the dilemma and that seemed to me to be exactly two ways out of the dilemma I could either improve the language so that it could provide more benefits to the users allow people to write code better make greater changes to their organizations that would make the language more popular would get more users and that would allow to pay for the infrastructure that it needed supports development teaching compilers porting that kind of stuff "
good products and elegant solutions are designed with love, passion, and honesty
"...and the alternative was of course to stop supporting C with classes and then the users would go away and that would solve the problem on the other hand the users were my friends and just dropping them that didn't didn't didn't seem to be fair at all I later learned that actually was a a third alternative but I'm somewhat pleased that I didn't think of it at the time because the third alternative which is sort of a conventional solution is simply to add hype more advertising more glosses talk people into using it but fortunately I didn't didn't think about that at all."
beautiful interfaces and affordance they provide are the key to elegant systems.
"... it [C++] has the effect that if you if you work in C++ on a UNIX system C++ what sound will feel like a a UNIX language it will have the user interface that you have on your Unix system it will have the libraries you're used to you'll have the feel of Unix - if on the other hand you work on the DOS it will feel like a DOS language and presumably you like the the system you are working on so that's fine it also simplifies porting because you only have to port the language - you do not have to port a user interface and operating system, like the classical distinctions between the language the environment and the libraries
Design Philosophy: Why I Created C++
" ... and my idea [for C++] was very simple: to take the ideas from SIMULA for general abstraction for the benefit of sort of humans representing things... so humans could get it with low level stuff, which at that time was the best language for that was C, which was done at Bell Labs by Dennis Ritchie. And take those two ideas and bring them together so that you could do high-level abstraction, but efficiently enough and close enough to the hardware for really demanding computing tasks. And that is where I came in. And so C++ has classes like SIMULA but they run as fast as C code, so the combination becomes very useful."
abstractions and affordance
"What makes C++ such a widely used language? If I have to characterize C++’s strength, it comes from the ability to have abstractions and have them so efficient that you can afford it in infrastructure. And you can access hardware directly as you often have to do with operating systems with real time control, little things like cell phones, and so the combination is something that is good for infrastructure in general."
economy and efficiency
".... another aspect that’s necessary for infrastructure is stability. When you build an infrastructure it could be sort of the lowest level of IBM mainframes talking to the hardware for the higher level of software, which is a place they use C++ Or a fuel injector for a large marine diesel engine or a browser, it has to be stable for a decade or so because you can’t afford to fiddle with the stuff all the time. You can’t afford to rewrite it, I mean taking one of those ships into harbor costs a lot of money."
stability and built to evolve
".... and so you need a language that’s not just good at what it’s doing, you have to be able to rely on it being available for decades on a variety of different hardware and to be used by programmers over a decade or two at least - C++ is about three decades old."
Evolution: Concepts: The Future of Generic Programming (the future is here)
"... basically the way I value programming is through what you do with it like the space program it's really cool and there's all kinds of other things that's being done with with C++ from the the biggest systems to basically the smallest my background was in distributed systems I still work on that there's a distributed system with wheels [pointing to BMW i8]"
simplicity is elegance
"... basically I want general generic programming to be just programming."
design characteristics - scalability, efficiency, elegance, and flexibility
"... basically I started wandering generic program back in the ages there's a paper by me from 81 explaining why we need generic programming and how we can do it with macros - I had the right problem I got the very bad solution if you're trying to do generic programming and macros it doesn't scale it's not efficient enough it's not elegant enough it's it's just a very bad idea however it is the right problem; so in 87 I sort of looked at the criteria I wanted something that extremely general and flexible."
elegant interfaces, generality, and user-centricity - design for users and with users
"I'd learned a long time ago that if I built something that could only do what I could imagine then it's not general enough a group like this can imagine many more things and I can and I must serve a larger group... I knew the value of interfaces and a lot of what we do with the design has to do with the designing good interfaces."
"the fundamental design criteria of C++: generality, zero overhead, and good interfaces"