C++: history, design, use, standardization, future; performance, reliability; software developer education; | distributed systemsView the profile
About the talk
We – attendees at CppCon – are all teachers. Some teach for a living; many occasionally teach a course or give a lecture; essentially all give advice about how to learn C++ or how to use C++. The communities we address are incredibly diverse. What do we teach, and why? Who do we teach, and how? What is “modern C++”? How do we avoid pushing our own mistakes onto innocent learners? Teaching C++ implies a view of what C++ is; there is no value-neutral teaching. What teaching tools and support do we need? Consider libraries, compiler support, and tools for learners. This talk asks a lot of questions and offers a few answers. Its aim is to start a discussion, so the Q&A will be relatively long.
01:08 Announcing winners
03:41 The C++ world
12:42 Bjarne Stroustrup’s background in C++ education
18:41 The aim of teaching
22:50 Don’t be too clever
32:27 We must succeed!
37:00 The masses
39:48 Basic distributions
43:14 Value-neutral teaching
47:33 Modern C++
51:11 Better code
56:10 Better code: always initialize an object
1:00:18 Better code: don’t be too clever
1:05:15 Teach for the future
1:11:28 Simple solution
1:15:40 Libraries: part of a standard or a bundle?
1:21:14 Teaching programming to develop critical thinking
1:26:40 Exciting upcoming things
1:33:13 Golden ratio
I want to get to introducing our opening keynote speaker. I want to say just a few words about him. Alarm, you know that Johnny is the guy that created C plus plus but what a lot of people don't know is that he is very very interested in education when he left his position as a corporate researcher to become an academic researcher. He also took on the responsibility of educating undergraduate engineers and how to program how to program a program using any took those insights and those Lessons Learned and turn them into a very very successful textbook again
on how to program using C plus plus but how to program I think that when we think about our role as Engineers on a day-to-day basis, we are to spend some of our time as students and some of our time as teachers and if we're going to be successful in going to be successful as students and successful as teachers and so I'm very interested in very excited to hear what he has to say. I did say however that I have a special announcement. I want to put that in I forgot to cover that will be announcing a lot of winners will announce the SCM challenge winners were going to
announce the Microsoft drawing winner and the poster competition winners. There's another winner. I'm going to announce right now. This is an ounce today. It's not us. It's the Institute of engineering technology engineering and Technology. This is the oldest professional Society professional engineering Society in the UK, possibly in the entire world, and they've announced today. They're Faraday award-winner. The Faraday Ward is the most prestigious award that they give from the Oldest professional engineering Society previous winners of included Maurice Wilkes Tony
hoare Rodger Needham Donald knuth today announced the 2018 winner. Let's be honest rooster. So we thought we'd ask him to come up and say a few words. Thanks. Thanks. Thanks, hun. Very honored about that. I warned very pleased if you read the list of people who'd gotten that award. Mostly they're not computer scientist. You see it's downright intimidating. Let's see. Am I pumping bits here? Yes, so when I was asked to give this opening keynote I've done before so so I
had a problem with it is what can I talk about? that is important to most of us and that I know something about And that we haven't heard a million times at this conference most of the time we do what we always do we do the reasonable rational thing. We don't fight any fights that can be avoided because we're busy. This is the way the world gets stuck and no progress have ones. So I picked this quote from George Bernard Shaw about how you have to do unreasonable things sometimes and that's what lies behind
a lot of what I'm going to to say hear me. What should we do? What's not right and what can we do to fix it? This is my opinion and intensity practical talk. And basically I'm going to talk a little bit about teaching programming and then I'm going to go into something strike a more technical not teaching technical not how you organize a classroom or whether you what what particular tools you use to grade your students to find cheaters with things like that. None of that. That's not what I'm talkin about. This is not really an education for
him. This is a form of professional people who develop stuff with a few teachers sprinkled around so and then I'm going to go into some some some details about the what which each as opposed to how we do it and wait we award speeches and we have some fundamental questions, which is what do we teach and why what what is if we want to achieve? And who to which each and how those icky Christensen the orange juice the world is moving on this moving very very fast. It's moving too fast for any of
us to keep up on everything and so we have to be students basically all the time at least a little bit off the time or the time behind and then we become part of the problem and it's a huge problem. If you've ever had a piece of twenty-year-old code dumped on you. And have to look at this horrible mess of say or grown electrical class hierarchy is littered with loop with with with with memory leaks and point of spaghetti and such you can use these thanks from teacher somewhere.
They don't get it right all the time. And if if you've ever gotten people in from a University Court University course and they couldn't program the way out of a paper bag again that's part of the problem. And so I'm going to try and do a little bit of a rabble-rousing all we have to do better not because I'm criticizing anybody in particular but I feel not only do we have to do better we can win or professors as I said and teaching orcas or the time we have a colleague dropping in talkin about it or we give them a little local course about the latest features in such.
Basically, we would give advice that's Chichi. We better give good advice to give advice that brings the world for the bed instead of stifling yet another innocent novice. and one of the things that that bothers me a lot is that sometimes people have the weirdest idea of what type of process I'll get back to you, but basically When you are giving advice when you are giving a short presentation when you are giving a course think about what it is, you want to achieve and work backwards from that don't start with why don't
we always done and what is easy to get started or if you are Professor what's easy to step test for I mean anything that can be tested by a multiple choice test. Is she bad. all the interesting stuff is is the stuff that is more real, to shoot through to punch if I specifically and so who do we teach depends who we are course the students in which case you have some chance of knowing where their background The Freshman they coming from high school and they all over the place when I started teaching freshman. It was 60% electrical engineers.
And the rest was Computer Engineering computer science with being Advanced and doing Java and I got the electrical engineers two years later when my electrical engineers significantly Out programs to computer scientist computer science department changed, but basically you have to look at Assurance of people you talk to the people who changed and try and understand what's that background? What is it? They know what is it? They don't know and what is it that will do good for them in the future and a Porsche. What do they
want? Which may not be the same industrial programmers again the same thing background aims for the future and that's a lot of professional non-programmers reducing C plus plus people or physicist biologist historians. They have a totally different view of what is important. A lot of them go for the thing that's easiest to pick up which she station please Python and then they run out of CPU power. I heard about a biologist that was running three. months
runs to get his data it it could be done in just over 10 minutes. We know that because that was done when you couldn't do it in three months anymore. We have to help those are so many in the world and they're doing so many important interesting thing latest Servo help. And basically the most fundamental thing about teaching I think is that the students are by and large not like you. On average they are not like you and on average. We assume they're just like us. Hey, we've all been to school so we know what it is to learn right? We just do what we did 20 years ago in kindergarten know
you have to sing a little bit harder about these things and you have to learn learn about the students learn about then each and I think we did a really lousy job teaching C plus plus before the 1st and Not much better later. We their definition include me basically the message about what she plus plus was was hijacked by everybody that wanted to hijack something that she first person supposed to succeed those days this or has fashion and that they they will
determine what people think is right alarm C plus plus Got Hijacked by people afford to go see with a few notches on the court on the side and others Got Hijacked by people with the function virtual member function, preferably and everything should be dynamic somehow we have gotten a lot of really bad cold out of that kind of stuff and it's because Me and all the others did not ejaculate clearly enough what C plus plus was and how it could be used well and
this got amplify actual text books through conferences and things like that. We we just have to do better people talk about getting the message out messaging and all of that kind of stuff. I used to think it was wrong. I know it's right. You have to rephrase the message. You have to repeat it and you have to get it right and then you have to get it out there. So I want to teach Good Morgan cipres bus Which leaves us with a little problem of defining Martin, but I'll get to that so I have a background in this I hate talkin about things. I don't know anything
about and find Lodge No don't know anything about I Define as having knocked on it for real. One of the problems with education by the way, is that the previous occupation of most professors with student and that's I don't think is this is just the right background for for for cheeching. How to do good stuff in say industry. Fortunately. This is against not Universal when I'm trading sizing something with a broad brush. It's not because I think everybody has that problem. It's
because I have to be brief and if I put all the heavy accent exceptions when it gets a little bit but a lot of people have that problem a lot of people don't swing at Columbia and I I talked to a lot of people give talks interact on on specific project. So I do have some experience in this and I have my Britain Macabre books that are NY juice. I think one thing you should know. There is that they are different they aim at different things. The sworn book is aimed at people just learning to
program. The chewable is meant for people who may have fallen 5 10 15 years behind Lucy + + + + needs to meet needs a refresher and a so busy that they only have a week to do it. That's that's the design criteria for that one in the stick poke is well for people who need to know everything in quite some detail and well-defended is this is not a Trattoria. So basically when you teach figure out, what is it, you want to achieve wart backwards from that and and and write it or say it or something like that.
One should I decide it to choke choke to give this talk? And I promise to give it and still having no idea what I was going to say to people that some responses Astros great. We want that developed in the help. This is good. Now the teachers were different in really really needs to change you but you know, it is hot Showalter. And what can you say that to me anyway, and you are interesting and I'm not sure how I'm trying if nothing else. You're not the standard or audience. So maybe it's the same size say on you and more helpful than they would be
if you were worn down 20 years veterans with the education system and and me I think it's very important but it's practical it is not education Theory or language Theory. It is something that happens whether we want it or not everyday in classrooms in in labs in Edmond floors, and we have to do it and we need to balance two things principles idea of things that we would like to proceed on right over. George Bernard Shaw and then the practical skills that it
takes to make a change. It has to actually work and you have to build it so that gets back to what we're doing what we teach me many ways of using C plus plus I mean the people going around saying things like cheap hotspots programmers do this. This is the way she plus plus has written and and they usually show dancer. I'm not I have seen enough C plus plus I've seen enough C plus plus program has to know that generalizing or the whole group and then simplifying it took this
is the one true right thing is just ridiculous. Nobody knows enough. Nobody can be precise enough. Nobody can give brief advice that is wide enough to actually help everybody. So we must choose. We cannot just teach everything this too much in any way. We don't know in it everything and so one of the things that I recommend anybody who is in a position where do teaching advising mentoring search is to think a little bit about what I owe on Ames and try and write them down. I find writing things down is really really helpful. It's one of the things that makes us
honest and especially if you show it to some of your friends and victims or whatever you you can you can get something that that that is better than what your first thought out and you have to remember that the students will Choose what's important they will chewing out a lot of what you say. They will listen to people who says exactly the opposite and they may believe them and they may not may not believe them that depends how well you're doing the job and how convincing people on on say read it is and so
you must choose because well everybody does and so he have There are lots of Ames very reasonable names for vodka Cheech. And from there, some of it how you teach it get people really excited about coding that's very important, especially for the young ones but it's not my main focus. Somebody else is better at it than I am. Not that I don't sometimes go and talk to high school students and middle school students. Well, that's my job, but it's when I talk it's not what I'm thinking about most of the
time I'm thinking about how do we lay a foundation for careers in system development, whatever you want to call it and or so, how how do you how do you Talk to people who are not actually going to be full-time developers full-time computer scientist, but it's going to use a lot of debt to main focus is that there are people who says well, let's get them to write it as simple program and that's very that's what holding. I think that's very often leads them to teach things that convinces the best and the brightest that computer science is boring that's just ended up in this boring because
they can do simple things easy. And then that's it. I worry about that and then of course, there are people who just want to rolly more people so they can get more funding for for the teaching and that very often leads to too bad. She answer spoon-feeding. Okay, so I problems with sucrose + textbook they don't focus and if they do they don't say what the focus is supposed to be. So it's hot for teachers and tell and teaching assistants to lecture notes
and bottom-up focus on what can be tested and teaching 1990s C plus plus with C plus plus 11% tax if you find a book like that, I am not going to mention any but you will know that that's not right. So we have to teach programming. It's not just language features. It's it's programming techniques and it's not just what is valid. I mean a text to like How weird examples can you come up with for the conversion of an unsigned short to an signed inch is is basically on interesting that is not what the the things about. Let's debugging and reading the
manual you can do that once you're programmed, but you have to give some advice about how to write code so you don't get that question. If you can sure I could come if you have that question. You probably are doing something wrong and we can try and teach everything at least not at once we start from the beginning that is far too much stuff. We have to choose and we need great libraries. I think one of those things that's wrong with lot of early. She felt rushed teaching is that they change the language in isolation. You could get your page 697 and you get Victor.
And salt is mentioned a hundred Pages later that teaches students that the stand up the stand of library is is is is boring on interesting Advanced difficult stuff. Where is it teaches them that if you write your own linked list your cool show write your own hash table. It must be better than that standard stuff. Is it wrong wrong wrong wrong wrong? Exactly. So we need Freight libraries. That's nothing much to do with you pass plus there but that's a great Library. That's the thing. She library in Cambridge.
So another thing is when your cheeks try not to be too clever. People always want to know the latest and we loved people the latest the problem is that most people wash for this and have an accident the foundation stuff. So we have to quarterback teach people how to do basic things cheap people talk to simple things when your English trading at check Nique don't use the most advanced algorithm. You can find I am I wouldn't pick bubble sort but I wouldn't go to the 4th of generality of everything the First Trust and simplify things. The best example is the
simplest example that illustrates the technique or a feature or something like that simplification is is there really important thing in teaching always give a rationale. Don't just tell people do this. It's good for you with build character and you might get an A if you answered just right. Those are very short turn. Silly arguments and you you know, we need to do better than that. Jeff say why people should follow the rules for the suggestion show Making. And the perverse off of good
teaching is to get ideas into people's heads. Sometimes you forget that teachers forget that they focus on creating the focus on Technics a focus on me and they forget that it's not just to show them something you actually have to understand it. You have to explain what it is or why it is and what it's good for not just one of the things and don't show off. I mean it is so tempting to show off your colleague to send front of a group of people and show them something look. This
is clever. You don't get it right? That means I'm smart. That is not good teaching. It is really when you do it right people come out and says What's that symbol? Yeah, you'll go ahead and once told me you know. If they noticed your slip the knife in you haven't done it, right. He's a superb teacher. I wish there was something for my English teaching but I don't think there is but we have to keep our egos and control remembering that the purpose of the exercise is to teach
somebody else something useful something by the way the great race are very good for using teaching. Should focus on just a compiler and a few. a few short statements in a very limited number of libraries, especially in in early teaching And then people are thrown into the real world where they drown in complicated tools and libraries. I do not know how to do this. There are so many things and so little time but eventually people will will learn about all
of these things and it's a good idea if they feel at least knew what they didn't know and have some idea that someday when your program is more than a thousand lines long you you may actually need some of these support and not just to make it easy to do simple things. But something the scales choo choo choo, choo lawn chair things again just lecture about programming. I mean sometimes says just think you can learn bicycling from a course one whose course
do you think you can learn to sign without the signing things programming without writing code programming? Reading it. Somebody else's code. People do believe those things and that's wrong on the other hand. You shouldn't just hack this a lot of people at learn from just looking at what other people are doing and what other people are saying and they just throw cold together conference paste is the ultimate of that don't just have something and it's not easy. It's not Quik. Nobody can do anything but do something. I mean throw in a
robot or get people to use a Raspberry Pi or something. This is probably obvious here. It is not obvious to a lot of universes at the first couple of years. And complexity is the enemy of just about everything including good chi chi try and keep it simple focus on on Simplicity and don't throw all of C plus plus at people. They won't be able to understand it. Anyway, basically focuses students on a few things and and a lot of courses doesn't have Graphics to a web email database kind of libraries. That's some
other course which most of them never take and they come off believing that there is no email is run by C plus plus using those peaches is completely missed. I am in the classroom when I was teaching and I tended to use the first 5 minutes of every lecture to talk about some application. So what does the software on the Mars rovers look like and how do you think Google works and things like that stuff can a people person illegal thing that keeps me going is the applications? and so
Don't think that is one way I really fear monocultures single language single operating system single curriculum, when people everybody copies from each other and get sings the same things from the web be many ways the argument that's not the way other people do it if they or if they do it at Harvard. It must be right is it's not conclusive argument you look at what others are doing you trying to run from it, but it's an angel of your own that you can use my I know University next to a
tractor Factory maybe programming tractors would be a good idea. My hometown was into wind turbines. And so that there's an example there something that can inspire people. and don't type I was criticized a lot in the early years for pointing out that in my opinion cephas passport double your productivity. Everybody else promised orders of magnitude transformative change. How do you get a Transformer to change little step at a time? I don't believe you have this great genius that so sorry for your problems like that. That's not engineering it
maybe certain branches of meth, but it is not when you have to actually build a large complicated system have all the pieces work together. So don't hide and don't let people believe in magic. I mean friends don't let friends believe in magic or something like that. I really try to explain people how it works. So you explain the library. Then you explain to take me to the library is using then you explain a little bit about how it interacts with the hardware. And if you are really on the road where you can just tell him a little bit
about how the hardware works. I mean, it's abstractions all the way down and people should understand this. I know too many people who Do one level of the system and then aren't interested in how it is. Really. I mean, I'm frustrated if I don't understand what the the next level down the extraction stay is don't know everything but at least I feel bad about it. If you feel proud that you don't understand Hardware. There's something fundamentally wrong crowd that you don't know how your library is interacting with the operating
system and how often one you shouldn't be proud of it true. You will not write low latency software or high reliability software is this is practical and we have to succeed the main argument is that we will depend in our daily lives. On the code written by the next generation of programmers. So if we screw up will pay for it somewhere also, maybe we will you eat with short focus on this and a certain amount of idealism is necessary if people just have the attitude I do my job. I do my job in the simplest way. Let's let's not rock the boat. A lot of people do
that for some people. That's the only strategy that makes any sense. However, some of us has to rock the boat. We have to make some change that requires idealism was you thinking about what you want to do? What would be good what change is necessary and sometimes a lot of work on it? I I have an idea all along the lines of June, you know doctors have certain professionalism that sings they just don't do and if they do they get into real trouble same with Engineers, we build things that are
at least as essential for our world as the hardware engineers and the medical doctors after all what tools do they use and we should we should hold ourselves to a very high standard there. We have to do it better and we have to start out right and then keep doing the right thing. Yeah Legos program in C plus plus first little bit by analogy does other fields deal with the problem of getting people on board and appropriate levels of complexity for them cameras and photography. So I'm going to do an
analogy with with with photography remember proof by analogy is fraud. So this is just an illustration nothing more. You can't just copy it but basically That they are very great similarity is there so much depends on the equipment. We're using it depends on the user. It's not an automated process that that that that just runs that means you need teaching training experience and such and there's lots and lots of components involved in both software and in in photography
and uses differ dramatically. I mean, my main weakness in photography is that I never had the time to take the picture to take the necessary effort to learn my equipment and to spend the hours necessary for the light to be just right. I mean, you can't just pull the Sun up and down that's needed. You do have patient. That's my weakness. I have it. That's what people have different skills people have the different course factors individual needs taste and skill. Change your what time this is
true for both photography and and programming. This is why I think the analogy might be enlightening and needs differ and system is is the throttle parts to it. If your programming in a programming environment, your liver is language features and so much is one system and your conscious thought using something totally different similarly with photography. So basically a professional level camera that disqualifies it for me, by the way. I like to chew Travel Lite, it takes photographs. If you know what you're doing and if you
take your time, I don't have that time. I don't have that patience for the more you can completely drown in a quick boy. I mean if you are Gearhead, there's no end to the number of gadgets. You can attach to your system and similarly the people who never saw a library or language feature that they didn't want to use in the latest project. No things that I did for people with list skills and lists patients. A lot of work has gone in to the signing these things. So that
mistakes aren't really disastrous. I mean, it's like a blood pictures. They look a picture and slightly off program is a good start and they tend to be self-contained. That is you get a package to use it and we're not good at programming. I mean people get the stew C plus plus compiled and then where's the GUI stand up the greatest problem when I was teaching undergrads. What's to get the GUI Library installed? This is where the real world hits. It's painful and it doesn't integrate well, and my students were using
Max and Linux boxes windows boxes need different these packages are done to 22 Paisley have everything in the box and it works right out of the box, and I think I'd like to see that but there's another aspect of these things is The various manufacturers Sony those with cannons or some Olympus has some beach has a system where you can learn and then upgrade to the next level not chocolate painless, but less painless sore standard I can pick up any camera and do a simple point-and-shoot kind of thing is standardized across there and each has a way that makes it easier
to to grow up. If you need more Orchard go down. If you are not in the professional mode, I mean I make better pictures in the first two days if I use a point to shoot, but if I have a vacation I can the first two days I will screw up with it more Advanced Equipment, but then I'll get better. You can move up and down these level. So I think we need a system one system does not feed or if we give the professional camera to an amateur one. They won't be interested to they don't make really bad research and we need some kind of idea about
interchangeable parts and distributions. I should say give me the image of worship and I should basically not have to say much more than I just did that give me the answers. Yes version I come something with ten times our number of knobs and dials. And if you are professional you ask for the professional it's going to be more painful, but you're going to beat all the amateurs if you know what you're doing. and so why three why can't we just say he is the perfect system because there's no perfect
person. There's no one person that but needs all of that kind of stuff. We have a chance GIF throwing everything at it. Look at teaching look at what you get out of the box with the standard you get everything that you need to write the kernel of an operating system more list and 99.99% of people don't ever see that and shouldn't see it because they're doing something else. So basically we're doing something moving in the right direction module to help.
This is the way I would like my code to look like give me the entry level bundle. That's all it needed. And if I want the two chairs Lego bundle, I want that instead. So I have a choice and it's a hot granular. It's a course baby. I want to say give me the basic games package or something like that, but we will have to limit the number of things that people can get so that they can not get lost in the details and then you can add things that's not part of the foundation 2D. Graphics 3D Graphics. Dada dada. Dada.
Okay, and we need a better package and built system. There are packaged systems out there and proving thanks to all of you that's working on that bought the average students the average user get lost in how do you download something how to install something? How do you know it works with the stuff I get from the war they have plus the stuff. I'm getting from the war that we we need to do better. I really want my over in system to say give me the GUI from XYZ install it and then I should be able to important
if it's more complicated than that. It's probably too complicated. This is not just for the novices. It's not just for the first year students. It's for all of us when we're entering a new field that we are not experts. I have this distinct feeling that involved feels. I'm not an expert. Endospheres two things. I'm not an expert because I'm learning new things and I'm getting into new things. And so I'm an amateur. I need all the help I can get so let's just go to slightly more
philosophical thing and then to some code. When did Cheech we say? What's important? And explicitly or implicitly we can tell something is bad. We decide what we would like to students to learn and if each each well, there will be badly that we have to decide what it is. We want people to get in particular if we're teaching C plus plus at some level. What is it? What's good about it? Where do we want to go? What would you like your coach look like in
5 years for tomorrow. Do you want to write 1980s C plus plus some people do but I don't think they should so my primary interest again is get a professional attitude dependability maintainability performance is important and most of what I'm doing it's not everybody is essential thing, but it's it's it's important in C plus plus and reasonable cost. These are sort of engineering concerned. Science concerned and soap plus plus is divided into phases. I need resource safety.
What is the value of abstraction how to use it? How do you do generic programming and use templates? Well as opposed to just use templates Simplicity for most developers this I think is keep out. I did a small survey of Text books about C plus plus writing this and it's a story result of these things don't even mentioned. It's it's outside the scope and then that's pretty pretty bad. And then change is hard and Martin C plus plus is not sold in particular is the
most effective way of using C plus plus today given the given the current standard which is now C plus plus 17. It was formally approved a few days ago. And inertia is is is the enemy of good code. I mean Professor is not the way we do it doesn't fit into the curriculum. Maybe we can make a change in five years when we when the data structure course is willing to do a more modern thing on students. They reject what they didn't expect when they expect from the strangest places or from the web or from
their friends and a lot of students. I find convinced they are smarter than their professors and you know, sometimes they're right. Especially a lot of high school teachers have been smarter than their High School teachers, especially in Computing where Computing has not been a key thing where we don't have a good Charlotte curriculum like the garden calculus and I quite often to do the teachers are not as smart as a smartass student. So if you get the smartest you enjoy University Corso into a job. They may have
a jaded opinion about teachers that will apply to you too because you are now in the role of the teacher. And I have definitely had people repeatedly every year in the course freshman coming out or Texas high schools who are absolutely convinced. They're smarter than I am on the call Bake Off programming. I'm reasonably sure they're wrong, but it is something that has to be taken into account until 4 if they don't take it just because you say it and we we we have to worry about current practice because it's very often. What was fashionable 10 20 or 30 years ago.
By the way, this this year is 50 years old. So object-oriented programming is now 50 years old for somebody who think it was to just remember 50 years by that far into it. Martin Tudor splash I Define it as a best practices using the current standard. Call Cindy with TSS and basically I am for complete the type safe and completely resource safe code and that's a project which I launched here two years ago about the secret protocol guidelines that basically tries to codify. This is set of rules. This is not what she plus plus
is. It's a kind of way of saying what are the good practices. How do you get started into this? I mean, it's not something that's in Forth by the compiler. Everybody has to do just like that but you really need a good reason to do something different is the way I designed it. It's a very Action Project there are dozens of contribution every month. And it's it's it's a very wide. Set up contributions. I mean where else do you find Microsoft and redhead doing something together? Regularly, the world is improving. So
Kodak sound programming has to do with code in the end. So I would like to be because they have to be simple for teaching. The class it has to fit on a slide or a couple of slides of people showing me this much code. The ideas are going to be lost in the coat. You can get the idea. Yeah, if you are in a work environment and you can sit or screen with a with a guy that bought it many many cases finding simple examples is really really hard and also the biggest outboard
sometimes the greatest that was necessary for compatibility for the way. We usually do share and the convention center grown up since the 90s so findings more examples of key and don't set for a cold from explanation. If you just show the code people will not get the idea and they were invent reasons. Why it looks like that and those reasons are sometimes seriously weird. If you give some Josh the explanation that sort of the standard lecture of what is good improv
on people go to sleep. They don't get the idea so tight integration between examples and explanation. This is essential. I learned that from Brian kernighan. If you haven't read the introduction to tutorial the first chapter of chi and it's a beautiful summer of how you can get ideas into people's heads. See what have been among the dozens of failed attempts to do what she did if it wasn't for that book and that style of teaching It's a very important Brian is by the way a really nice guy.
The fights between the sea community in the cipres cross community did not happen between me and Brian and Dennis that's patch give a talk without code. So I'm going to show you a little short rompers or what I think so, you have two ways of writing a loop. The first is the good old way which we have written that way since the early ages. And then that is a new fancy way with the range full and why is chew better than one? Basically true States what I want
to do for all X Envy. Does it snow? All right, I didn't need an eye. There's no separation between finding the limit of my data structure and the use of that there are variable constant, whatever you want to call it, so I can't make a mistake. about getting the size raw and you can explain this this easy. So it shorter and less opportunities for for mistakes. And you know, yeah one is more General you can express more cases. But that also means you can make more mistakes. So remember the simplest and most
General structure that control structure at least now, you can Implement concurrency with a cold shower anyway, so basically just because you can doesn't mean it's better. Sometimes it means it's worse Echo Show can do everything is the fundamental reason why we don't use it except in machine-generated code and such. Yes, I'm here stomachs album slightly more Martin example. I am going to Blink some of the ladies. And there are two ways of doing it. I
think even integer and it breaks and I can give a millisecond document that says how many milliseconds that can blink now if you use integers you have to guess about the unit. And so if you have blink number two, and you just give it something without a unit the compiler says well, you didn't tell me what the unit was. I won't compile this for you. This is good in the reason, it's good. My best example is that little spaceship there? It will send up tomorrow and just doing the final Court corrections to get around moss and I go to orbit and
it disappeared. My favorite Theory at the time was it has been kidnapped for ransom by the Martians there. There's also people that claimed it was a Yankee go home. If you don't want any stinking earthlings Kia was more relevant and less interesting. Two groups of Engineers and they were transmitting a power a power reading through an interface that choke adorable. On the one hand to head SI system MKS the other side they had the imperial system. Acceptable pass through the interface has changed its meaning with a factor of exactly 4.65. And we never saw that little
spaceship again. That means that about the lifetimes work or 200 good Engineers just disappeared. Basically it all work for nothing that they got the salary but didn't deliver anything of value to to the world or the sign systems waiting for the date. I had to wait lots of promotions didn't happen. Lots of students didn't get their degrees and ya basic cable or six hundred million dollars and fifteen years or more to get one up. That was the bug that you see there in the first
use of blank led to 1500. Some bugs can be really critical and we can do better than that. And if you want to be generic you can do that to Morgan cipres plus is very flexible. And can you set flexibility to gain possession? So here we have some of the rules from from the stand from the core guidelines make interfaces precisely and strongly typed that's an example of that and we can go for a walk or is initializing update. This is the saying that people break again and again
and again, they are so smart. They know they're going to initialize it but they declared here and then I sat down here and they get a ride all the time because they go travel program has. No. Even if they get it, right somebody else is going to write code in there or your hands are or three possible cases and somebody invents a fourth case. So one of the rules is always initialize an object and always have some pressure because people have had all the ways of doing things over the years like I like to define or am I dropping
them program and then I initialized on the way or within Pascal and other languages for the down. Blessed by the way, the sign that your function is to Launch. Which is another now, sometimes you can't do this so you have to deal with exception so I can put both of us and multiple out values have been over the years because well, if you have to call a function to calculate the initial value of two or more variables, then you end up having some things like that area code there you you call the channel you
passed the area code in Spanish allies does a parameter. You don't say so the reader can guess it. No, and then you have to chase it. So in super plus 17 we have. I think we have structured findings where we can say. I want to break the results of the channel open into its component parts. And so we can all return in values and use them as individual variables instead of having them into an object and accessing the object in a certain way so and return multiple Outlet use as opposed
to using out parameters which box or one of the ways when we are doing when we when we are developing this is to look at dogs. What do people get wrong. What can I do to fix it? Again? The least clever ways that work? Basically develop a strategy early in the design. That's a rule it sort of philosophical in the contacts that again. Find it when you haven't the song Rumors high-level some rules a lower level and checkable to Signal the exceptions of a error handling only. So if you look here I have gotten too far down here. Yeah. I showed you know,
I did not show you this so first we start off with a crash course tile without parameters then reused Structured findings and find living start discussing should it have return two values? Should it have? Throwing an exception and this is where one of them is a tricky pictures to say when to throw an exception when they have an error code. Is it normal to fail? Is it except expected to fail then? It's probably an error code if it's consider the sign of or an extremely rare event
that it fails. It should be an exception is the sunset in the guidelines in the context of using C. Plus plus clever is a swear word. Don't Be Clever so here is some cold slightly simplified. It's got really bad. I don't know how many of you spotted it how many of you would have spotted it if it has been in a code that was a cover screen. It is Trivial for the force that again to catch this the problem is that people are messing with resource management and there's some rules don't leak resources. Don't call Anu and delete explicitly and application code. It
should be encapsulated into a resource manager and a roar reference is not only And all the woods if I if I return stuff on you or something as a reference, don't do it because not only have you now send something out. So, you know, there has to be a delete but there's no point out there that gives you a hint that you delete it. So a lot of the guidelines have to do with resource management and the analysis software actually the existing stuff that shipping from from Microsoft
is actually catching this and I believe that other efforts are in place to catch things that has been specified in the whole guidelines lately. I have found that people have learned fresh things directly and code a little bit too. Well, I see a lot of coat that has no comments in it because in the old days people wrote comments pages and pages are comments. And they attended to be out of date and unreadable and imprecise and then a lot of places people say no no comments how
bad we won't happen is you're trying to do I can see what you do, but I kind of see if you meant it and so basically the rules in the in the in the coal guidelines you press the things directly and Coke, but that thing chicon Express directly and code and that is why is it there? What is it what you're trying to do? So basically intent should be in the common and comment should be crisp not hidden in some somebody trying to write one piece because they really wanted to be an English major.
so I think things like that matters and the old religious if the comments and the Code disagrees both our property raw and I actually applied that rule when I wrote the arm document the start at the standardization. I tried carefully to say everything twice. Because then if I screwed up there was a high probability of peacocks. these days from chemo right specification say try very hard to say things once only Which is sort fine except that I can't see if they mended. So if I read a statement
in the standard, I don't actually know if that was what they meant to say and I didn't quite understand it all. They didn't quite understand it. I can't see comments on Portland Show De La Comedia is arguably the world's greatest architect. So I'm work for your Design Center for our rulers is important. I'm not going to go into the details. I encourage you to go on GitHub find the call guidelines look through it. If there's some you like some that don't like sent me an email or put in an issue or something so that we can improve these things.
And basically, my name is very simple. We can write tight and restore safety plus plus my first step is to make sure that I can do that reliably that requires two enforcement. The twin forcement is incomplete now, but we're improving but basically no leaks no memory corruption. No garbage collector. No limitations on what you can say. No performance take her gation. This is after or C plus plus and writing is O C plus plus I'm not fan of proprietary extensions. So this is happening. And I think this is what it take
to teach you have to figure out what it is your teach you have to articulate why that is a good thing to do and so cheats for the future you have to live in it and the world shouldn't continuous except once a bloatware probably won't and if we don't Prove somebody else will try and improve it for us and we may very well not like what they come up with. So the proof of the pudding is in the good code and there's a lot of practical stuff like that has to be done. So to do this correct maintainable appropriative
efficient is so sure it will be asleep and we need to work on Cricket on development. If we are in the education business and learn I should build a portfolio not just go for the grades. It's really really hard to get current they students to learn as opposed to swap for the exams. Play that is so not to come to the question area. And I'd like to point out. I know very well that I've not said everything that should be said about the subjects. There are several other things to do with learning training teaching at this conference.
You can go there that's in particular panel tomorrow evening where we are talkin about Chic restaurants in Academia. I'm a panelist and so are a couple of people K questions we have microphones up here, right? Is that one on each side? Please use them because I really can't hear if you don't this is an awfully large room the so many more people in the worst last year and last year was large already. Hey, so the cool guidelines. If you mention them you've mentioned that teaching with them. They quite large as they are and that can be quite a
woman for students to take a look at the Cook Islands directly a how do you recommend an approach in teaching the cool guidelines and getting students to take a look at them first suggest that you read the introduction to the call guidelines that says what's the NY switch. I have the rationale and then look at the philosophy sections pick a couple of those and then pick some relevant rules to focus on SF. You can teach you everything the quote guidelines when not attempting to be. Everything for everybody or should be
minimal. They talkin all that is wish you look at a certain Section 8 does that section is reasonably complete for a lot of people and you may have reputation who won the other area. I don't mind that if we are inconsistent, which we've been repeatedly people find until Us in between it up now. Your colleagues students will not need everything. So you have to make up your mind where to focus and foot begin with with the philosophy that the general understanding of what we're trying to do and then focus on
something important. I don't think we're going to be really successful on that sort of a worldwide scale. Till we have been studying analysis. I want to eliminate dangling pointers. I want guarantees that there's no Dankland point is my coat after that. I can give you a code safety and resource safety and things like that. But first we have to eliminate the bank and point us is a thing that takes static analysis some coding discipline, which is in the rules and some support libraries including
the hearts of the standard library. And so as it is now we're still working on to that but I want to scale this out too. So the full million programmers and she don't do that without chores. You cannot talk your way into that scale and currently I am doing more talking than to torment off tours and that's unfortunate, but we'll get there eventually the team of Microsoft the started out who this is in a way. I think I see Peter sitting down there in the front. Are you guys so I getting onto this Yeah,
see all the places are catching up to I know some projects in in China. I hope to see more and clang tidy. So we need to work to get there and that's what I answer. Your question. People will not have to find the rule the rule will find you you give it the code and it'll drop you on the road which has what is a ruler. Why is the ruler they are? What is an example of why the rule is there? And what do you do instead? That's that's that's where I want to go. I think you should take one from there.
All right, some people would like to see in the standard some solution that work better for beginners. I'm thinking for example of generating random numbers are in the solution we have in the standard library is great for me an expert who can use them. But some people would like just a simple function and you delete weekend deals in the standard because there are different. You know Annie's by different people. So do you think cplusplus could use just a separate library that just adds some of these
Simple Solutions for beginners new string formatting new rent and rent agreement. This is when people keep on doing long after the agreed because they have to be so keen on saying that they agree. That's what I feel. Like now I have been arguing for that for ages. I mean right now is the random number library that every library in a random number Library wants to be when it grows up and as a result people use Rent, and they get really bad results and I think one the stand of committee would do well
to remember that. They should make simple things simple and they should put things in their stand up that that help this very simple random number function something that can compete with with rent should be there and so should say split not because I like split most but that when people come in from java and C shop that's what they try for. They don't understand how to get it out off of Rio strange things like that trip be there. Similarly from the beginners. I
think we should have a guaranteed range check instead of containers and I want that portable crossover limitations, by the way, and you can take the training wheels off later that has something to do with the idea of a package for beginners was teaching undergrads. Asaurus one smart alligator guy, when was a guy but the Women are Smarter who I wants to tell me and or his friends in the class. It's really you don't do Victor and string you have to use pointers Malik because it's more efficient. No,
you shouldn't do that and I would like to stop them from doing it because then they spent the nights debugging stuff that they should have finished at dinner time. And you should find this guy and why are you doing this fish and chips? What Optimizer options do you use and usually the answer is optimizer? Okay, so which which system is using with its peak plan? Which option do you use? I don't know Jesus - 02. Watch - 02 you are talkin about efficiency and you haven't switched on the optimizer. Okay, so seems like that is important
but I think we need a package for beginners and it should definitely have the random numbers. I love random numbers 4-4-4 getting semi-realistic programs to run. There are a few little things in the GSL to Skyline support library that that helps but we hope to put that out of business by putting it into the stand it and that really is helpful professionals as opposed to beginners. It would be nice if it wasn't beginners library and by the way don't cheat don't try and see people today in high schoolers
and Early University without me to pick up Graphics. They don't believe it's real computers and it's hard to do because we don't have that package that just installing this one use this one random is this is this a relatively easy example, I have a support library for my course. It has random like that in it. Thank you. About those packages from the bundles that you propose for beginners and intermediate and advanced those libraries. I mean would get some extra standing. So is that
do you think that should be part of the standard or should be just libraries that are developing a community and then divided into the status of being part of a bundle or do you see that working? Chute is and should be China compared with what's available in the greater world. So the way I imagined this system would be not the standard for packages that Educators or early developers Junior developers could use and I would hope that you come out off the community and there are two things we need for that to do. We need bit
better package and build systems. I know they're being worked on. I'm putting this into encourage people to do nacho to criticize on constructively and we need module so that I can just grab things and be sure they don't interfere with each other. I mean you have something can you include a file and some some idiots? 10 15 years ago Define the macro cord men and your code stopped working and you of course with the Arkham Knight. An Amish what we complete the floor it comes out of nowhere. So I think Target Field systems packages with related field systems and
modulars. Are there any essential for doing good teaching the other things true? I don't see the standards committee doing it. The standards committee is a little bit too friendly in my opinion. You hurt me going on about making sure the simple things simple. It's not the main focus of most people in the committee and so community. So you would see there being options for for like different bundles for say Graphics by briefs or something like that. I'm waving my hands here. It is not a
precise specification. I had a very specific sir situation not too long ago. I was working on a project with my daughter who has a very good aptitude for coding but doesn't know C plus plus we were working on a project abstract abstraction for getting the temperature of the temperature sensor and I gave her a task to do with this and I found that the amount of C plus plus that I needed to teach her would be on with her and she's a college student. So it's not like she has no no attention span, but
it was beyond her attention span with something that is it going to do something concrete. It's going to put some relays going to sell something on the display, but It seems like even the simplest thing requires the first entire semester of C plus plus the to do a major part of the problem and tell him to download the library that makes it easier to use and install it that's beyond them to show. But that's actually the deeper reason I was going on about packaging and Mojo's we can do the
simple clean things simply because we already had the extra. Then we need to replace that. I actually ain't F people who are not CS majors and a lot of our libraries are in the Cs Majors written by and for CS Majors. That's very very limiting. You needs swing set that goes beyond that. I know that's the station in this conference in Friday that I would have gone. So if I had been in town, but I have to be somewhere else. I think that address is something that
the people that are starting with young kids. I actually getting some of the ideas that will apply to novices of all ages and also point out. I'm in love is in many fields most of the time so I'm not being patronising here panda look for something for something like Raspberry Pi is just wonderful. And then that's the metal thing to not look just for kids or what we need to do more and better but I accompany concrete on your exam boards. Did you know you're touching in the middle of a very hot problem? Hey there, I'm
going to switch gears a little bit wrong with him talking about it. I think you just touched on it at the very beginning of your talk to you talked about how your aim is mostly towards students who are going to be professional software engineers and some cents you some software work professionally. How do you feel about programming also just as a way to teach rigorous critical thinking to anybody like how we teach math to everyone not just people working to be Technical and how would that change your aides as a teacher? I think that's important. Traditionally in our culture
abuse mathematics for that and people aren't getting enough mathematics in my opinion. You can do programming as a Farmall concrete and instant feedback form of learning critical thinking learning precise thinking code is very good at hitting back. Where are you sinking in a wooded Manner and for that I think the most important thing is that you don't make it too easy and a particular you don't make it fuzzy that there are a lot of work done so that you can say something you'll do
something. and his it's not too fussy about what it is if what you're wanting to teach is precise scientific thinking precise things. The reason I focused more on the software Developers. What's that's what I noticed. I am very reluctant to say precise things about things. I haven't actually tried myself. And so I mentioned it as an important area, but I think it's an important area that takes some serious work by somebody who is in me. It's not to comments one is on the the guidelines themselves. I think that's probably one of the best things I've seen toward the language
and last two decades a problem though is that I was trying to encourage a section of my company to use it and they happen to be in Germany and they didn't really understand the the Preamble say they didn't get the joke actually about it being in complete and inside that one. Yes. Yes. okay, I mean no, no about Germans looking here. But yes. the Yes, maybe it's time to take that one away. It's a shame that way using in some of the draft at the end of document sending the proposals in SPO. You're right. I may have outlived his purpose and jokes don't travel card surely. I know that and
I think I should talk to you. Thanks. And the one of the difficulties is that I work in a highly regulated industry in the in the medical devices industry and getting GSL to be used as as the library is difficult because there doesn't seem to be any. state of direction as to when it's going to be proposed or entered and so having that guidance there as to no at what level it's going to be proposed into the main standard library or what track is going to be on would be nice, especially since summer or cold food is vintage
Shell Food Code and old sink and that we have to fight in every industry. I work in a highly regulated industry. Well people don't die if we screw up with him a jump out of windows with the same effect when they get ruined so we have some of those problems and we have gotten permission from our Regulators to to to use things like that so it can be done. bought I hope I said it somewhere in the guideline Preamble that we need specific guidelines for specific areas and we just haven't gotten there yet
either still to call guidelines. But if you look for 10 years time, I would expect there would be the medical appendix and the financial appendix that has specific rules. Supports and restrictions suitable for an industry. I know most of us has to worry a lot about the next release in the next quarter. I try reasonably hard to think about so five years 10 years out in the future because it is going to come incrementally from what we're doing today. The call guidelines is it is good and it'll be much better in the future.
But boy do I wish it was moving faster and we have better support and better enforcement and things like that. I guess I'm somewhat impatient with a lot of things works for most things. But it's also nice if there's a single header GSL light one that actually goes back to the more ancient code. So it's a lot of these things work together. I I can't wait till I can say without caveat used concepts for all of your temper documents if you want a fully generic piece of
simple document say so like Define the concept takes everything. And use modules to make sure that you don't get infestation from other people's macros and type this and that works together with the views in the in the call guidelines. There are things that we can do much better with wash in my opinion should have been 17 but not everything can be 17. So let's go for 20 and the guidelines will be better for it. And it's it's from my perspective. It's the same kind of
thinking for getting us to the Future. You'll speaking about how is Libras is important and how writing around linked list is probably not the best idea and I can't agree more but say like 10 years ago. I when I was riding my Fest multiplication, I'm ended my my own Atomic. So the bad news it was excused in production, but the good news is that I learned a lot while doing this and you might have heard they say that your house real problem, or if you I didn't Implement around stream class. So the question is
if we have a generation of software developers who didn't Implement most of basic instructions, but they are all you learn to use radio abstractions and libras. Should we miss something or maybe this is the right way to go. If we don't teach people how to do lower-level software we get at generation of program has only know how to write the light to use the library and that's wrong when I teach people when I teach freshman I teach them how to improve Invicta. because they need to know about pointers and free store and they want Nanny screw up so that they see it
good to encapsulate it and those problems don't happen anymore when I teach later on, I very often have people Design Implement a string so that they can see how it's done. And so I can show them how they could have done it better. So yes, we need to get down tour at least the C plus plus memory model at some point. Otherwise, we teach people magic so you have to get down there somewhere. I thought we agreed that on the other hand. I don't think everybody needs to write a luxury code. If you are a computer science major and if you're
specializing in sort of engineering uses. Yes, you must do that but not everybody but yes, you have to reach some level of abstraction that is good for what you are doing and for computer scientist. I really think they should know how Victor's implemented in some extent and how to string is implemented so they should know how to do the short string up to my station for instance. So send the understand when you teach their students write on the imagine that you have a junior from sample in your company and you see that he is trying to implement some
basic stuff and you tell him don't do this is hold you down get the straight but perhaps he was trying to implement it because he don't actually get how it works and he don't want to be is magic. So it was watching to write it but from educational point of view, it would be convenient to do list. Look at chapters 17 and 18 off the swindle. I have done that for 10 years. That's the director of trying to address your concern for first-year students. People never seen the lineup road before they started chapter 1 so why I don't drift into just to Stratosphere.
It's not what I'm recommending. So you're talking about Raspberry Pi I ended up doing the summer project on one and ended up doing in Python which was nasty. But so with your talk of modules for the Raspberry Pi there's a lot of stuff was saying of I squared see connections for connecting different components saying up the different PW wins on the pins. So would you have liked to module for Raspberry Pi that's specific for the pie or when you get to where you need dedicated facilities to make that Hardware reasonable to use. Yes. And so I would expect once we get modules in the language C
plus plus 20 is what type was not ready for 17. I would hope that the Raspberry Pi would have a basic Raspberry Pi support module. Or something like that would be great cuz it's nothing like you said where it's good to have interfaces and stuff, which python has very simple Windows 98 issue. I know I know and talk about photography yet. I wish I could have done that talk for C plus plus but I got later. Volunteer teaching high school kids there is always a question whether I'll give an example of each operator overloading stuff like that.
So and I'm dishing them like copy Constructor and operator equals. There will always be the student that will ask about move semantics and stuff like that because they are sitting with their laptops. And so how would you go about finding the golden ratio between what's essential to teach them modern stuff, but also not overwhelming. I mean, that's a very very hard question. I don't really know I can I can point to this one book when I had the concrete problem not for high school
students, but Four Freshmen solution, and I think Some of that is is is pretty fundamental. If you're dealing with people want to be software developers. You have to go through the usual stuff. You have to show them. What a loop is. What a function is how to build a class how to use a class and you will eventually chapter 10 get to move semantics and such for high school students to that. One of the problems is that people always read ahead and they want to try something else. That's what I said these people that decided that pointers malakul and they wanted to be the cool kids and
corrupting the others. that's always a problem and I think a good teacher will find a way of handling the students knowing the students and such what you what what what what you can do in preparation is to have the curriculum that provides abstractions that's relevant to what they're doing so that you won't say yeah, you can do that. If you use this one for now. Julie Julie, Julie do you get to bed at a reasonable time? I mean to you really want to stay out past midnight
T-Bone or the time and sometimes when this happen to me if somebody heard of move semantics just when I'm trying to teach them how to write a string out to the well. It's what we'll get to it. They don't like that answer. But sometimes it's the only answer. Otherwise you end up doing bottom-up and we bought them up. You never reach what you want to get there on the time is spent inventing macros for hiding mail off so that you can catch errors and things like that.
You don't want to go there so Trifle suitable abstractions for your people and try and deal with with ports for enough of what part what then happens. We we are over time. So maybe we should stop I will be around today or tomorrow, so she'll try and catch me people screaming out in the back, which is Fast & Suites in minutes or so. I thought I'd like to cut it now. Sorry for you standing up there. Thank you. Fast films future event with multiple cameras link to presentation slides add titles and edit your event live for a full broadcast experience
it to it, you know look at it a lot of ways. What was propilot you a little time to do a profile for it? I'll see exactly what it is. That's making this faster or slower based on the different input when you look at the profile like this. I worked at Sesame Street. I got brought on to be a writer's assistant on a show called Sesame Street English which was to teach English to kids in China and Japan. It seems very simple the shows that they put together but it's it's actually really hard to design a show
that is not only for young kids, but also the parents. Compassion like this is therapeutic. I hope you all get something out of this. But if you don't the therapy will be good for me. So thank you seven years ago. I was working. I wasn't working for my previous employer with was large multinational anything what was up to that point the worst day of my career and then came the anger anger at ourselves because we knew we were responsible for America's first space disaster. We were out to more words into our vocabularies mission controllers
responsibilities because we are forever accountable for what we do, that will never again take anything for granted. We will never stop learning from now on the teams in Mission Control will be perfect because as a team, we must never fail one of the things we're all in a very fortunate position. We've been very lucky in our lives and so forth and I think is part of the mission. It's also good sometimes take that fortune and give back. Make sure you take a platform
the music Forest were the fathers. That's good karma. That's good stuff in the universe your organization. Please email or call us directly to discuss your particular event. We look forward to discussing your goals and helping make your event a success.
Buy this talk
Доступ ко всем записям докладов мероприятия
Buy this video
With ConferenceCast.tv, you get access to our library of the world's best conference talks.