En 30 segundos
Stroustrup argues that a second language can change how programmers think and that clear abstractions can coexist with efficient code.
- 1The second languageThe number matters less than broadening perspective.
- 2Know the machineArchitecture can affect performance.
- 3Clear abstractionsReadable code can also optimize well.
- 4Different paradigmsFunctional and rapid-development languages offer different lessons.
Conclusiones
- Learn more than one programming language.
- Understand architecture when performance matters.
- Clear abstractions can help optimization.
Lee el texto editado por capítulos
More than one language
Lex Fridman asks C++ creator Bjarne Stroustrup why programmers should learn several languages and what they can take from different traditions.
Lex Fridman asks C++ creator Bjarne Stroustrup why programmers should learn several languages and what they can take from different traditions.
Stroustrup recalls knowing many languages when he developed C++. He says languages were smaller then, and learning them did not always require mastering a large programming environment.
He stresses that the exact number is less important than knowing more than one language. As with learning a foreign language, a second programming language can reveal assumptions and broaden how one thinks.
Architecture and performance
Stroustrup says the second language is particularly valuable; after that, learning further languages can be easier. He also values understanding machine code and architecture.
Stroustrup says the second language is particularly valuable; after that, learning further languages can be easier. He also values understanding machine code and architecture.
He notes that performance can depend on architectural details such as caching. Understanding the machine can help programmers reason about high-performance code.
Abstraction and optimization
For modern C++, he argues that expressing ideas clearly can help both the programmer and the optimizer. Sometimes removing clever code produces a faster result.
For modern C++, he argues that expressing ideas clearly can help both the programmer and the optimizer. Sometimes removing clever code produces a faster result.
He recalls a Jason Turner presentation using a small Pong implementation to demonstrate changes in source abstractions and generated assembly.
In Stroustrup’s account, the source became clearer while the generated code became smaller. He uses this example to argue that useful abstractions and efficient output can coexist.
Other paradigms
Beyond machine code and C++, he recommends trying a functional language to learn precise expression and strong type systems, and a language suited to building something quickly, such as Python, Ruby or JavaScript.
Beyond machine code and C++, he recommends trying a functional language to learn precise expression and strong type systems, and a language suited to building something quickly, such as Python, Ruby or JavaScript.
Más de este canal
3:34:27EN
3:36:56EN
5:15:51EN
3:12:58EN
3:46:18EN
3:51:47EN