Thread: C#

    #1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    7
    Rep Power
    0

    C#


    Just wondering why C# was listed in the forum title. Correct me if I'm wrong (please do), but wasn't C# created by Microsoft, and isn't really related to C or C++ at all?

    Comments on this post

    • Gran Roguismo agrees
  2. #2
  3. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Q. How do you convert a Java program to a C# program?

    A. Change the file extension. :D

    While C# may have many differences with C++, I think it was grouped with the other C languages because a lot of C/C++ programmers in the Windows world (not everyone uses MFC) will start using it.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    114
    Rep Power
    15
    There are deifinitely some features found in both languages, but I think Java is more of a subset of C# than vice versa. C# has pointers, overloaded operators and a host of other features not found in Java. On the otherhand, Java has anonymous inner classes and dynamic class loading... It will be interesting to see if C# takes off or not, but in my opinion it has more in common with C++ than Java, so I think this is the right forum it.

    Comments on this post

    • Gran Roguismo agrees
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    34
    Rep Power
    13
    Java does have pointers, the whole language was desinged on the concept of pointers, it just that in Java they took away all the evil things that you can do with them, you can only dereference pointers in Java. The one limitation is that you can not create pointers to primitive types in java.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Location
    On a screen near you
    Posts
    498
    Rep Power
    13
    C# has pointers


    Everything ive read about C# told me it has memory management similar to Java's garbage collection


    I don't think C# will be a flop, Microsoft doesn't make flops


    From what ive read about C# it comes across as a language that is simple to construct like Visual Basic and has the full power of C++ with C++'s libraries and a few cloned Java libraries


    To get at the real guts of the system though, you need to jump out of C# into real code mode... Supposedly this is for the programming proffesional who knows what he or she is doing


    It's a combination of VB and VC without pointers and the need to manage memory so it should appeal to lots of women


    Mark

    Comments on this post

    • Gran Roguismo agrees
    100 trillion calculations per nanosecond
  10. #6
  11. Web Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2001
    Location
    Finland
    Posts
    719
    Rep Power
    15
    Originally posted by Marky_Mark
    ... Microsoft doesn't make flops
    Since when? ;)
    -- Tomi Kaistila
    -- Developer's Journal

    The more you learn, the more you know.
    The more you know, the more you forget.
    The more you forget, the less you know.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jul 2001
    Location
    Oslo
    Posts
    1,516
    Rep Power
    15
    Originally posted by Marky_Mark
    To get at the real guts of the system though, you need to jump out of C# into real code mode... Supposedly this is for the programming proffesional who knows what he or she is doing
    Are you talking about MSIL? I don't think the idea is that people are going to write MSIL code, just like nobody writes Java Bytecode (well ok, we actually did in a course on hardware architechture, but that was for learning purposes).

    Comments on this post

    • Gran Roguismo agrees
    --
    Regards
    André Nęss

    Puritanism: The haunting fear that someone, somewhere may be having fun
  14. #8
  15. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Originally posted by andnaess
    Are you talking about MSIL?
    I think he's talking about "unsafe mode" where you can use the unsafe keyword to explicitly reference memory. The following is from an O'Reilly interview about C#:

    http://windows.oreilly.com/news/csha...view_0201.html

    Stewart: What is "unsafe mode" in C#, and how does it work?

    Albahari: Contrary to the claims I've heard some people make, unsafe mode does not equip programmers with a loaded gun. C# has an unsafe keyword, that you can use to mark a region of code that explicitly manages memory. This is useful when you don't want to be restricted by the primary memory model that the runtime imposes on you, like where all variables are type-safe and everything is automatically garbage collected. For instance, in an unsafe block you can get a pointer to an array and just zap it with zeros. Generally you wouldn't want to do this; but if you're doing some really fast graphics process, it might be the extra bit of performance you need.

    Another example is when you're dealing with memory outside of the managed heap. You might be interoperating with native dlls, and want to explicitly use pointers. It's nice to do this within your C# program rather than write some extra dlls to do this for you. Of course, when you start explicitly managing memory you can read or write to some arbitrary address in an inadvertent or malicious way. So code marked as being unsafe can't safely execute without the appropriate security permissions, which is why it's called unsafe. The language and APIs have been designed so that over 99 per cent of the time you won't need or want to use unsafe code. VB.NET for instance, doesn't have it.

IMN logo majestic logo threadwatch logo seochat tools logo