learn C++ or C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ben Voigt [C++ MVP]

    Re: learn C++ or C#

    Arne Vajhøj wrote:
    Ben Voigt [C++ MVP] wrote:
    >>>static classes - missing
    >>I don't understand this. Are you saying that C# didn't get to use
    >>"static" when declaring a class until 2.0? That doesn't sound right
    >>to me. I'm also not clear on what you mean by "missing" with
    >>respect to Java, since you can effectively create a static class in
    >>Java just as easily in C#.
    >>>
    >>I must be misunderstandin g what you mean by "static
    >>classes"...pl ease elaborate.
    >>
    >Java and C# use the term "static class" in totally different ways. In C#,
    >a nested class definition provides privileged access to
    >private members of the parent when properly addressed using a parent
    >reference, and to generic argument of the parent, but not an
    >instance of the parent. In Java, a nested class definition creates
    >an "inner class" which is bound to an instance of the parent, sort
    >of like the closure that C# uses for anonymous methods. In Java,
    >"static class" is used to create a nested class that isn't also an
    >"inner class".
    >
    I don't think anyone in the discussion was thinking about Java
    "static nested class" or "static member class".
    >
    They are practically never referenced as just "static class".
    The phrase "static class" appears in the source code... the use of the
    keyword 'static' in that context is already taken.
    >
    Arne

    Comment

    • Ben Voigt [C++ MVP]

      Re: learn C++ or C#

      Those hard to find memory overwrites you can get in C/C++ or
      mysterious memory leaks is not possible in C#.
      The information you have about C# sounds like the marketing drivel Microsoft
      puts out, not experience. Anyway, I invite you to read
      http://blogs.msdn.com/tess/ and then come back and repeat "Those mysterious
      memory leaks are not possible in C#" with a straight face. She's documented
      a large number of memory leaks, both in Microsoft and in user code.

      Also google for "C# static event memory leak".


      Comment

      Working...