The Only Time You Should Use Polymorphism

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 674

  • @Adam-326
    @Adam-326 8 місяців тому +450

    He randomly came back after three years! Tak! Good to see you again.

    • @rafael.aloizio1769
      @rafael.aloizio1769 8 місяців тому +11

      Yessssss I'm glad he is back man, I've learned so many things important on my career because of his videos

    • @danielszlicht2633
      @danielszlicht2633 8 місяців тому

      Love him, jest super

    • @pulkitprajapat7862
      @pulkitprajapat7862 8 місяців тому +5

      OMG I can't believe this, I asked him last week on Twitter when he is coming back..and here he is. 🐐

    • @mr_archanger
      @mr_archanger 8 місяців тому +5

      What are the chances he’ll stay with us for some time now 😅

    • @pabloescobarparis6586
      @pabloescobarparis6586 8 місяців тому +5

      @@mr_archangerdepends if project manager leaves him alone

  • @أحمدعمارنقودي
    @أحمدعمارنقودي 8 місяців тому +315

    Finally he remembered his password

  • @Pawemie
    @Pawemie 8 місяців тому +47

    I like to think, that you got so annoyed by someone at work using subtype polymorphism the wrong way, that it brought you back here ;)

    • @ChristopherOkhravi
      @ChristopherOkhravi  8 місяців тому +24

      I teach at a university so I read a lot of student code 😉

    • @tony2351992
      @tony2351992 8 місяців тому +4

      in which university do you teach I need to attend there, you're a CS legend
      @@ChristopherOkhravi

    • @BANANAS2011
      @BANANAS2011 7 місяців тому

      I wish more people in your team do things in wrong way that you make more videos to teach others 😂

  • @EricFreedmanMusic
    @EricFreedmanMusic 8 місяців тому +51

    literally just watched your design patten playlist, thinking why hasn't he posted for 3 years. perfect timing

  • @arminium56
    @arminium56 8 місяців тому +39

    Man, your notification popping up is the best thing happened in months❤, please don't disappear again :)

  • @williamcory4689
    @williamcory4689 8 місяців тому +18

    Welcome back! Got a huge amount of value out of this channel in my early days of becoming a dev

  • @culturemanoftheages
    @culturemanoftheages 8 місяців тому +7

    I've never been more engaged with software engineering UA-cam content. Your presentation skills are excellent.

  • @TazG2000
    @TazG2000 8 місяців тому +2

    I would add a point that "variations in behavior" can also come from _outside_ the class - a class can just be a data type, without being responsible for all the ways the data will be used. Imagine an Attack subtype, EnergyAttack, which has an additional property EnergyType. Now Scratch is a base Attack instance, and Thunderbolt is an EnergyAttack (with EnergyType = Lightning). Looking at just the class definitions, you could say this is a data-only variation, but it makes sense because the change is in the data structure (an additional property), not just values. These subclasses may or may not implement variations in behavior themselves, but _allow for_ external variations by being different types: We may have many general functions that work with the Attack type, as well as some functions that accept EnergyAttack specifically and work with the EnergyType property.

  • @andreaskonomis3
    @andreaskonomis3 8 місяців тому +39

    Have been watching your Design Patterns series and the code walks videos and was always thinking if I ever wanted to have a youtube channel it would have been of this style. If only he was back. Wish granted, welcome back, so happy to see notifications from you! :DDDD

  • @davidntumba2447
    @davidntumba2447 8 місяців тому +19

    I didnt even fully read the title, I just saw the thumbnail and clicked. Welcome back good sir.

  • @dhruvachandra8210
    @dhruvachandra8210 8 місяців тому +46

    Suddenly you appeared out of thin air, please be consistent. Love your content.

    • @maximus1172
      @maximus1172 8 місяців тому +6

      No one told you to wait

    • @maxpricefield7586
      @maxpricefield7586 8 місяців тому +3

      we aint entitled to his time

    • @bakaoug4g491
      @bakaoug4g491 8 місяців тому +1

      He can post whenever he feels like posting. How entitled are you. Anyway thanks for the content ignore comment like above

  • @sam_musey
    @sam_musey 8 місяців тому +4

    I came to the comments section to share my excitement about your return.
    But, wow, I didn't expect there to be so many of us!

  • @mohamedsayed8697
    @mohamedsayed8697 8 місяців тому +3

    Oh my god. I used to watch your videos when I started learning programming in 2021. Right now, I have an interview with Google scheduled next week. You don't know how happy I am to see you back. Thanks for coming and welcome back :)

  • @drewbruggman
    @drewbruggman 8 місяців тому +3

    I didn't learn anything, but the way you described the information in the video *clarified* what I'd already known -if that makes sense.
    You are excellent at explaining things in very clear terms, and I appreciate that. Subbed.

    • @ChristopherOkhravi
      @ChristopherOkhravi  8 місяців тому

      I'm very happy to hear that. Also, thank you for the sub. Welcome 😊

  • @kiranmahajan9067
    @kiranmahajan9067 8 місяців тому +8

    Your teaching is the greatest and simpler....❤

  • @rizwanfirdous
    @rizwanfirdous 8 місяців тому +3

    Last month i was discussing with my friend about Design patterns and in that discussion i recommended him your channel. While discussing i said to him that don't know why you aren't posting any content. I was little bit worried about you. Now i am very glad to see you back. 🥳🥳🎉🎉❤❤❤

  • @barisaxo
    @barisaxo 8 місяців тому +4

    I've been watching your playlists whilst working on my project over the last year, and this video is so relevant to what I'm currently working on, and exactly what I've been asking myself while working on my current systems. Being self taught I don't know the theory very well, so I would had never known that I was dealing with 'sub-type polymorphism'. Good to know I've been going down the right path, and also to know what it's called!

  • @Flutterdev6391
    @Flutterdev6391 8 місяців тому +2

    I watch your videos and you are the first teacher whoes course i can buy without thinking about money.

  • @CarlRoa
    @CarlRoa 8 місяців тому +7

    Awesome to see you back Chris! I’ve learned a lot from your videos, and have always enjoyed hearing your perspective on things. 😎👍

  • @securethebag1613
    @securethebag1613 8 місяців тому +1

    Word to mother....ur design patterns videos helped me nail an interview in 2017 🤣🤣🤣. Now I'm a Lead software engineer. Thanks

  • @Ruzi1996
    @Ruzi1996 8 місяців тому +1

    I started watching him on thursday, fell in love in his way of teaching, and was thrilled when saw that last video was posted 3 years ago. And now he appears out of nowhere 😂 If you were giving lectures on my Uni, i wouldnt miss a single one

  • @NoahNobody
    @NoahNobody 8 місяців тому +1

    I like this format. My ADD was trying its best to block the info, but this guy just kept going :)

  • @arteqppp6223
    @arteqppp6223 8 місяців тому +1

    Your knowledge is actually so precious. I love the fact that you just use concepts with whiteboard. Thank You for coming back to us, You can make a lot of us promote with your videos!

  • @TruthAndLoyalty
    @TruthAndLoyalty 8 місяців тому +2

    Good stuff. There are solutions without subtypes though.
    1. The example as stated could have `Move` that accepts a `name` as well as the individual effects.
    `new Move(name, healthEffect, armorEffect)`
    So attack would be `new Move('attack', -50, 0)`
    I'd only start packing in parameters in a language with named parameters though.
    2. You could have a method to add effects to a move as a fluent interface
    `addEffect(property, amount)`
    `new Move('heal').addEffect('health', 50).addEffect('armor`, 50).
    `Use` would just apply those effects to the target. Of course you'd need to do something about validating target properties.
    3. Still polymorphic, but passing a `use` function to the constructor of a `Move` class
    `new Move('attack', attackFunction) keeps your class hierarchy flat and allows you to define any behavior you want in the passed function. Do we really need an interface and subclasses? Maybe. Maybe not.
    Different behavior is just the first condition. For the subtype with polymorphism solution, that behavior has to be complex enough that it's simpler to extend. Class hierarchies add overhead / cognitive load. You need to be gaining enough from the strategy to offset that. This depends on a lot of things. The behaviors, how broad the set needs to be, how its expected to grow, even the language you're writing.

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p 8 місяців тому

      Yeah, like, I think I'd just declare a simple struct with the effect data and pass it in, and expand it as things go (including "no effect" defaults so things don't break). If it does grow enough that this gets cumbersome, by then I'd have a better picture of what actually matters.
      Probably would still avoid subclasses tho : p

  • @rickydownload
    @rickydownload 8 місяців тому +1

    From last week I started watching your Design Pattern playlist and thinking why Chris stopped posting videos for last 3 years. To my surprise there was a notification😮. Your teaching is so great and natural, not everyone gets so easily. Keep up the Great work!

  • @maurobastasini8704
    @maurobastasini8704 8 місяців тому +4

    Great to see you again Christopher. Miss your videos of design patterns and discussions about principles. Welcome Back!!

  • @EmpySoul
    @EmpySoul 7 місяців тому

    Once again, you enlightened me about something that might seen implicitly known and simple but in reality a truly good software engineer needs to be absolute aware of.

  • @vivekvishwakarma3711
    @vivekvishwakarma3711 8 місяців тому +2

    Happy to see you upload after 3 years love the way you teach..

  • @RajivKumar-qj9nw
    @RajivKumar-qj9nw 8 місяців тому

    So happy to see you back. You're the sole educator whose UA-cam videos I choose to view at regular speed, even when they extend to an hour.

  • @Ragnarok540
    @Ragnarok540 8 місяців тому

    Thanks for your work, I got a masters in software engineering 2 years ago and your videos on the design patterns really helped me.

  • @ripanpramanick425
    @ripanpramanick425 8 місяців тому +2

    Your Design pattern playlist is the best I have ever seen on any channel/courses. It was about a year ago I started and completed the DP videos, but was disappointed to see no more , and randomly today this video pops up on my feed, very happy to see you again hopefully you will complete the rest of the patterns too 😊. I tried connecting you on LinkedIn too but it was restricted I think 😅.

  • @muhammadhamzashujaat6767
    @muhammadhamzashujaat6767 8 місяців тому +1

    Love to see you again, I look forward to rewatching as much of your videos as possible !

  • @no-name2031
    @no-name2031 8 місяців тому +7

    The man, the legend, welcome back

  • @nonickname1231
    @nonickname1231 8 місяців тому

    Previously, thank you for the knowledge, and welcome back.
    What I get from the explanation is:
    We should/must prefer to be implicit about a specific type of data that has the same structure and behavior, instead of being explicit (where we define it based on the actual concept or domain) about that type (CMIW).

  • @echoes675
    @echoes675 8 місяців тому +2

    Best notification from UA-cam in ages. I hope you've got more for us. 100% my favourite videos covering software development!

  • @r1konTheAutomator
    @r1konTheAutomator 8 місяців тому +1

    WHOA! i started watching your pattern videos like a week ago, binging them while at the gym, while taking walks, etc. i was like "eh it's been a long time since hes posted...he was a good teacher" and then here you are!!

  • @shreyshrivastava
    @shreyshrivastava 8 місяців тому

    I don't have words to describe how happy I am to see you back.. Love your style of teaching

  • @chirayumishra1185
    @chirayumishra1185 8 місяців тому +2

    Welcome back Christopher. Good to see you back 😊 Keep up the good work and make learning fun and easy. All power and good wishes ❤

  • @himanshugoyal3862
    @himanshugoyal3862 8 місяців тому +2

    The king of Design patterns is back🔥

  • @artemisSystem
    @artemisSystem 8 місяців тому +4

    Whoa, seeing you in my sub box is not something i expected today. Long time viewer of the channel, since the ramda days! Good to see you back.
    Your channel helped me get into functional programming, and now i'm absolutely obsessed. Do you have any plans for more FP related videos?

  • @RS-so7ke
    @RS-so7ke 8 місяців тому +1

    Its always better to create a video for a problem than to create one for a video. Thank you for this video, polymorphism is used very frequently without much thought given 😢

    • @ChristopherOkhravi
      @ChristopherOkhravi  8 місяців тому +1

      Very interesting. Thank you very much for formulating that. I will try to keep it in mind moving forward. 🙏

  • @georgesealy4706
    @georgesealy4706 8 місяців тому

    Good video. I retired from software development years ago. I wrote some fairly complex systems and I used polymorphism at times. Much of it had to do with the implementation of corporate business rules. An example was doing 'credit checks' of customers. The calling system simply wanted a 'yes/no' credit check. However, HOW the credit check was executed was different depending on the kind of customer being checked. There were many different kinds of customers with different histories. The company had different rules and methods for each. Some required a simple database lookup while others required remote access to third-party systems. Using polymorphism the different rules could be independently developed and "bolted on" to the system. So as per your terminology this was very much different behavior.

  • @Богдан-к1э2д
    @Богдан-к1э2д 8 місяців тому +1

    - Welcome back! I was waiting for you.
    - After all this time?
    - Always

  • @Jeff-xh4sy
    @Jeff-xh4sy 8 місяців тому +1

    I used your design pattern videos to pass my cs class last term and here you are again lol

  • @Michaeljamieson10
    @Michaeljamieson10 8 місяців тому +1

    please continue have been rewatching your old stuff so glad to see this

  • @rammehar5531
    @rammehar5531 8 місяців тому

    Thanks bro for saying "differences in behaviour not data". It changed my approach towards polymorphism. Thanks again

  • @vikaspanwar624
    @vikaspanwar624 8 місяців тому

    I was literally googling for your name yesterday to know what are you up to these days and suddenly your new video pops up after 3 years. Thank you for sharing knowledge with us. You’re an amazing teacher!

  • @henrikorpela2818
    @henrikorpela2818 8 місяців тому

    This video may offer the best explanation I've seen for why subtyping via inheritance is problematic. Thanks!

  • @pattferraggi
    @pattferraggi 8 місяців тому

    I was trying to quit watching UA-cam but now I know it's not gonna happen. I am so happy you are back 😅

  • @gavinlangley8411
    @gavinlangley8411 8 місяців тому

    Once you separate models from behaviour classes (highly recommended) this issue is then about model abstractions. Model abstraction can be handled with composition rather than inheritance. Behaviour abstractions occur everywhere of course, you have many things that can do the same job. The question then becomes, does a model abstraction add any value to my behaviours? Model composition is still fragile, model interfaces will be more stable. If your code operates on disparate models you need it or mappers (a behaviour form of an interface!). If I define a feature for my app I can expose the interface that I expect to make my component completely self contained. If I write templates or generics it's normal to have a requirement of your that is an interface. The design consideration is a good one, it highlight lots of bad designs, but you haven't come full circle yet!

    • @djyotta
      @djyotta 8 місяців тому

      The idea that composition is better than inheritance must come from those with minds to small to comprehend inheritance.

    • @gavinlangley8411
      @gavinlangley8411 8 місяців тому

      @@djyotta you must be proud of such a high IQ comment, why not stay on topic and explain your opinion? Maybe there's not an intelligent one in there?

  • @wBkSlayer
    @wBkSlayer 8 місяців тому +2

    Holy shit. You're back. And the beard is ever so magnificent. Don't you dare disappear for such a long time again.

  • @maayanzar
    @maayanzar 8 місяців тому +2

    Wow man, so glad to see u again, you are an amazing teacher, please keep the quality content😊

  • @ChrisCarlos64
    @ChrisCarlos64 8 місяців тому +1

    I did not expect to see this in 2024, but I'm glad to see you're back. 😁

  • @felixjonsson4471
    @felixjonsson4471 8 місяців тому +1

    omg great to see u again! Ur videos has helped me tremendously during my time at chalmers, and im actually now TEACHING the same course i used ur videos to pass years before! Will recommend ur channel to all my students!

  • @dgrave3
    @dgrave3 8 місяців тому

    Please don't disappear now my comment is to let you know you are gem, and the contents you present are just amazing. Many love ❤️❤❤. Please continue

  • @circulardep
    @circulardep 8 місяців тому

    Kul att se att du är tillbaka igen! Dina förklaringar av designmönster hjälpte mig enormt under skoltiden. 👍
    Man önskade att fler lärare var såhär pedagogiska.

  • @JeffJennings82
    @JeffJennings82 8 місяців тому

    I am determined to watch this video as many times as it takes to understand what he is talking about. 10 times later, maybe I should watch a refresher on polymorphism.

  • @KlamerR69
    @KlamerR69 8 місяців тому +1

    Welcome baaaaack!!!!!!!!! Happy to see you around after so much time! Hope you'll stay for a while, your content and way of explaining things are precious.

  • @shaunhunterit342
    @shaunhunterit342 8 місяців тому

    I didn't realise you hadn't posted for three years! I've been taking a break from coding but had to watch this video! Please keep posting!

  • @zakayothuku
    @zakayothuku 8 місяців тому +1

    He's alive!!! Glad to have you back!

  • @ZedanMohamed99
    @ZedanMohamed99 8 місяців тому +1

    my man still alive, good to see you again

  • @iagoh.moreira5253
    @iagoh.moreira5253 8 місяців тому

    IDK how this guy got into my recommendations, but, I loved this channel!

  • @codewithmert
    @codewithmert 8 місяців тому

    Thanks for sharing your valuable knowledge again. Your videos about design patterns helped me a lot when I landed my first job as a software developer. I hope 🤞 you don’t give a break anymore 😊

  • @mobasherfasihi690
    @mobasherfasihi690 6 місяців тому

    Glad that see you again, hope I can see another series also before I die. But high quality takes times, I'm really enjoying when watching your videos.

  • @benjones1452
    @benjones1452 8 місяців тому

    Welcome back, I have missed your content, it is great. Your analysis has been vital to my programming evolution, if only I'd have had teachers with your energy.

  • @brentchance1589
    @brentchance1589 8 місяців тому

    First time I've seen the use case for polymorphism clearly delineated. Great job. Very useful.

  • @chetanchopra1475
    @chetanchopra1475 8 місяців тому

    Your teaching is simpler and also in depth, good to see you back on youtube. Please create more good quality content !!

  • @kostasgkoutis8534
    @kostasgkoutis8534 8 місяців тому +2

    It all depends if you need to lift data to the type level. If Thunderbolt and Scratch are "dummy data" or "metadata" (basically hold no meaning) for your application, then sure, represent them through the Attack class. If your application does or will variate its behavior based on one or the other, expressing them as types might be advantageous. But I can still see teams deciding to go with conditionals and not introducing explicit types (if, e.g., the types introduced are not actually stable in the long term).

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p 8 місяців тому +1

      Another point is that if you can treat moves as data then you can also easily load them in (possibly even hot-load them in), so changing a move's behavior during development, balancing, testing, etc, can be as easy as changing a value in, say, a json file, which is just so convenient.

  • @tomthetitan101
    @tomthetitan101 7 місяців тому

    This is one of the most engaging software videos I've ever seen

  • @johnny5gr
    @johnny5gr 8 місяців тому +1

    Awesome points on polymorphism. Never thought that. Thanks. Really helpful.

  • @archindar5665
    @archindar5665 8 місяців тому

    you did really well with this video, i was able to flip into it and out of it, while just listening and you never lost me. i now know what you put into this video and thats always nice!

  • @noeldionisioparedescuevas5992
    @noeldionisioparedescuevas5992 8 місяців тому +3

    We miss your valuable teach.

  • @liquidpebbles
    @liquidpebbles 8 місяців тому

    Glad UA-cam was smart enough to recommend your video. Glad to see you posting. Always top notch stuff.

  • @yanndetaf5725
    @yanndetaf5725 8 місяців тому +1

    I really missed you. Welcome back Christopher

  • @nullset11
    @nullset11 8 місяців тому

    Glad to see you're back uploading videos! Your series on design patterns were instrumental in taking another step in my career!

  • @robertpiosik93
    @robertpiosik93 8 місяців тому +1

    I don't believe to be here in 48 minutes from publication. Been thinking about you lately

  • @sergtachini
    @sergtachini 7 місяців тому

    Yes, I completely agree that you should use polymorphism when dealing with varying behaviors. However, if you need variations in data and want to limit the number of such variants, you can employ the factory method pattern.
    For instance, you can create a class called Attack with a private constructor. Then, add two static methods-thunderbolt and scratch-to control the initialization and ensure that no incorrect variants are created.

  • @mohamedsalama2503
    @mohamedsalama2503 8 місяців тому +1

    Welcome Back, Great to see you after 3 years :D

  • @andresgoens
    @andresgoens 8 місяців тому

    got randomly recommended this by the youtube algorithm, thought it was going to be about types because of the title (as in, type theory), but it seems to be about some object oriented language (not even clear which one), but was interesting to watch!

  • @nkramachandran8500
    @nkramachandran8500 8 місяців тому +1

    Legend is backkk!!! Good to see you, your system design videos are epic!! MASSIVE THANKS

  • @RyanCortino
    @RyanCortino 8 місяців тому

    Man, I was so happy to see your face in my feed again. Glad to have you back, your videos always helped me understand these concepts so much better.

  • @misetro12345
    @misetro12345 8 місяців тому

    Where were u man. I recently found(1.5 weeks ago) ur channel and always thought wht happened to this guy becoz u r such a good teacher .Last video ws 3 yrs ago. I then started studying design patterns using ur videos. I completed 15 of it going to complete it by tomorrow and u came back. I think u were waiting for me to complete 15 videos😂

  • @UnTizioACaso1
    @UnTizioACaso1 8 місяців тому +1

    I missed your videos, thanks for coming back!

  • @muntder1435
    @muntder1435 8 місяців тому +1

    it's been a very long time, nice to see again man!!

  • @bryanscheetz2850
    @bryanscheetz2850 8 місяців тому

    Welcome back! Your videos helped me a ton while getting my degree - good to see you're still at it!

  • @eladfeldman1152
    @eladfeldman1152 8 місяців тому +1

    happy to see you are back! keep the content coming! learning a lot.|
    love the whiteboard, the editing and the why you teach :)

  • @dkvvit
    @dkvvit 8 місяців тому

    Good to see you after 3 years. I love the way you teach.

  • @xusoft206
    @xusoft206 8 місяців тому

    OMG what a surprise having you back! I still paying my bills thanks to you man ❣

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 8 місяців тому

    Welcome back! Please upload more videos on system design and LLD. We appreciate your effort!

  • @ivankulaga5516
    @ivankulaga5516 8 місяців тому

    Oh hey look who's back! Thanks for the video! Ur gof patterns videos helped me a ton a few years back

  • @kB-hg2ci
    @kB-hg2ci 8 місяців тому +1

    Where the hell have you been all this time, we missed you.

  • @PbPomper
    @PbPomper 8 місяців тому

    I've really missed these talks. Welcome back!

  • @MewMewCherry1990
    @MewMewCherry1990 8 місяців тому +1

    Finally! Didn't expect that. 3 years of silence

  • @ppercipio
    @ppercipio 8 місяців тому

    This is the first video I watch from you. It makes complete sense, no idea why I never though of it like this. Looking forward to more videos!!

  • @zfold4702
    @zfold4702 8 місяців тому

    Welcome back, sir. Happy to know you are still creating content.

  • @SudhakarChintapalli
    @SudhakarChintapalli 8 місяців тому

    Hey @Chris, it's great to see you after such a long time! I've always been a fan of the way you present content with crisp editing.

  • @silberwolfSR71
    @silberwolfSR71 8 місяців тому +1

    I think a major complexity concern with the "wrong" use of polymorphism is the possibility of type explosion.
    If there's a small number of implementations, I don't think it's such a big issue to use subtyping even when you only have variation in data.
    Granted, it's more complex than it needs to be, like you mention. But this is complexity in terms of code. Conceptually, it feels more straight-forward to me to have a "Thunderbolt" type and a "Scratch" type rather than just a generic "IAttack" that you need to configure at instantiation. Giving things names helps organize the program, and few names are more powerful than types in this regard.
    The parameterized class approach is more flexible too, I agree, but I think there is almost always a cost associated with flexibility. In this case, I think it introduces some additional cognitive load, because you are in some sense working at a lower level of abstraction (even though IAttack is more abstract than Thunderbolt, you need to contend with the implementation detail of the attack value when instantiating a "Thunderbolt" in this case; using polymorphism instead neatly encapsulates this).
    If we don't use polymorphism here, it feels like some kind of factory (method?) would be in order instead. Something to somehow reify these concepts of "Thunderbolt" and "Scratch".
    This also brings up the debate of: should you always go with the simplest possible solution that solves the problem as it is currently understood?. Or should you plan for some amount of future change? What amount and what kinds of change are we justified to plan for? Because one could reasonably predict your middle example evolving in the direction of the last example.

    • @alamaralaa
      @alamaralaa 8 місяців тому

      I've worked with code that has the opposite problem of type explosion. In this case, instead of defining an interface for, say, a drawing object with a draw() method, then subclassing the drawing object class with classes for doing lines, text, rectangles, and 50 other drawing operations, the designers used one class that had all the data required to draw anything, with 53 different constructors that take a type parameter and the type specific data, with a single draw function that used a switch statement to decide what actual drawing code to use. Totally miss the point of OOP much? It was the textbook definition of a C programmer who uses a C++ compiler and calls himself a C++ expert.
      The worst part was that he was teaching the junior guys how to write good code. Not long after I was asked to make this monstrosity work, I left the company.

    • @silberwolfSR71
      @silberwolfSR71 8 місяців тому

      @@alamaralaaThat sounds painful for sure, and worse than type explosion.
      What was the saying? "The 2 hardest problems in programming are naming things and off-by-one errors"? The "naming things" part to me encapsulates more than just picking the names of your components, it also implies deciding which components you should have. And that's the really hard part. Picking the right abstractions.
      One might say this guy didn't abstract at all, but I don't think that's right. You can't _really_ solve a problem of significant complexity without at least some sort of abstraction. He just ended up choosing all the wrong ones. Definitely sucks for anyone who has to work with them, but I empathize with struggling to abstract well.

  • @rudreshgp
    @rudreshgp 8 місяців тому

    Thank you Christopher for your design pattern series. That is one of the reason I got promoted 🙏🙏🙏

  • @alexstone691
    @alexstone691 8 місяців тому

    I did not expect you coming back, loved your design patterns, glad to see you're doing well!

  • @virtexamit
    @virtexamit 8 місяців тому

    Love to see you back, hope all good at your end. You have unique way of communicating complex things, Keep making video.