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. Clever Code
  4. Hidden Features of C#

Hidden Features of C#

Scheduled Pinned Locked Moved Clever Code
csharpcomquestion
25 Posts 15 Posters 309 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.
  • R riced

    SalarSoft wrote:

    There are keywords that are not documented.

    Tried reading the language specs? That documents them. I had a quick look at the StackOverflow link - if these are hidden features they can't have been looking at anything beyond C# in 5 :laugh: minutes.

    Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

    K Offline
    K Offline
    Keith Barrow
    wrote on last edited by
    #21

    Actually,, undocumented keywords do exist in c#. They are undocumented as MS don't want us to use them (e.g. there is a high potential for a visit from the FU Fairy). See http://davesbox.com/archive/2008/12/29/documenting-undocumented-features.aspx[^]

    Sort of a cross between Lawrence of Arabia and Dilbert.[^]
    -Or-
    A Dead ringer for Kate Winslett[^]

    R 1 Reply Last reply
    0
    • K Keith Barrow

      Actually,, undocumented keywords do exist in c#. They are undocumented as MS don't want us to use them (e.g. there is a high potential for a visit from the FU Fairy). See http://davesbox.com/archive/2008/12/29/documenting-undocumented-features.aspx[^]

      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
      -Or-
      A Dead ringer for Kate Winslett[^]

      R Offline
      R Offline
      riced
      wrote on last edited by
      #22

      Keith Barrow wrote:

      undocumented keywords

      That looks like an oxymoron - but that's a debate about semantics. There are identifiers, such as __reftype, that act as though they are keyword in .Net but are not specified as keywords in the C# language. These are implementation details so may not be 'keywords' in e.g. Mono. I don't know of a better way to describe such identifiers than 'undocumented keywords' but the phrase leaves me with bad taste - rather like beetroot. :)

      Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

      1 Reply Last reply
      0
      • S SalarSoft

        Hidden Features of C# Personally I like ?? operator and started using it since then:

        private IList<Foo> _foo;

        public IList<Foo> ListOfFoo
        { get { return _foo ?? (_foo = new List<Foo>()); } }

        M Offline
        M Offline
        Monjurul Habib
        wrote on last edited by
        #23

        I think this is not hidden features .. most of C# developers already know this and this is available everywhere.

        L 1 Reply Last reply
        0
        • M Monjurul Habib

          I think this is not hidden features .. most of C# developers already know this and this is available everywhere.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #24

          I do agree !

          1 Reply Last reply
          0
          • S SalarSoft

            RTFM is done for C#2 and upgraded for C#3 and 4, but still seems I missed some features during upgrade! it happens ;P

            T Offline
            T Offline
            the headless nick
            wrote on last edited by
            #25

            What is RTFM :cool::

            --- With regards... The nk.

            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