Back to Basics: Object-Oriented Programming in C++ - Amir Kirsh - CppCon 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024

ความคิดเห็น • 20

  • @alidanish6303
    @alidanish6303 ปีที่แล้ว +3

    Marvelous job done by Amir, In inheritance he is explaining a subtle concept of keeping OO performant, especially with state pattern. I am already thanking him for real thought behind state pattern.

    • @Nikage23
      @Nikage23 9 หลายเดือนก่อน

      For quite a long time I thought of a state pattern as something that is quite verbose and to be used in "complex" frameworks and/or libraries whatever. But now it makes so much more sense to me to use it my daily code.

  • @Nikage23
    @Nikage23 9 หลายเดือนก่อน

    One of the best OO talks/resources I've ever seen so far. Simple yet powerful in some sense. Absolute gem.

    • @rinket7779
      @rinket7779 8 หลายเดือนก่อน

      Really? I'm half way in and it's nothing to do with Oop, just general cpp knowledge about construction and destruction.

  • @TheJackal917
    @TheJackal917 ปีที่แล้ว +6

    Is this for begginers or uberadvanced stuff for no less than phds?

  • @timog7358
    @timog7358 2 หลายเดือนก่อน

    brilliant

  • @flocela
    @flocela 11 หลายเดือนก่อน +1

    That was a damn good talk.

  • @mertsezqin19
    @mertsezqin19 ปีที่แล้ว

    Excellent video.

  • @zxuiji
    @zxuiji ปีที่แล้ว

    54:55, Alternative more reliable solution:
    class Pet
    {
    ...
    Pet( PetType &type ) { ... }
    operator= ( PetType &type ) { ... }
    ...
    }
    If they make the mistake of using the pet type as a pet the managing class should just accept it and construct itself with empty data or override an existing type

  • @zxuiji
    @zxuiji ปีที่แล้ว

    12:00, Wouldn't it better if the compiler just assumes initialisation to 0 is fine unless it finds a matching constructor for what is presented to it, for instance:
    class X
    {
    char const* m_say;
    public:
    X( char const*say ) { m_say = say; }
    char const* talk() { return m_say; }
    };
    ...
    X a = X("Hello world!"), b = X();
    puts( a.talk() );
    puts( b.talk() ? b.talk() : "(null)" );
    Would produce:
    Hello world!
    (null)
    While this:
    class X
    {
    char const* m_say;
    public:
    X() { m_say = "Goodbye :)"; }
    X( char const* say ) { m_say = say; }
    char const* talk() { return m_say; }
    };
    ...
    X a = X("Hello world!"), b = X();
    puts( a.talk() );
    puts( b.talk() ? b.talk() : "(null)" );
    Would produce:
    Hello world!
    Goodbye :)

  • @zeez7777
    @zeez7777 4 หลายเดือนก่อน

    24:39 Why would i want to lock a mutex in a method that is const? Wouldn't that be a read only operation by default which does not need synchronization?

    • @timog7358
      @timog7358 2 หลายเดือนก่อน

      you dont want the value to change while you are reading it

  • @zxuiji
    @zxuiji ปีที่แล้ว +1

    32:25, if you're bringing culture into it then in japan cats would go nya, not meow

  • @eddyecko94
    @eddyecko94 ปีที่แล้ว

    I’m I able to access these slides? He has a reference concerning “padding” at 7:20 which I’ll like to read more about

    • @amirkirsh8556
      @amirkirsh8556 ปีที่แล้ว +2

      Here it is:
      docs.google.com/presentation/d/1t7dhyXHfFfNEEiUSC6rhznyKXkThcLQhlQJdv57M7mI/edit?usp=sharing

  • @zxuiji
    @zxuiji ปีที่แล้ว +1

    37:00, bad example as all squares are rectangles but not all rectangles are squares which means square would inherit from rectangle

  • @MalcolmParsons
    @MalcolmParsons ปีที่แล้ว +1

    No mention of class invariants.
    Does not mention that members should be public if there are no invariants.
    Has a Point class with private members, even though there are no invariants.

  • @kevinzebb
    @kevinzebb ปีที่แล้ว +1

    Guy speaks too fast, that thick accent doesn’t help either.

    • @nin3se
      @nin3se ปีที่แล้ว +3

      I had no problems listening to him at x1.5 speed