C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-15-2009, 04:30 AM   #1
Registered User
 
Join Date: Dec 2008
Location: California
Posts: 37
Why most of the people here on my school prefer this language?

They said that C# is better and easier than C++. They also said that I should stop coding in C++ and go to C# or java instead. I know how to code in C++ and java but never tried coding using C#. I love C++ over all of them. Are they right or wrong?
m3rk is offline   Reply With Quote
Old 04-15-2009, 04:51 AM   #2
Registered User
 
Join Date: Mar 2009
Location: england
Posts: 95
C++ and C# and completely different and almost incomparible. C# is much higher level, same as Java. Because of this they are both somewhat easier to use than C++, but easier doesn't always equal better.
theoobe is offline   Reply With Quote
Old 04-15-2009, 05:00 AM   #3
Mysterious C++ User
 
Elysia's Avatar
 
Join Date: Oct 2007
Posts: 14,785
That C# is easier and better than C++ is bogus. Same applies to Java.
C++ offers a lot of tools to help development and in the coming standard, even more so, making it easy to develop in C++ as well as very flexible and powerful. And it's also faster than both Java and C#.
What C++ mostly lacks is a standardized library of functionality aka dotNet and a graphical framework.
So that basically means it's like comparing apples and tomatoes. Use what you like.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 04-15-2009, 05:01 AM   #4
Registered User
 
Join Date: Dec 2008
Location: California
Posts: 37
Yeah, java was so easy. When I try to make a program in Java, everything was so easy. You just go on their API and look for the class that fits on what you need then you're done. But I just dumped it and continue studying C++.
m3rk is offline   Reply With Quote
Old 04-15-2009, 05:04 AM   #5
Mysterious C++ User
 
Elysia's Avatar
 
Join Date: Oct 2007
Posts: 14,785
Oh yes, another thing is that C++ is classed as native, and is mostly backwards compatible with C. Therefore, a lot of stuff, API and such is actually written for C and not C++.
This makes it a lot more difficult to use these things because C is a low-level language. Another flaw that adds negative points to the use of C++ in the real world, though it isn't really the language's fault.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System
I dedicated my life to helping others. This is only a small sample of what they said:
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 04-15-2009, 08:24 AM   #6
Registered User
 
valaris's Avatar
 
Join Date: Jun 2008
Location: RING 0
Posts: 468
Well those people will get some sense slapped back into them when they realize to get a job these days you usually need to know C++, and if you are applying for C# they ususally want ~10 years experience (which is ridiculous).

Besides the honest truth is that if you know C++ very well, transitioning to C# is quite easy.
valaris is offline   Reply With Quote
Old 04-15-2009, 10:35 AM   #7
Registered User
 
Join Date: Aug 2008
Posts: 188
learn both. and a dynamic language like python or ruby.
bling is offline   Reply With Quote
Old 04-15-2009, 02:00 PM   #8
Afraid of widths
 
medievalelks's Avatar
 
Join Date: Apr 2008
Location: Chicago
Posts: 887
Depends on what you're writing, doesn't it?
medievalelks is offline   Reply With Quote
Old 04-15-2009, 06:51 PM   #9
Cat
Registered User
 
Join Date: May 2003
Posts: 1,199
Quote:
Originally Posted by valaris View Post
Well those people will get some sense slapped back into them when they realize to get a job these days you usually need to know C++
That's been the diametric opposite of my experience; most of the listings I've seen want C# or Java.

Anyhow, to the original poster, they're different tools for different jobs. C++ gives you more control, but at the same time, it also is more complex.

Personally, when I write software for myself, I almost invariably use C# just because the development time is greatly reduced, and several common bugs are either caught at runtime (e.g. buffer overrun) or simply can't happen (e.g. memory leaks from failing to destroy objects).

GUI work is also fast and incredibly easy in C#. I used to do my GUI work in MFC back in the day, and before that I did pure WINAPI, and C# GUI work is almost a joke it's so simple.

Also, I like C# in that it is native Unicode throughout; in C++ I always used Unicode but it required additional developer work to use. I know any C# application will work with any file I have, regardless if the name is in english, chinese, korean, etc.
__________________
You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.
Cat is offline   Reply With Quote
Old 04-15-2009, 08:25 PM   #10
Ethernal Noob
 
Join Date: Nov 2001
Posts: 1,891
I work primarily in C# and while it is managed, that doesn't make it "easier" by any means. Making any kind of software requires you to know much more than the basics, and anyone still fighting over languages really miss the point. Great software has been made in both C++ and C#, even Perl, VB, and Ruby, so it's hardly the language, just the person behind the keyboard.
__________________
Here to Deceive, Inveigle, Obfuscate Since 1945
indigo0086 is offline   Reply With Quote
Old 04-16-2009, 07:54 AM   #11
Afraid of widths
 
medievalelks's Avatar
 
Join Date: Apr 2008
Location: Chicago
Posts: 887
Quote:
Originally Posted by Cat View Post
and several common bugs are either caught at runtime (e.g. buffer overrun) or simply can't happen (e.g. memory leaks from failing to destroy objects).
As with Java, there seems to be a lot of hand-wringing in the C# community on how to detect and remedy memory leaks.
medievalelks is offline   Reply With Quote
Old 04-16-2009, 08:03 AM   #12
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 11,355
Quote:
Originally Posted by medievalelks View Post
As with Java, there seems to be a lot of hand-wringing in the C# community on how to detect and remedy memory leaks.
Heh, one of the articles listed by the search made me chuckle: "no-one could have enjoyed having to write destructors for every single one of their C++ classes".
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is online now   Reply With Quote
Old 04-16-2009, 08:23 AM   #13
Afraid of widths
 
medievalelks's Avatar
 
Join Date: Apr 2008
Location: Chicago
Posts: 887
Quote:
Originally Posted by laserlight View Post
Heh, one of the articles listed by the search made me chuckle: "no-one could have enjoyed having to write destructors for every single one of their C++ classes".
The anti-C++ propaganda fomented by the Java and C# communities is fun to read sometimes.

C# is very much like Java re: memory. You don't have to manually manage it, until you do. The sales schtick by the snake oil salesmen of both languages has doubtless led to sloppy, leaking code.

Last edited by medievalelks; 04-16-2009 at 08:39 AM.
medievalelks is offline   Reply With Quote
Old 04-16-2009, 10:12 AM   #14
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,768
Quote:
Originally Posted by laserlight View Post
Heh, one of the articles listed by the search made me chuckle: "no-one could have enjoyed having to write destructors for every single one of their C++ classes".
I don't enjoy writing destructors, or copy constructors for that matter. So I don't. Pretty much none of my classes require them.
__________________
"Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot
brewbuck is offline   Reply With Quote
Old 04-16-2009, 06:51 PM   #15
Cat
Registered User
 
Join Date: May 2003
Posts: 1,199
Quote:
Originally Posted by medievalelks View Post
The anti-C++ propaganda fomented by the Java and C# communities is fun to read sometimes.

C# is very much like Java re: memory. You don't have to manually manage it, until you do. The sales schtick by the snake oil salesmen of both languages has doubtless led to sloppy, leaking code.
In general, though, C# memory leaks happen in three basic ways:

1. You actually have a pointer to the memory somewhere that you haven't gotten rid of. Not truly a leak, just bad coding.

2a. You called unmanaged code that allocated memory, without freeing it.

2b. You used a GDI object without disposing it. Technically this isn't a permanent memory leak, as during finalization the memory is returned, but that will happen at some indeterminate point in the future when the GC feels like it.

And yeah, while you can't completely ignore C# memory management, it has a lot of advanced stuff as default -- for example, it will dynamically move objects in memory to avoid memory fragmentation. Doing THAT in C++ is a huge pain unless you code with that in mind from the first line.
__________________
You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.
Cat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming language - Which one should people learn today? Christopher2222 General Discussions 25 09-25-2008 08:17 AM
Should it be legalized? abachler General Discussions 168 06-08-2008 08:56 AM
What language did they make Java in? jverkoey General Discussions 17 07-03-2005 04:18 PM
Strange loop D@rk_force C++ Programming 22 12-18-2004 02:40 PM
Religious Bull**** Witch_King A Brief History of Cprogramming.com 119 10-23-2001 07:14 AM


All times are GMT -6. The time now is 09:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22