Coding Shorts 110: Garbage Collector and IDisposable

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

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

  • @lacuevadelinsecto
    @lacuevadelinsecto หลายเดือนก่อน +5

    Your videos are Gold. And C# is maybe de most flexible and powerful language I've ever used.
    A while ago, I tried Golang, another powerfull language, but C# has a powerfull tool that Golang doesn't, JIT compiler. It makes C# powerful, because you can use it without recompilation on multiple systems, but if needed, C# also supports AOT (instead of JIT), and could be as fast as Go, ando even faster.
    A lot of caracteristics of C# makes it language beautiful (and my favourite), GC, Reflection, Expression Trees, AOT, JIT, Code Generators, full (or almost full) functional support (I still waiting for Union Types), App Domain, unsafe, pointers, etc.. I really love C# and its ecosystem (.NET and its VBasic and F# compatibility).
    Keep going, your videos are great!

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

      Sorry, I'm just learning English

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

      Glad you like the content! C# is a language that's hard not to love.

  • @dima13693
    @dima13693 28 วันที่ผ่านมา +1

    Wth... you just corrected a really confident yet wrong thought I had. instantly subscribing.

  • @Explorest
    @Explorest 25 วันที่ผ่านมา

    Oh heavens me ... this was a master-effing-piece. Thanks for the clarity it brought.

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

    Thank you, Shawn, for years you are in my opinion one of the top best teachers on Pluralsight. God bless you and your loved ones and thank you for sharing knowledge

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

      That's very kind of you to say, thank you!

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

    What a pleasant thing to wake up to. Great vid Shawn.

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

    thanks for the video.. i totally agree on that, even some of the senior devs of the company i was working with didnt know the exact reasons or only the half of it which what seperates gc and idisposable etc. MSDN docs also have a very good explanation for this, which i recommend any c# dev to read.

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

      Thanks for sharing!

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

    Awesome video, I think I will add a couple questions to our interview process after this :) I agree with the statement that even seniors soemtimes say things like "you need to add IDisposable for garbage collector to clean up the object"

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

      Glad to help!

  • @nico-toscani
    @nico-toscani หลายเดือนก่อน

    Thank you Shawn. Great explanation of this mechanism. Really cool that you showed it with diagnostics counters.

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

      Glad it was helpful!

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

    Super helpful and cleared up for me how finalizers fit with IDisposable. Thank you!
    Very minor request: consider using larger text to help us old guys watching on our phones.

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

      I try to remember, sorry about that, though the perf counters are hard to scale up

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

      No worries! And I figured that was the reason you didn’t scale up. I could see the code well enough.
      Boy it sucks getting old! Thanks again.

  • @ukasz-xn8kn
    @ukasz-xn8kn 26 วันที่ผ่านมา

    When I saw those glasses put on immediately subscribed. Great value content!

    • @swildermuth
      @swildermuth  25 วันที่ผ่านมา

      You subscribed because I can't see?

    • @ukasz-xn8kn
      @ukasz-xn8kn 25 วันที่ผ่านมา

      @@swildermuth yes

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

    Thanks a lot Shawn
    I hope you create a video about when to use class, record, struct, class struct and record struct

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

      Did this one help? th-cam.com/video/pAaHYrrRQBA/w-d-xo.html

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

      @@swildermuth thanks

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

    Fantastic video and very pertinent to an app I'm building at work!

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

      Glad to hear it's helpful!

  • @hc-jc7oc
    @hc-jc7oc หลายเดือนก่อน

    excellent and clear explanation as always!

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

    Thank you, excellent.
    If we have events (the += type), where should they be cleaned up, and is that needed?

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

      Typically, they are destroyed when the object is (once all the other objects that have wired up the events) are collected, but to be sure, you can do -= to remove the event handler on cleanup. This isn't what you should use IDispoable for. Typically, event driven have events like OnClose where you'd want to do it.

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

    Sometimes I wonder how each iteration of WPF's TreeView handles it's memory...
    Anyway, great video Shawn 👍

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

      Glad you enjoyed it!

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

    The GC is decidedly lazy when it comes to cleaning up objects. It's more efficient (less work) to recompact memory for the newest gen 0 and even gen 1 objects.
    Structs are underutilized, IMHO.
    I had not heard of record struct - thank you!

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

      Depends on which GC you're talking about. The desktop GC vs. Server GC. One is more aggresive.