What's the difference?
Printable View
What's the difference?
C# is a rad tool. c++ is not
C# is a high level language. c++ let's u go more down
C# is meant for business development, C++ is for true commercial development. Basically C# takes the place of Visual Basic 6 in the future.
C# is also meant for the development of web service app, MS apparently believes they will be important soon (I don't...).
C++ is compiled to native code, C# to byte code. This means C++ is faster in execution but has to be recompiled for other platforms.
C++ has only a very small built-in library, C# has the .NET framework. But there are libraries for nearly everything already available for C++.
C# has several built-in features that stem from its managed nature: garbage collection with automatic reference counting is the most important.
You can implement garbage collection in C++ but it's a lot of work and you have to write your own smart pointer class for reference counting. And if you forget to use it you'll end up with loose pointers. Basically you have to manage memory yourself.
C++ has more advanced operator overloading. C# can overload only very few operators. This limit is actually not imposed by C# but rather by VB.NET. In order to make the operator overloading work in all languages they had to bring it down to a common denominator. VB ahs no shift operators and such, so you can't overload them.
C++ has one more important feature: templates. C# tries to make it up by having Object as a absolute base class but templates are superior to polymorphism in many situations.
Both C# and VB.NET is compiled to native code by the JIT compiler as you run your app for the first time.Quote:
Originally posted by CornedBee
C++ is compiled to native code, C# to byte code. This means C++ is faster in execution but has to be recompiled for other platforms.
That depends on the setting. The JIT compiler, as the name says, compiles the byte code just in time, which means just prior to its first execution. Code that is run for the first time is slower than real native code. Successive runs will be just as fast, at the expensive of much memory to hold the temporary code. Since some of the code is thrown away when not used for some time it needs then be recompiled, resulting in more performace loss.
You can also set the JIT compiler to compile everything at app startup. This means long startup time and (for large apps) much temporary memory used.
The real native code that C++ is compiled to suffers from none of these problems.
new features of c#
Quote:
NEW C# LANGUAGE FEATURES
On November 7th, at the OOPSLA Conference in Seattle, WA, C# creator Anders Hejlsberg unveiled several potential language features for the next major release of Visual C# .NET. The four primary features Anders spoke about were:
Generics, a form of C++ templates that makes reusing existing code easier
Iterators, a construct that makes traversing collections of data significantly faster and easier
Anonymous methods, an easier way to perform simple tasks using delegates
Partial types, a means for programmers to split code across multiple files
The C# team fully intends to submit these features for consideration by the ECMA and ISO standards bodies. However, in unveiling these features early, it is our hope that you will provide comments and opinions on our implementation before we begin the standardization process.
Sounds good.
Nah.
:D :p
But I don't want to know what weird keywords they will invent to keep VB.NET up to these changes.
I dont think VB.NET will be getting these features, but I might be wrong.
<insert extremely intelligent insult to .NET in general and VB.NET and C# in particular here> :cool:
:rolleyes: Too lazy.
Insults are never intelligent Guru. Much less extremly intelligent. :D
<Insert long and absolutly convincing explanation why .NET, VB.NET and C# are evil here>
If so then that would decide most of the C# vs. VB.NET discussions once and for all.Quote:
Originally posted by DevGrp
I dont think VB.NET will be getting these features, but I might be wrong.
Quote:
Originally posted by CornedBee
If so then that would decide most of the C# vs. VB.NET discussions once and for all.
C# vs VB.NET -----> 100% C# will win.....
VB will die earlier as C#!!!
gicio
Yes, that's pretty much what I meant, except with cleverly hidden embedded insults.Quote:
Originally posted by CornedBee
<Insert long and absolutly convincing explanation why .NET, VB.NET and C# are evil here>
VB.NET is yet easier than C# by syntax, so the battles will be more like VB 6 vs C/C++. It's just a personal choice of syntax after all, the languages are practically the same.
I tend to disagree with this statement. Trying to remeber all of the keywords in VB.NET is like trying to memorize pages from a dictionary. Whereas in C#, alot of functionality is implied, thus minimizing the amount of keywords. For instance, in VB.NET you have 'Inherits, Implements, etc.', where in C#, it's a simple ':'.Quote:
VB.NET is yet easier than C# by syntax, so the battles will be more like VB 6 vs C/C++. It's just a personal choice of syntax after all, the languages are practically the same.
Like you stated though, it all comes down to personal preference.
I didnt mean that. What I meant is that VB.NET and C#.NET share functionality of the .NET framework and share OOP functionality. BASIC syntax is still considered easier for most people. C#.NET provides a tiny speed advantage and maybe a few features (don't know these).
Cheers :)
asp, we said that if those new features kovan spoke of make it into C# but not VB.Net then C# will soon be the by far preferred language and all other .Net languages (VB.Net, J#, JScript.Net) will become rare and subsequently less up-to-date, thus reducing their usability even more.
And AFAIK C# doesn't offer any speed advantage over VB.Net.
As for C++: Java and VB6 couldn't push C++ out of professional development, why should C# and the .Net frame be able to?
jscript.net... damn!!! never heard of it b4
did they clone every language?
C# and the .NET framework will NOT push C++, nor will it push C, out of professional development. C and C++ are currently the best languages available for writing device drivers and doing system programming.
What will push C/C++ out of professional development is a better language with just as much (or more) flexibility, efficiency and optimization, platform independence, dependency on either small or no runtime libraries...
No .NET language fulfills all of the above.
Flexibility: Too arguable, not going into this.
Efficiency/optimization: Arguable, IMO C and C++ are better. When writing C/C++ code in VC++, I can anticipate the assembly before compiling. This can lead to fun little optimizations (programmer optimizations, not compiler optimizations). .NET compiles to byte code (MSIL). Even if it does translate it to native code, I don't have that ability.
Platform independence: C and C++ totally kick .NET's ass on this one. (Yes, I know there's a *nix port of the .NET framework. Still.)
Dependency on either small or no runtime libraries: .NET framework is VAST. When it was still being worked on, I expected it to grow to huge proportions, like 5 mb. Now it's out, and it's 30 mb. On the other hand...Code:Directory of C:\WINNT\system32
01/05/2002 13:38 54,784 msvci70.dll
01/05/2002 13:40 487,424 msvcp70.dll
01/05/2002 13:37 344,064 msvcr70.dll
3 File(s) 886,272 bytes
When looking at the criteria that Yonatan described, I agree, there is absolutely no contest. I would view .NET as a business convenience right now more than anything. On the system I am working on, a 30 MB distribution is no concern even without using .NET, so I doubt very much that is will be when we migrate over.
Speed of development is the only major advantage I see in any case, but I would probably shy away from writing .NET programs that single customers would get. At least for now.
It all boils down to RAD development. For commercial application, C++ is preferred in most instances. However, in the real world, most companys need an application developed asap and c++ isn't always the practical solution. With the explosion of e-commerce over the past few years, .NET is going to solve many of the problems associated with web development.
Just my 2 cents..
It seems that everyone is trying to compare two languages that are meant for different things.
Like said before, C++ is definately going to have less to distribute and run faster. No one disputes this. C++ does have a disadvantage though, and that is the speed at which a business app can be developed with it. It just takes longer (when I say this, I am talking about two people with equal time with each of the languages).
C# makes developing business apps fast and easy, same with internet dev. The cost of that speed is app performance and big dependancies. (although I would argue the app performance, because most business apps don't require blazing fast speeds).
So, for commercial dev, most people will pick C++, you want your product fast and small and you have a little more time to develop it. For business apps though, C# would make sense.
That is my 2 cents...
Hellswraith,
How's the forum your creating coming?
I also needed a project to help me learn asp.net, so right now i'm developing an online bookstore for all of my books.
Its coming along. I am trying to make it full featured, so it will take me a while, especially since I hardly know ASP.Net. I am almost finished nailing down the database design completely (I keep adding things I forgot) and I have all the logon stuff finished except for a few minor things. I created an email verification so users can't just submit false data.
What does your online bookstore do?
Basically, I have way to many books (which half I haven't even read) and it's kinda hard to keep track of all of them. I basically want to create a small web based library that stores various information about the books. The company I work for is going to eventually use a version of it once it is complete. It's going to allow for books to be checked in/out and send email notification for book request.
To be honest, my skills lack in web development, so I'm hoping this will get me on the right track.