469,366 Members | 2,236 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

learn C++ or C#

If I haven't made substantial investment in either C++ or C#, which language
would the experts recommend I become well acquainted with?

Daniel
Jul 17 '08
151 3787
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 misunderstanding what you mean by "static
classes"...please 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

Jul 28 '08 #151
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".
Jul 28 '08 #152

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Rob | last post: by
42 posts views Thread by Bicho Verde | last post: by
55 posts views Thread by Elijah | last post: by
30 posts views Thread by Rhino | last post: by
8 posts views Thread by Hermawih | last post: by
21 posts views Thread by TAM | last post: by
85 posts views Thread by abhi | last post: by
31 posts views Thread by anand devarajan | last post: by
34 posts views Thread by pandit | last post: by
65 posts views Thread by Chris Carlen | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.