Use Incremental Coding Technique and Make No Bugs in Complex Features

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 25. 07. 2023
  • Become a patron and download the source code: / source-code-for-86677311
    Are you tired of the daunting task of adding complex features to your existing applications, always looking over the shoulder for new bugs disseminated in the process? Fear not! There has always been a super effective technique called incremental coding that can save you from this predicament. It allows you to split a daunting task into manageable chunks, ensuring that the introduction of a new feature doesn't destabilize an already well-functioning system.
    Incremental coding is a powerful approach that allows you to add new features to your application without jeopardizing its existing functionality. It's all about making changes in the smallest increments possible, ensuring that you never introduce bugs or disrupt the smooth operation of your software. This approach reduces the risks associated with adding complex features because changes are introduced gradually and can be tested and verified at each stage. By introducing changes in a controlled and systematic way, you're ensuring that each piece of the puzzle works perfectly before moving on to the next one. That technique is a critical tool for reducing bug counts and mitigating the risk of introducing new ones.
    The incremental coding technique exemplifies a disciplined and meticulous approach to development. Each step in incremental development consists of adding a new ability to an existing model as the first half-step and then utilizing that new ability in the rest of the code as the second half-step. The result of this discipline is that you will be adding small portions of new code without ever causing a regression. Your application will only grow, both in size and in features!
    This video will teach you to embrace incremental coding and unlock the potential of the domain model you are developing.
    Thank you so much for watching! Please like, comment & share this video as it helps me a ton!! Don't forget to subscribe to my channel for more amazing videos and make sure to hit the bell icon to never miss any updates.đŸ”„â€ïž
    ✅🔔 Become a patron â–ș / zoranhorvat
    ✅🔔 Subscribe â–ș / @zoran-horvat
    ⭐ Learn more from video courses:
    Beginning Object-oriented Programming with C# â–ș codinghelmet.com/go/beginning...
    ⭐ Collections and Generics in C# â–ș codinghelmet.com/go/collectio...
    ⭐ Making Your C# Code More Object-oriented â–ș codinghelmet.com/go/making-yo...
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐ CONNECT WITH ME đŸ“±đŸ‘š
    🌐Become a patron â–ș / zoranhorvat
    🌐Buy me a Coffee â–ș ko-fi.com/zoranhorvat
    🗳 Pluralsight Courses â–ș codinghelmet.com/go/pluralsight
    📾 Udemy Courses â–ș codinghelmet.com/go/udemy
    📾 Join me on Twitter â–ș / zoranh75
    🌐 Read my Articles â–ș codinghelmet.com/articles
    📾 Join me on LinkedIn â–ș / zoran-horvat
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    👹 About Me 👹
    Hi, I’m Zoran, I have more than 20 years of experience as a software developer, architect, team lead, and more. I have been programming in C# since its inception in the early 2000s. Since 2017 I have started publishing professional video courses at Pluralsight and Udemy and by this point, there are over 100 hours of the highest-quality videos you can watch on those platforms. On my CZcams channel, you can find shorter video forms focused on clarifying practical issues in coding, design, and architecture of .NET applications.❀
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    âšĄïžRIGHT NOTICE:
    The Copyright Laws of the United States recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.
    ⭐For copyright or any inquiries, please contact us at zh@codinghelmet.com
    #csharp #objectorientedprogramming #dotnet
  • Věda a technologie

