|
-
Nov 16th, 2005, 03:59 AM
#1
Thread Starter
Addicted Member
C++ Vs C#
I'm a VB programmer and completely new both to C++ and C#.
Should I concentrate on learning C++ or C#?
I'd like to know the complete comparison between C++ and C#..
I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
Is C# only for windows platform?
Which is better speed-wise?
Please advice me.
-
Nov 16th, 2005, 04:43 AM
#2
Re: C++ Vs C#
C++ is faster, C# is easier. Both C++ and C# can be used on other platforms. Both is usefull. When you know one of them, the other should be easier to pick up. If you are a VB programmer, and there is nothign special you need to learn it for then I suggest C# first, so the step won't be THAT big for you.
- ØØ -
-
Nov 16th, 2005, 07:43 AM
#3
Re: C++ Vs C#
 Originally Posted by NoteMe
If you are a VB programmer, and there is nothign special you need to learn it for then I suggest C# first, so the step won't be THAT big for you.
- ØØ -
As a VB programmer, I can definately back NoteMe up on that statement. I was suprised at how quickly I managed to get the fundamentals down. I have played around with C++, and find it much less "friendly" than C#.
-
Nov 16th, 2005, 07:45 AM
#4
Re: C++ Vs C#
 Originally Posted by winterslam
I'm a VB programmer and completely new both to C++ and C#.
Should I concentrate on learning C++ or C#?
I'd like to know the complete comparison between C++ and C#..
I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
Is C# only for windows platform?
Which is better speed-wise?
Please advice me.
I should go for C# as it's gaining popularity fast.
Like Noteme said, C# is not bound to Windows. It uses the .NET platform, which is available for other platforms than just Windows. And yes C++ is faster. But I think the difference in speed is neglectable in 'standard' applications. (Not games or something)
I code C#....

-
Nov 16th, 2005, 07:53 AM
#5
Re: C++ Vs C#
C++ is more difficult to learn, which is one of the reasons that languages like Java and C++ were created in the first place. In all but the most demanding of scenarios C# will be just as efficient as C++, and the syntax is similar enough to VB.NET that it is not a huge leap, especially with all the common classes that the .NET Framework provides. Learning unmanaged C++ from Microsoft is likely to tie you to Windows anyway because of the Windows-only MFC library, if that still exists.
-
Nov 16th, 2005, 09:25 AM
#6
Thread Starter
Addicted Member
Re: C++ Vs C#
How about the dependency of the products made in C#?
Are they stand-alone or the whole .NET Framework is required to run them?
-
Nov 16th, 2005, 10:12 AM
#7
Re: C++ Vs C#
Yeah, that is the biggest negative thing about .NET applications. YOu need the framework. But once someone has used one .NET app they have it, so I can't see the big problem with it as many others do.
- ØØ -
-
Nov 16th, 2005, 03:46 PM
#8
Hyperactive Member
Re: C++ Vs C#
I've never understood people's concerns about needing the .net Framework, needing its VM didn't hinder Java.
-
Nov 16th, 2005, 05:15 PM
#9
Re: C++ Vs C#
 Originally Posted by GlenW
I've never understood people's concerns about needing the .net Framework, needing its VM didn't hinder Java.
I hear you. The only concern with needing the Framework is if your user downloading your app and is on a dialup connection. Otherwise you just provide the Framework in your installer, either downloadable or on CD, or provide a link to download it from the source.
-
Nov 16th, 2005, 06:52 PM
#10
Hyperactive Member
Re: C++ Vs C#
C# is more business friendly. It costs much less to develop and debug bus apps with .net or java apps.
C++ is used for hard core programming, such as Games, Graphics tools, Operating Systems. Things where performance is key. At that point, Assembly is probably used too.
 Originally Posted by winterslam
I'm a VB programmer and completely new both to C++ and C#.
Should I concentrate on learning C++ or C#?
I'd like to know the complete comparison between C++ and C#..
I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
Is C# only for windows platform?
Which is better speed-wise?
Please advice me.
"I like to run on treadmills, because at least I know I'm getting nowhere."
- Me
-
Nov 16th, 2005, 10:27 PM
#11
Thread Starter
Addicted Member
Re: C++ Vs C#
Actually I'm not a big fan of dependent programs. Visual Basic itself requires runtime library files to run.
I don't know what microsoft's problem is. Why can't they just make the products run on their own.
I believe C# produces intermediate code just like bytecode in Java.
But mose computers have VM installed, and I don't think many computers will have .NET framwork installed.
-
Nov 16th, 2005, 10:47 PM
#12
Re: C++ Vs C#
 Originally Posted by winterslam
