Bjarne Stroustrup: Learn More than One Programming Language

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
you've you've said that it's good for any professional programmer to know at least five languages speaking about a variety of languages that you've taken inspiration from and you've listed the yours as being at least at the time C++ obviously Java Python Ruby and JavaScript can you first of all update that list modify it you don't have to be constrained to just five but can you describe what you picked up also from each of these languages how you see them as inspirations for even you're working with C++ this is a very hard question to answer so about languages you should know languages I I reckon I knew about 25 or thereabouts when I did C++ it was easy in those days because the languages were smaller and you didn't have to learn a whole programming environment and such to do it you you could learn the language quite easily and it's good to learn so many languages and I imagine just like with natural language for communication there's different paradigms that emerge in all of them yeah but there's commonalities and so on so I picked five out of ahead big five out of a hat obviously the important thing that the number is not one that's right it's like I don't like I mean if you're mono clot you are likely to think that your own cultures the only ones pair is everybody else's a good learning of a foreign language and a foreign culture is important it helps you think and be a better person with programming languages you become a better programmer better designer with the second language now once you've got to the weight of five is not that long it's the second one that's most important and then when I had to pick five I sort of thinking what kinds of languages are there well there's a really low level stuff it's good it's actually good to know machine code movie very still sorry even today even today the C++ optimizer is right there a machine code than I do yes but I don't think I could appreciate them if I actually didn't understand machine code and machine architecture at least in in my position I have to understand a bit of it because you mess up the cache and you're off in performance by a factor of 100 right shouldn't be that if you are interested in higher performance or the size of the computer you have to deploy so so I would go as a simpler I used to mention C but these days going low-level is not actually what gives you the performance it is to express your ideas so cleanly that you can think about it and the optimizer can understand what you're up to my favourite way of optimizing these days is to throw out the clever bits and see if it's dawn runs fast and sometimes it runs faster so I need the abstraction mechanisms or something like C++ to write compact high-performance code there was a beautiful keynote by Jason Turner at the CPP Khan a couple of years ago where he decided he was going to program pong on Motorola 6800 I think it was and he says well this is relevant because it looks like a microcontroller it has specialized hardware it has not very much memory and it's relatively slow and so he shows in real time how he writes pong starting with fairly straightforward low-level stuff improving his abstractions and what he's doing he's writing C++ and it translate into in 286 assembler which you can do with playing and you can see it in real-time it's the compiler Explorer which you can use on the web and then he wrote a little program that translated 86 assembler into Motorola has simpler and so he types and you can see this thing in real time while you can see it in real time and even if you can't read the assembly code you can just see it his code gets better the code the assembler gets Kamala he increases the abstraction level uses C++ 11 as it were better this code gets clean that get easier maintain the code shrinks and it keeps shrinking and I could not in any reasonable amount of time write that a simpler as good as the compiler generated from really quite nice modern C++ and I'll go as far as to say the the thing that looked like C was significantly uglier and smaller when it becames and and larger when it became machine code so what the the abstractions that can be optimized important I would love to see that kind of visualization larger code bases yeah there might be blood a few can't show a larger code base in a one-hour talk and to have it fit on the screen right so that C is if you are so my two languages would be machine code and C++ and then I think you can learn a lot from the functional languages so pig has pralaya male I don't care which I think actually you you'll you'll learn the same lessons of expressing especially mathematical notions really clearly and having the type system that's really strict and then you should probably have a language for sort of quickly churning out something you could pick JavaScript you could be Pig Python you could pick Ruby you
Info
Channel: Lex Fridman
Views: 136,730
Rating: undefined out of 5
Keywords: c++, c++20, c++ concepts, c++ basics, c++ standards, c++17, c++14, c++11, c++0x, zero-overhead principle, bjarne stroustrup, artificial intelligence, ai, ai podcast, artificial intelligence podcast, lex clips, lex fridman, lex podcast, lex mit, lex ai, mit ai, ai podcast clips, ai clips
Id: 5An1sNznblQ
Channel Id: undefined
Length: 6min 56sec (416 seconds)
Published: Sun Nov 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.