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. Refactor your C# code with primary constructors

Refactor your C# code with primary constructors

Scheduled Pinned Locked Moved The Insider News
csharpcomcode-review
5 Posts 5 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

    .NET[^]:

    C# 12 as part of .NET 8 introduced a compelling set of new features! In this post, we explore one of these features, specifically primary constructors, explaining its usage and relevance.

    "There can be only one"

    Greg UtasG N 2 Replies Last reply
    0
    • K Kent Sharkey

      .NET[^]:

      C# 12 as part of .NET 8 introduced a compelling set of new features! In this post, we explore one of these features, specifically primary constructors, explaining its usage and relevance.

      "There can be only one"

      Greg UtasG Offline
      Greg UtasG Offline
      Greg Utas
      wrote on last edited by
      #2

      If it ain't broke, don't fix it! :-D I often roll my eyes at all these new language features and static analyzers that complain when a 10-year-old code base isn't using them.

      Robust Services Core | Software Techniques for Lemmings | Articles
      The fox knows many things, but the hedgehog knows one big thing.

      <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
      <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

      J 1 Reply Last reply
      0
      • K Kent Sharkey

        .NET[^]:

        C# 12 as part of .NET 8 introduced a compelling set of new features! In this post, we explore one of these features, specifically primary constructors, explaining its usage and relevance.

        "There can be only one"

        N Offline
        N Offline
        Nelek
        wrote on last edited by
        #3

        Kent Sharkey wrote:

        "There can be only one"

        Use Singleton ;) ;P :laugh:

        M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

        1 Reply Last reply
        0
        • Greg UtasG Greg Utas

          If it ain't broke, don't fix it! :-D I often roll my eyes at all these new language features and static analyzers that complain when a 10-year-old code base isn't using them.

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          J Offline
          J Offline
          jochance
          wrote on last edited by
          #4

          For it to be a meme to judge programming by lines of code, the big dogs expend a great deal of effort to reduce lines. Too much of this gatekeeping guardian elitism babysitting. Let's take our super flexible blank books and just go ahead and insist that random pages of it have to contain certain plot points to make sure the author doesn't mess up the storytelling.

          T 1 Reply Last reply
          0
          • J jochance

            For it to be a meme to judge programming by lines of code, the big dogs expend a great deal of effort to reduce lines. Too much of this gatekeeping guardian elitism babysitting. Let's take our super flexible blank books and just go ahead and insist that random pages of it have to contain certain plot points to make sure the author doesn't mess up the storytelling.

            T Offline
            T Offline
            trønderen
            wrote on last edited by
            #5

            If you are measuring productivity by counting LOC, then these new tool are counter-productive.

            Religious freedom is the freedom to say that two plus two make five.

            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