But mose computers have VM installed, and I don't think many computers will have .NET framwork installed.
No computers had a Java VM installed until either the user installed one or the OS was released with one included. That is the exact same situation with the .NET Framework. More and more people will install it over time and Vista will come with it pre-installed so it won't be an issue then. If you don't have the .NET Framework then you lose every class that it contains. Every language needs a decent class library, so the .NET Framework provides one of the best around, plus it provides automatic garbage collection and god knows how many other useful things. It also saves us from ahving to use Windows APIs in the vast majority of circumstances, and I for one am glad about that.
-
Nov 17th, 2005, 09:50 AM
#13
Re: C++ Vs C#
1) More and more computers will have the .NET framework installed as time progresses, due to it being shipped with Windows (as of XP SP2) and distributed with new .NET applications.
2) The requirement for the .NET framework enables platform-independence, as platform-specific versions of the framework can run .NET assemblies that are the same for all platforms.
3) The JIT (Just-In-Time) compiler model used by the .NET framework does in fact (in theory) enable .NET applications to run more efficiently than C++ applications, as they are compiled ON the exact platform that they will be running on and can thus use all platform-specific optimisations in the code, whereas compiled applications (C++ etc.) must be compiled using code that runs on MOST platforms (hence without such a fine level of optimisation).
-
Nov 23rd, 2005, 11:35 AM
#14
Hyperactive Member
Re: C++ Vs C#
Why would you want to code for a non-windows system? Does anyone actually own one? I always thought they were a myth. Like Santa.
-
Nov 23rd, 2005, 11:40 AM
#15
-
Nov 24th, 2005, 01:06 AM
#16
Re: C++ Vs C#
C#, the language itself is platform-independant and standardized. The only problem is there are two compilers for it: The .Net SDK from Microsoft (Which only works on Windows) and Mono (which currently only works somewhat on Linux and a version of OS X is in the works but is, like 2% completed). The .Net Framework and Mono include many non-standard items like GUIs, Networking, XML Readers, etc...
So, until someone writes a standardized C# compiler, then it really isn't platform independant.
 Originally Posted by jmcilhinney
No computers had a Java VM installed until either the user installed one or the OS was released with one included.
Java no longer comes installed on Windows XP and later versions because of a legal issue between Microsoft and Sun.
 Originally Posted by penagate
3) The JIT (Just-In-Time) compiler model used by the .NET framework does in fact (in theory) enable .NET applications to run more efficiently than C++ applications, as they are compiled ON the exact platform that they will be running on and can thus use all platform-specific optimisations in the code, whereas compiled applications (C++ etc.) must be compiled using code that runs on MOST platforms (hence without such a fine level of optimisation).
This is not entirely true. They will NOT run more efficiently than a C++ application. First off, C#, VB.Net and managed C++ all use .Net's garbage collector, which already gives it a large overhead. There are many more layers of abstraction (even with the native image) so C# and managed C++ will never be more efficient than a pure C++ application.
With C++, you can prove a huge amount of optimizations without knowining the arch. Here are some of the optimizations I use in C++:
Code:
-O3 -fforce-addr -fomit-frame-pointer -finline-limit=2000 -fsched-spec-load -fmove-all-movables -freduce-all-givs -ffast-math -funroll-loops -fprefetch-loop-arrays -mmmx -msse -mfpmath=sse -minline-all-stringops -maccumulate-outgoing-args
The only arch specific optimizations here are the : -mmmx -msse -mfpmath=sse and those work on all PIIIs and Up (including AMD).
 Originally Posted by umilmi81
Why would you want to code for a non-windows system? Does anyone actually own one? I always thought they were a myth. Like Santa.
Mac OS X and Linux are becoming increasingly popular. Each quarter, Apple sells a record breaking amount of Macs and it's continuing so Mac OS X is going to get a much much larger market share within the next few years. Once you use a Unix like system, you'll realize Windows sucks with multitasking. The only problem is, Windows is more friendly than Linux and has more software than OS X.
Last edited by Kasracer; Nov 24th, 2005 at 01:12 AM.
-
Nov 24th, 2005, 09:38 AM
#17
Re: C++ Vs C#
ASM is better
-
Dec 6th, 2005, 09:45 PM
#18
Hyperactive Member
Re: C++ Vs C#
 Originally Posted by kasracer
Once you use a Unix like system, you'll realize Windows sucks with multitasking.
I cut my teeth on SunOS 5.X (AKA Solaris 1) and Solaris 2. I'll throw down with anyone on Bourne Shell scripting and nawk.
This is how you kill a hung text editor
ps -ef | grep "vi" | awk '{print $1}' | kill -9
Talk about intuitive There are some things I miss about Unix. The shell is super powerful. But as soon as you extend beyond moving around files and directories, and editing text, you find yourself deep in the mud. You just can't beat Windows for building robust user friendly applications, quickly.
-
Dec 7th, 2005, 03:19 AM
#19
Re: C++ Vs C#
I have buildt a crawler here at CERN in Python for Solaris...
-
Dec 7th, 2005, 07:46 AM
#20
Addicted Member
Re: C++ Vs C#
ASM is better
ASM is better - and you can write platform independent ASM given that the platform remains on the same processor architecture i.e. it'll run on another Intel/AMD PC but not a PowerPC. You just have to use the various GUI frameworks like GTK and stuff for gui - and other platform dependent stuff.
-
Dec 18th, 2005, 08:55 AM
#21
Addicted Member
Re: C++ Vs C#
I hear you. The only concern with needing the Framework is if your user downloading your app and is on a dialup connection.
If your users are still using dialup, then I think there are bigger issues at hand.
I think that its common place for most machines to have the framework installed, especially if you performing windows updates like we all should be.
Although I do agree that MS should start making software that can run on its own. But that would also just bring us back to the days when DLL's were a problem, not that were entirely free of that yet.
Visual Studio.Net 2003
"Every man has been made by God in order to acquire knowledge and contemplate."
--Pythagoras
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|