which to learn: C# or C++?

dpopiz

Diamond Member
Jan 28, 2001
4,454
0
0
I have barely any "real" programming experience, but I am pretty familiar with some easy web languages like php and such, and I know coldfusion by heart. in any case, I want to learn a real language where I can do a lot. c++ is I guess the traditional choice, but I've been reading a lot about C# and it interests me. I'm looking for something that will allow me to write windows applications with no limit to what they can do, avoid unnecessarily tedious work, and if at all possible also run fast.
which one would you recommend?
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
If your aim is to avoid unnecessarily tedious work AND you have access to Visual Studio .NET, I would go with C#.
 

manly

Lifer
Jan 25, 2000
12,929
3,700
136
If you're light on programming experience, C# is a much better language to learn on. It also fits the other criteria you mentioned: ease of use and high productivity. As for runtime performance, it should run "fast enough".

I just wanted to chip in my 2 cents before the 1337 C++ hackers chime in. ;)
 

beer

Lifer
Jun 27, 2000
11,169
1
0
C++. I would say C but that wasn't an option.

Why, do you ask? Because C# works on the principles of C++; C++ works on the principles of C. All of the features that C++ has that C does not are simply window dressing - they make things a bit easier. You learn pointers, malloc() and free() best with C; if you start off with a higher abstraction you won't necessarily understand what is actually happening at the machine level which makes things harder to debug.

True story: My roommate, who didn't bother learning C.... "What? I can't pass a 500x500 array as a parameter to a function? When did THAT happen?!?!"

But then it depends on what kind of applicatiosn you plan on writing, too.

I'm just speaking as an EE
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Python is more established than C#, and runs great on all platforms NOW (vs. mono and all that junk that is trying desperately to keep up with MS), is easy, and powerful.

But languages like Python and C# are very different from C++. C++ is a lot more tedious work, as you put it.
 

manly

Lifer
Jan 25, 2000
12,929
3,700
136
Originally posted by: notfred
I would learn C++ because C# is too MS-centric.
Cool, now we just need to wait for Descartes' obligatory "C# and the CLR are ISO standard technologies embraced by MS, Ximian, et al" post. ;)

To be clear, I'm not flaming Descartes. I think we agree on more things than we disagree. I'm just not sure how MS gives him the warm fuzzies, that's all. :)

Elemental007,

Arguably, you're supposed to learn programming from as high a level of abstraction as possible. Otherwise, we'd all still be flipping switches on a switch-panel to enter machine language instructions, and reading back binary output from a row of LEDs. And characterizing first-class OO language features as window dressing is simply incorrect.

There's nothing from learning C# that would prevent one from effectively learning C/C++ later on and becoming a systems programming guru anyway.
 

JetBlack69

Diamond Member
Sep 16, 2001
4,580
1
0
Does the .NET framework work on NT or 95/98? You might need to consider that if you plan on having users in those OSes.

If you know java, C# will be easier to learn IMHO.
 

PrincessGuard

Golden Member
Feb 5, 2001
1,435
0
0
The .NET framework does work on Win9x/ME (though the SDK doesn't). However, it is a 23MB download, which you should take into consideration if you're going to distribute your programs.
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
I would go with C++. It's more established and available. It also gives you more flexibility imho. You can do anything with it. It might be more work but once you are good with C++ learning languages like C# or Java would be easy.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: Elemental007
C++. I would say C but that wasn't an option.

Why, do you ask? Because C# works on the principles of C++; C++ works on the principles of C. All of the features that C++ has that C does not are simply window dressing - they make things a bit easier. You learn pointers, malloc() and free() best with C; if you start off with a higher abstraction you won't necessarily understand what is actually happening at the machine level which makes things harder to debug.

True story: My roommate, who didn't bother learning C.... "What? I can't pass a 500x500 array as a parameter to a function? When did THAT happen?!?!"

But then it depends on what kind of applicatiosn you plan on writing, too.

I'm just speaking as an EE

What he said. (Speaking as an EE/CE.) I made this after being forced to use java for CS classes... and then going back to C and C++.

Originally posted by: BingBongWongFooey
Python is more established than C#, and runs great on all platforms NOW (vs. mono and all that junk that is trying desperately to keep up with MS), is easy, and powerful.

But languages like Python and C# are very different from C++. C++ is a lot more tedious work, as you put it.

Come back to me when you can write a REAL app in your weekly scripting language of choice ;)
 