Komentáƙe • 20

  • @rustamhajiyev
    @rustamhajiyev Pƙed 10 měsĂ­ci +4

    Really like that you demonstrate multiple techniques/solutions using the same code but approaching to the problem from different angles. Love your "intro"s 👍😂

  • @L0wPressure
    @L0wPressure Pƙed 9 měsĂ­ci +4

    I don't use C# but all you're saying can be generally applied to any language, and i enjoy your explanations and way of thinking. Thanks for the content!

  • @nickbarton3191
    @nickbarton3191 Pƙed 7 měsĂ­ci +1

    That first step was beautiful, all the other files turned from red to green in an instant.

  • @XXnickles
    @XXnickles Pƙed 10 měsĂ­ci +4

    Used to watch your courses in Pluralsight; glad to see you are around and keep expanding in these functional principles using the newer language features. I also use the record inherence as a replacement of discriminated unions (the wait will be long for what it seems) Subscribing!

  • @ivandrofly
    @ivandrofly Pƙed 9 měsĂ­ci +1

    Nothing to say other than thank you :D - you are the missing person I was looking for on CZcams :D

  • @noopcode
    @noopcode Pƙed 10 měsĂ­ci

    So The Vision decided to retire from being an Avenger and became a programming guru instead? Excelent video Mr Horvat

  • @temp50
    @temp50 Pƙed 10 měsĂ­ci +1

    I have a feeling that you either didn't see soo much ugly (a.k.a. very smart) code or just elegantly skipped this little potential problem. :P
    Just an example: You said that just by exchanging the string to an other type wont'be a breaking change. The reality is that every time someone expecting that property to be a string via Reflection / lazy loading by exact type matching, or via any other type of magic.. , it could be a breaking change at runtime!
    So, step 0: Reverse engineer the whole application and try to find all of these things before changing anything.

    • @zoran-horvat
      @zoran-horvat  Pƙed 10 měsĂ­ci +2

      You are advocating precisely the mistake I have tried to expose in this video. There is no problem in identifying all the places that depend on string, but attempting to do anything with that would be a catastrophic error in a large project.
      If you ever sent a PR with 100 changed files, I would reject your work as a certainty, because you would not be able to explain what makes the resulting code correct.
      Now back to the beginning: Can you introduce a seam in code so that only a few files change, and each in only a few lines? If you can, then you have my attention.

  • @ivandrofly
    @ivandrofly Pƙed 9 měsĂ­ci

    Video-mark:
    2:45 - string

  • @loupiz
    @loupiz Pƙed 10 měsĂ­ci +19

    Finally someone who fills the gap between C# and domain design on CZcams. @Zoran Horvat I'have started watching your videos they are great, thank you. I'm definitely not an expert of Blazor but it would be nice to use a pattern to prevent modifying the _CitationPartial.cshtml file each time a new segment type is added to the application (perhaps having a list of views where you can add new ones whenever segment types are added).

    • @zoran-horvat
      @zoran-horvat  Pƙed 10 měsĂ­ci +1

      If you watched my video on discriminated unions, then you will see that the problem you have outlined is the signature of functional modeling - adding a new type to the set of related types is a breaking change to all the consumers, UI included. I think that trying to fix that is a lost cause, for many practical reasons.

    • @loupiz
      @loupiz Pƙed 10 měsĂ­ci +1

      @@zoran-horvat I get a bit confused with discriminated unions I must say. To me they tend to violate the open/closed principle. I would be interested to hear your thoughts on that.

    • @zoran-horvat
      @zoran-horvat  Pƙed 10 měsĂ­ci +3

      @@loupiz OCP does not apply to DU - it is a concept from object-oriented programming, while discriminated unions are the modeling tool from functional programming. Actually, they achieve their greatest power by breaking OCP - the ability to define behavior where it belongs, rather than where the types are defined. You can watch the video on discriminated unions to get a better grasp of how they help in design: czcams.com/video/q_tH3njpAFc/video.html

    • @amarsha4
      @amarsha4 Pƙed 10 měsĂ­ci +1

      @loupiz I thought the same thing. I'm from a purely OOP background so this seemed suboptimal to me. I'll have to watch some of Zoran's functional programming videos.

    • @davidghydeable
      @davidghydeable Pƙed 10 měsĂ­ci +3

      You can actually do this. In you view you call . Then you create partial views corresponding to the class names of each segment type. You will also need to create a partial view for the base type even though this will never actually be used. .NET seems to need it to be there.

  • @jonny.rubber
    @jonny.rubber Pƙed 10 měsĂ­ci

    And put all strings into Const.c 😂

  • @aprobinda
    @aprobinda Pƙed 10 měsĂ­ci

    13:57 This runtime type information looks like a violation of LSP:
    `if (segment is BookTitleSegment book)`
    because foreach references the base class CitationSegment but has to know about its subtype. What do you think about this @zoran-horvat?
    Excellent video with useful content, by the way, I enjoyed watching it. Thank you for the time you invested into it.

    • @zoran-horvat
      @zoran-horvat  Pƙed 10 měsĂ­ci +1

      The portion of code you are referring to is a pattern matching expression typical of functional code. The types pertaining to CitationSegment are effectively functional types, rather than object-oriented classes.
      I would strongly advise you to watch the videos where I have addressed that technique, primarily this one: czcams.com/video/q_tH3njpAFc/video.html

    • @aprobinda
      @aprobinda Pƙed 10 měsĂ­ci +1

      @@zoran-horvat thank you for clarifying. Having watched the recommended video, I see why LSP does not apply, but more importantly, I learned about a new approach.