What's new in C#? Exciting new features in C# 9, 10 and 11! - Filip Ekberg - Copenhagen DevFest 2023

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

КОМЕНТАРІ • 4

  • @luciwaves
    @luciwaves Рік тому +3

    "Treat Warnings as errors" is the equivalent of getting your entire team of developers to stop smoking at the same time.

  • @ralmslb
    @ralmslb Рік тому +5

    16:55 Can someone explain to me why is it better to create a new instance of Details class than changing its properties values?
    Won't that result on worse GC pressure?

    • @Measurity
      @Measurity Рік тому +7

      Yes, you're right. If you allocate (new Class()) an object and then remove all references to it in your code, then the GC will take some CPU time to clean it up.
      The benefits of doing this anyway are:
      - Maintainability, you know it won't change while you use said objects. Meaning, fewer if-statements to verify data correctness.
      - In parallel processing, you can assign a group of these read-only objects to each thread without worry of race conditions.
      - Caching, because data won't change you don't need to deal with things like PropertyChanged events to invalidate the cache.
      If you're writing real-time code which run continuously without user input (i.e. sensor readers, (physics) simulations, games) then you should reduce (continuous) allocations as they can quickly pile up and degrade performance.

  • @3aTaree2ak
    @3aTaree2ak 3 місяці тому

    restored chrome..
    Steam open