PowerMacG5

Diamond Member
Apr 14, 2002
7,701
0
0
I would go with C#. This language will be around for years to come, and only be improved upon. Microsoft has slated at least two more revisions on the .NET Framework in the coming 3 years, along with two more versions of Visual Studio .NET. THese are codenamed Whidbey and Orcas. Whidbey is slated to come out along side SQL Server Yukon, and Orcas is slated to come out along side Windows Longhorn.

EDIT: As also pointed out, C# and the CLR are ISO standards.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
Originally posted by: KraziKid
EDIT: As also pointed out, C# and the CLR are ISO standards.

However that says nothing about their current implementations on non-windows platforms, which, as far as I know, suck.
 

dpopiz

Diamond Member
Jan 28, 2001
4,454
0
0
as I said in my first post, I don't care about writing for non-windows platforms.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: dpopiz
as I said in my first post, I don't care about writing for non-windows platforms.

No you didn't, you said you wanted to write windows programs, you didn't say that you ONLY wanted to write windows programs.
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
Based on what you've said, VB is probably a good choice.

-You can do a lot with it
-You can start making really neat apps quickly
-you'll avoid a lot of tedious work (no memory to worry about)
-no limits
-as far as speed is concerned, your programs are only as fast or slow as you make them
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
You don't care about other platforms now ... but why tie yourself to what will likely be effectively a single platform language? And subject to Microsoft's whims as far as compatibility of future versions. C++ runs almost anywhere and has alot more R&D behind it then C# ikely ever will.
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
You don't care about other platforms now ... but why tie yourself to what will likely be effectively a single platform language? And subject to Microsoft's whims as far as compatibility of future versions. C++ runs almost anywhere and has alot more R&D behind it then C# ikely ever will.

Bear in mind, programs written in C++ will vary wildy depending on the platform they are targeted for.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Based on what you've said, VB is probably a good choice.

VB is never a good choice. Doing anything more than wrapper or database programs requires a lot of extra work to use the Win32 API or buying 3rd party controls and it practically encourages bad programming habits.

Bear in mind, programs written in C++ will vary wildy depending on the platform they are targeted for.

Only certain parts, mostly just the UI as long as you're carefull to stay within the STL. If you seperate the core logic from the UI it's not a big deal to move between widget sets.
 

Kntx

Platinum Member
Dec 11, 2000
2,270
0
71
VB is never a good choice. Doing anything more than wrapper or database programs requires a lot of extra work to use the Win32 API or buying 3rd party controls and it practically encourages bad programming habits.

Damn VB haters. You can do anything in VB. Yes, tons of people use it for database because you can get it up and running fast. But you can make any sort of program from databases and wrappers, to productivity apps, to full 3d games if you were so inclined. As far as buying 3rd party controls, that is up to the programmer. Buy 'em or make 'em. Choice is yours.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: Kntx
VB is never a good choice. Doing anything more than wrapper or database programs requires a lot of extra work to use the Win32 API or buying 3rd party controls and it practically encourages bad programming habits.

Damn VB haters. You can do anything in VB. Yes, tons of people use it for database because you can get it up and running fast. But you can make any sort of program from databases and wrappers, to productivity apps, to full 3d games if you were so inclined. As far as buying 3rd party controls, that is up to the programmer. Buy 'em or make 'em. Choice is yours.

Anything decent that you buy will be a DLL written in C/C++ which is called from vb anyway. How would you make something advanced in VB if you don't know C++?
 

dpopiz

Diamond Member
Jan 28, 2001
4,454
0
0
well I don't know much about vb, but what I do know is that every vb program I've used is extremely slow and usually badly written/buggy
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
As far as buying 3rd party controls, that is up to the programmer. Buy 'em or make 'em. Choice is yours.

Yes and making them is a PITA because of all the hoops you have to jump through to get access to the Win32 API.