• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

C and C#

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

KraziKid

Member
Joined
Nov 22, 2002
C and C# are very different languages. C# is Microsoft's idea of the logical evolution of C based languages. C compiles to binary code, while C# compiles to an intermediate similar to Java. This intermediate complies with the Common Language Runtime (CLR) which all .NET languages do. C# is part of Microsoft's .NET language subset. C# is very object oriented, and most anything you do is within a class. C is not an object oriented language. C can be compiled with many different compilers (gcc, Microsoft, Intel, etc...), while there are a limited number of compilers for C#. If you would like to learn C# you can download the Microsoft .NET SDK and you will get all of the .NET compilers for free.
 

druidelder

Member
Joined
Feb 13, 2002
C# is not meant to replace or even evolve C/C++. It is simply meant to replace Java, because M$ and Sun don't play well together.
 

Deathknight

Member
Joined
Sep 8, 2002
Location
Chicago
XWRed1 said:
No.

VB.net is VB in C#.

Ehh? vb.net and c# are not even close to the same language, about the only similarity they have is that they both use the CLR (as do all .net languages).

Druidelder hit the nail on the head. C# is Microsoft's language to compete with Java. It certainly has more java similiarities than to any other language.
 

XWRed1

Senior Member
Joined
Oct 31, 2001
I thought in VB.net Microsoft made C# the language that you wrote code in, so it could be more OO and fit better into the .Net scheme of things.
 

f012t12

Member
Joined
Dec 7, 2003
Location
New Jersey
If you like pointers and use them well with C, C# will ruin your appetite.

My point is this... The compiler in C#, based on what I've heard, supposedly reallocates RAM you've allocated so when you call previous pointers they've already been written and replaced somewhere else...

C# includes Microsoft's graphical, networking and other fancy subroutines integrated into one tool.


C is what C has always been, the greatest thing ever invented by those (don't know who) group of really smart programmers from ATT who were left abandoned by the MULTIX something or other innitiative....
 

VeryFirstSMP

Registered
Joined
May 6, 2003
Deathknight said:


Ehh? vb.net and c# are not even close to the same language, about the only similarity they have is that they both use the CLR (as do all .net languages).


Almost any line of VB.NET code can be converted into an equivalent line in C#. Both compile to the same Intermediate Language. Both languages use the same data types (which are standard across the .NET framework). Both use the same .NET class library.

Apart from syntax, I really have yet to see much difference between the two. Then again, I haven't built any real application with either.

Please tell me if I am wrong...
 

XWRed1

Senior Member
Joined
Oct 31, 2001
My point is this... The compiler in C#, based on what I've heard, supposedly reallocates RAM you've allocated so when you call previous pointers they've already been written and replaced somewhere else...

Well, C# is a whole new language.... it does garbage collection like Java, and that is part of the spec - it should be reallocating the ram and ruining your pointers regardless of the compiler, if that is what it does.
 

Deathknight

Member
Joined
Sep 8, 2002
Location
Chicago
VeryFirstSMP said:


Almost any line of VB.NET code can be converted into an equivalent line in C#. Both compile to the same Intermediate Language. Both languages use the same data types (which are standard across the .NET framework). Both use the same .NET class library.

Apart from syntax, I really have yet to see much difference between the two. Then again, I haven't built any real application with either.

Please tell me if I am wrong...

Yes its true they both compile down to the same language, and they both use the CLR. I was speaking purely syntactically though. My post was in response to someone saying that C# was the next version of VB, which it is certainly not. Really C# syntax is more similar to Java than any other language I have seen.
 

Deathknight

Member
Joined
Sep 8, 2002
Location
Chicago
f012t12 said:
If you like pointers and use them well with C, C# will ruin your appetite.

My point is this... The compiler in C#, based on what I've heard, supposedly reallocates RAM you've allocated so when you call previous pointers they've already been written and replaced somewhere else...

Yes its true pointers are a bit of a problem with garbage collection. Personally I don't see the need to use them in most cases in c# so its really a non issue to me. The idea of managed code in C# can be a bit of a leap for people coming from c++, there is alot of habits to leave behind.
 

f012t12

Member
Joined
Dec 7, 2003
Location
New Jersey
Well, yes, pointers are "dangerous."

C# becomes a problem when your main source architecture for a multi-warehouse database system written in C revolves around the use of pointers...

The problem with a system written in C is that it grants not too much access to "sexy," appealing graphics. From what I've heard, C# includes an arsenal of fancy graphical subroutines.

So when you walk up to the door to sell a Unix, console-based system, they'll say, "This thing's a hunk of junk, I can't even use the mouse?"
 

XWRed1

Senior Member
Joined
Oct 31, 2001
My post was in response to someone saying that C# was the next version of VB

I didn't say that, I said I thought they replaced basic with C#, but I guess they just significantly reworked basic and that was it.
 

Roof Jumper

Member
Joined
Apr 5, 2002
Location
In a spider hole
actually, C# is compiled to assembly upon first run on a system by the JIT. this process compiled the CLR code into optimized code for that specific system(i.e. if you were using a P4, it will optimize the code for the P4, and if you use an AMD the same thing, except for AMD).