Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. C# 13 Semi-ְauto properties

C# 13 Semi-ְauto properties

Scheduled Pinned Locked Moved The Insider News
csharpdatabasecomquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    NDpend[^]:

    This new feature solves the trade-off between the ease of auto-implemented properties with the versatility of manual ones.

    It saves a new variable every time you pull the trigger

    Please forgive my (usual) stupidity, but...Wha? All this does (as far as I can tell) is it saves you from having to declare the backing variable, at the expense of creating a new keyword that might conflict with existing code. So...yay?

    C 1 Reply Last reply
    0
    • K Kent Sharkey

      NDpend[^]:

      This new feature solves the trade-off between the ease of auto-implemented properties with the versatility of manual ones.

      It saves a new variable every time you pull the trigger

      Please forgive my (usual) stupidity, but...Wha? All this does (as far as I can tell) is it saves you from having to declare the backing variable, at the expense of creating a new keyword that might conflict with existing code. So...yay?

      C Offline
      C Offline
      Clickok
      wrote on last edited by
      #2

      This is a QoL feature for NotifyPropertyChanged pattern. This will mostly help code generators, avoiding the extra private field creation, and the (very common) generic method that receives the name of the property and the field value can easily compare both new and old field values before raising the property changed notification. Of course, that can be done currently, but this new field keyword will simplify this a lot


      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16) :badger:

      K 1 Reply Last reply
      0
      • C Clickok

        This is a QoL feature for NotifyPropertyChanged pattern. This will mostly help code generators, avoiding the extra private field creation, and the (very common) generic method that receives the name of the property and the field value can easily compare both new and old field values before raising the property changed notification. Of course, that can be done currently, but this new field keyword will simplify this a lot


        For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16) :badger:

        K Offline
        K Offline
        Kent Sharkey
        wrote on last edited by
        #3

        OK, that makes sense. Thank you.

        TTFN - Kent

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups