Back to Basics: Object-Oriented Programming - Rainer Grimm - CppCon 2021

preview_player
Показать описание
---
C++ is an object-oriented programming (OOP) language but also supports generic and functional features. OOP is a potent tool when used wisely. Let me present you the good parts.

You can design intuitive classes, which encapsulate its internals and allow restricted access. Further, inheritance applied appropriately enables you to build libraries or frameworks that are easy to use and difficult to misuse. The hidden source is the separation of interface and implementation. You can apply "Lesson Learned" from the best and implement design patterns using OOP techniques.

Learn in my lecture the appropriate use of the keywords virtual, override, and final. Learn when you should build a class hierarchy to separate the interface from the implementation. Besides interface inheritance, you can also use implementation inheritance. Learn to distinguish between those.
During this lecture, I also present a few design patterns as examples of good object-oriented design.

---
Rainer Grimm

---

Рекомендации по теме
Комментарии
Автор

Good talk. One point: godbolt does not lend easily for video presentations. Its not easy to follow the points when you watch through the video. Taking the snippets outside and/or sharing the godbolt links can help.

rude_broccoli
Автор

I'd be great to have the script available

alfaalfa
Автор

25:10 "Look at this picture. I think it makes it quite clear." 🙂 Rainer is great, but either he or cppcon misunderstand the concept of 'basics'.
I don't know if cppcon wants to target c++ beginners, or relative beginners who are sufficiently far along that they might attend cppcon.

It's difficult. You want an experienced person, because they should have a good mental overview of the subject matter - but you also want a presenter who is still in touch with the beginner's mind-set. I think this video would be quite a mish-mash for a beginner. They probably need less material and more structure.

pmcgee
Автор

With full respect to author. From my experience (I have wrote around 2 millions lines of code in high tech) - over reuse of design patterns is the worst thing ever. It’s fine to use in my experience one design patter roughly speaking maybe 1 for 1K lines of code, but when all program start be complete of design patterns - it’s unreadable, and it’s not effective. My vision is that you need to be aware of them, but please use them rarely. The goal of program provide effective algorithms but not 1000 design patterns for 5000 lines of code ;) p.s. Excellent talk, and let’s not forget what Edger Dejkstra said about OOP.

konstantinburlachenko
Автор

Well, Smalltalk had no classes initially (see Smalltalk 72), yet it *was* an OO language. Same for Self. 2:16 is arguable.

alskidan
Автор

In my opinion, talks like this are harmful. They harm C++ and OOP/OOD. I do understand that what's being shown is "slideware", but hear me out: one can find a better toy project to show case OOP and C++ in a handful of slides. Pong game is one such good example.

*The reason why this talk is harmful.*
This talk is for beginners. If that's the case, a novice programmer may not have the taste/knowledge to understand that polymorphic Sort hierarchy is nonsense. This talk introduces a novice programmer to a world of C++98 with raw pointers, classes for the sake of classes, and polymorphism overdose.

alskidan
Автор

Such great content, but fonts are small when actual codes are shown. Please, Sir do make the necessary changes in fonts for Mobile viewers. Thanks.

saipan