General Discussions

c++ or c#? – leet hacker

leet hacker

Member

Posts: 118
From: Hobbiton, Shire, Middle-Earth
Registered: 07-30-2007
i am planning on learning c# or c++ sometime soon, and i was wondering which one is easier to learn, and which one is better for certain things like games or text editors (or some other non-game application). does anyone know anything about this?

------------------
This post Copyright 2007 leet hacker. All rights reserved. No part of this post may be reproduced or transmitted in any form or by any means, electronic or mechanical, including quoting, without the express written consent of the author.
ISPN: 1-234567-890-1
Archive of Posts Catalog Card Number: 1234567890
10 9 8 7 6 5 4 3 2 1
You have express written consent to quote this post.

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
If anyone wants to reply to this thread, you can use this link as the normal one is messed up due to the # in the thread title. It's a buggy forum, but we still love the community.

Anyways, in answer to your question leet, it's hard to say which one is "best" because they both have advantages over each other.

However, to do Windows applications such as text editors or little utilities, I am personally much more comfortable working in C#. As far as games go, it could go either way, but I personally find C# easier to work with in that realm as well.

In addition, Microsoft has a site up called Coding4Fun where they have good blog posts and tutorials about things like game development. For instance, here's a 2D Game Primer that teaches you many important concepts that are fundamental to 2D development.

In case you don't already know about it, there are two free C# IDEs for you to pick between -- one is open source and called SharpDevelop, the other one is a free (and only slightly limited) version of Microsoft's Visual Studio called Visual Studio Express.

There are even tons more resources for learning C++ -- the hard part is just determining where to start. I'm of the opinion that it's a good idea to just pick something and run with it for a little while. Don't worry about creating a huge game at first -- just make some small and simple games to get your feet wet and test out some different approaches to game development.

I hope that helps!

In Christ,
clint

MastaLlama

Member

Posts: 671
From: Houston, TX USA
Registered: 08-10-2005
I second what Hanclinto has said.

C# is like the new model truck. You can still haul things drive it but the windows are electric and it has a butt warmer built into the seat.

The old truck has lots of miles on it and servicable parts are abundant but the new truck is from Asia and there will be tons more parts arriving from the manufacturers everyday!

Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
How does the C# truck handle on roads outside of Microsoftville? I heard about something in Linuxtown, but don't know much about it. Of course, my C++ 4x4 goes anywhere.

------------------
Brian

"OOP programmers have a lot of class"

Check out this webhost! Fantastic prices, features and support!

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
BrianT: I've had very good success using Mono -- it actually makes C# one of my languages-of-choice for cross-platform development -- it really handles a lot of the DLL/linking/library/makefile/autoconf annoyance that makes me eschew much of Linux development.
CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originaly Posted By BrianT:
How does the C# truck handle on roads outside of Microsoftville? I heard about something in Linuxtown, but don't know much about it. Of course, my C++ 4x4 goes anywhere.


Big Brainz, Inc. and Serious Games Interactive use the Unity game engine which uses the Mono platform for scripting in C# and Boo. It can create Windows or Mac standalone games (so there is no .NET used in the M$ Windows versions) and they seem to do quite well using non M$ .NET implementations in real world scenarios. I would use C# on Mac and Linux myself if I had the time to learn it.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Open source, open mind.

My Programming and Hacker/Geek related Blog

Calin

Member

Posts: 358
From: Moldova
Registered: 12-04-2006
This thread is beginning to look like a C# pajamas party but I will cast my vote for C# too. C++ will give you the .1% performance gain in your games but I don't think it's worth the sweat unless you're in the business of making nextgen games.

[awaits the C++ crowd rush over]

=]

------------------
Nanostorm: Machine Uprise

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
At work I use C/C++/UnrealScript (had to quickly learn Delphi/Pascal in 2 weeks to fix a bug too :S). At home I use C# for PC Applications, C++ for Games and J2ME for Mobile Development (mostly mobile games).

I won't "vote" for any language. Pick one you want to do based on what it'll help you with. What are your problems that you are trying to solve with the language? A language should be picked based on how it will help you solve a problem.

------------------
jonwarner.net

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
> This thread is beginning to look like a C# pajamas party

Exactly why I didn't respond.

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
If you are writing a text editor in Windows or Linux, you can't really beat C#.

If you are writing a game, it's a little different story. Most of the C#/.NET library support is for writing desktop applications and the sort, and not so much for games. That said, there are API's that _allow_ you to make games with C# and either the .NET or Mono runtimes. Most of the benefits of using C# are outweighed very quickly by the additional issues it creates. For example, C# is pretty handy for handling strings, and doing things like sorting lists for you and such, but you wouldn't want to use this built-in functionality for any kind of live action/realtime gaming, since these functions can consume a lot of memory, causing the garbage collector to automatically kick-in resulting in major frame rate hitching (the game pauses for a couple frames). All the blogs and many of the people I spoken to who have spent significant time working on game development in C# have told me that you spend more time worrying about memory management with C# than C++, since you have to constantly tip-toe around the garbage collector. Additionally, you can't in-line functions in C# as easily as C++, so you either take all the additional function call overhead speed hit, or manually inline the functions. The "for each" syntax is cool, but you shouldn't really use it in games, because it allocates memory on the managed heap, whereas using a regular "for" construction doesn't. I wonder why Microsoft hypes XNA so much, because they certainly didn't have games in mind when they designed the .NET runtime.

There, I crashed your pajama party.

------------------
+---------+
|steveth45|
+---------+

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
> There, I crashed your pajama party.

Exactly why I didn't respond.

I am still not totally convinced if C# is a viable gaming solution. Who was I talking with recently about this? I can't remember. I'm still confused about XNA. With MS pushing XNA so hard, wouldn't people know by now whether C# is capable or not?

[This message has been edited by ssquared (edited September 17, 2007).]

leet hacker

Member

Posts: 118
From: Hobbiton, Shire, Middle-Earth
Registered: 07-30-2007
quote:
If anyone wants to reply to this thread, you can use this link as the normal one is messed up due to the # in the thread title.

oh... hehe.

quote:
In case you don't already know about it, there are two free C# IDEs for you to pick between -- one is open source and called SharpDevelop, the other one is a free (and only slightly limited) version of Microsoft's Visual Studio called Visual Studio Express.

i did know about visual studio express but i didn't know about #develop. i will probably get #develop now that i know about it, and since it's open source, to replace vse. (i already had vse on my computer). thank you all for all your help.

133+

------------------
This post Copyright 2007 leet hacker. All rights reserved. No part of this post may be reproduced or transmitted in any form or by any means, electronic or mechanical, including quoting, without the express written consent of the author.
ISPN: 1-234567-890-1
Archive of Posts Catalog Card Number: 1234567890
10 9 8 7 6 5 4 3 2 1
You have express written consent to quote this post.

supercoder

Member

Posts: 37
From:
Registered: 08-20-2007
no! find a good book on c/c++ & hrdware lvl. this is will get you started right.
don't limit urself to net/mono mess.
when u relize u can now code anything from microctrllrs to unix mfrms youl be . oh, and c++ is still the industry stndard for game dev on pcs and boxs.
csharp pick up later.

------------------
>>>--supercoder--<<<

spade89

Member

Posts: 561
From: houston,tx
Registered: 11-28-2006
c++ is the best language but c# is the easiest and the most efficent and has lots of libraries.

as for c# on linux i tried using mono on open suse and it was a mess finally got mono to work but monodevelop wouldn't work i searched for about two weeks i think for a way to solve my problems even in this site and couldn't find any solutions it was so bad that i had to switch back to windows i actually bought a windows xp professional for about $64(including shipping ) and now i am a windows user again.

c# is a really nice language though.

------------------
John 14:6

Jesus answered, "I am the way and the truth and the life. No one comes to the Father except through me.

supercoder

Member

Posts: 37
From:
Registered: 08-20-2007
who WANTS to have mono anyway, ur better off without

------------------
>>>--supercoder--<<<

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally Posted by spade86:
as for c# on linux i tried using mono on open suse and it was a mess finally got mono to work but monodevelop wouldn't work


That's odd. I've never had that problem in either Gentoo, Ubuntu 6.10-7.04, or OpenSUSE 10.2. Did you install Mono from the OpenSUSE repositories or download it from Mono's web site? If you downloaded it from Mono's web site, that would probably explain why you had so much trouble, and why Monodevelop didn't work.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Open source, open mind.

My Programming and Hacker/Geek related Blog

spade89

Member

Posts: 561
From: houston,tx
Registered: 11-28-2006
@cpufreak

first of all i am spade89 not spade86

other than that i have tried downoloading it from lots of sources including open suse repositories the mono site ,the mono installer ,etc... i think i even built it from the source or something.

i spent weeks trying to figure it out and no luck.

i kinda gave up on doing anything serious on linux now although linux is cool and all.

it's too unreliable and too hard to port your programs i mean if you make a windows .exe you can run it on linux using wine but if you make a program for open suse you have to port it to .deb's fedora rpm's and you can't run it on windows.

------------------
John 14:6

Jesus answered, "I am the way and the truth and the life. No one comes to the Father except through me.

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:

who WANTS to have mono anyway, ur better off without

I've used Mono, and I would say that it is quite handy for cross-platform development of general desktop apps. I never had any trouble getting Monodevelop running in Linux. Mono is very close to being 100% compatible with the .NET libraries. This means you can use the Form designer that comes with .NET and easily port your app to Linux, or use Monodevelop's GTK-based form designer, and build cross-platform apps that way. Either way has to be 20 times easier than C++ for making standard GUI apps. MFC aside, even GTK+ and WxWidgets take quite a bit of fiddling when coding in straight C++ to do things that are trivial with C# and Mono.

I submit that you are better off with Mono, since it is another programming tool that may be used to great benefit under certain circumstances. Also, you'd be better off using standard English instead of constructions like "when u relize" or "ur".

------------------
+---------+
|steveth45|
+---------+

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally Posted by Spade86^H^H89:
@cpufreak
first of all i am spade89 not spade86


Sorry, that's what I get for emulating the quote info

quote:

other than that i have tried downoloading it from lots of sources including open suse repositories the mono site ,the mono installer ,etc... i think i even built it from the source or something.
i spent weeks trying to figure it out and no luck.


Huh. It's too bad you didn't post here, you might have gotten farther.

quote:
linux is cool and all.
it's too unreliable and too hard to port your programs i mean if you make a windows .exe you can run it on linux using wine but if you make a program for open suse you have to port it to .deb's fedora rpm's and you can't run it on windows.


I don't mean to argue, but that's exactly the way I feel about Windows: It's too hard to port to, unreliable, and there's the WINE equivalent for Linux called Cygwin. It's what we're used to and what we like best that we spend the most time on, and consider it familiar/easy/simple. (Which is why supercoder thinks mono/.net/C# is crap).

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

"Oh, bother," said the Borg. "We've assimilated Pooh."

Open source, open mind.

My Programming and Hacker/Geek related Blog

spade89

Member

Posts: 561
From: houston,tx
Registered: 11-28-2006
quote:

Huh. It's too bad you didn't post here, you might have gotten farther.


i did a huge part of the thread i created a while back called "c# help" is about this problem i had if you see it you will see the load of problems i had the lack of solutions i came up with.

quote:

I don't mean to argue, but that's exactly the way I feel about Windows: It's too hard to port to, unreliable, and there's the WINE equivalent for Linux called Cygwin. It's what we're used to and what we like best that we spend the most time on, and consider it familiar/easy/simple. (Which is why supercoder thinks mono/.net/C# is crap).


i didn't know about cygwin but i will check it out it's sounds cool though.

if you have noticed in most linux distros(at least the ones i have seen)
there is no such thing as warranty,linux is "as is" as the matter of fact try logging in from the console and it will show you that,that is not the case with windows.

before making and argument about this topic you should know that i used to be (and to a certain degree still am)a huge fan of linux i think the idea behind linux and the opensource industry is really cool.

and the command line interface(console) is far better than windows not to mention the graphics system(x) and it's use of multiple tty's and having multiple desktops and lots more.

and linux is extremley customizable to your needs,if there is something you don't like in linux in many cases all you have to do is modify the code or write a better code.

for a programmer who just loves low level stuff or even for the average user who just likes gui's and special effects and all that linux is the best.in windows it's hard to modify certain parts windows you don't like like the gui and not break the law/the eula you agreed to.


and there is lots more side effects on windows and positive sides of linux(plus it's free).

windows costs you money ,every time a new windows version comes out you will have lots of incompatibility issuse ,you maybe forced to buy new hardware(like in vistas case),lots of the software available for windows is not open-source,and i believe windows is targeted as the default os of attack by viruses worms ,trojans,spyware ,hackers and etc...

that being said although linux is popular in the developer community and to a cetain extent in the user community let's not forget that about 90% of the pc's on the planet are windows,windows has a reliable support and i believe a warranty although you pay money for windows what you get for your money isn't that bad and for most of the things that go wrong with windows and/or if and inconvenience is found in windows that means a job for programmers to come up with solutions meaning more jobs(eg. let us say there is a security flaw with windows that means an it company will have to come up with a solution).

and the easiest to use os is windows ,you don't have to have and extended knowledge of computers/coding to install your favorite game on windows while in linux you will have to know how to work in a command line enviroment what certain terms mean(i had to learn lots of new terms in linux than windows) ,you will have to risk seriously messing up your pc ( that is if you are the average computer illiterate person trying to get things done in linux) ,linux is very hard to configure ,really disorganized compared to windows(if you see it from a regular users point of view.

from a coders point of view windows is faster to get things done(imho),and lots more people get to use your software if you make it for windows.

and as for the support in linux and windows in windows you paid for your os so it's more reliable while in linux nobody is responsible for any potential flows in the os and if you have a problem there it's hard to find a solution if you are not a pc geek.

and windows is more solid since there is more money put into building it and lots of people supporting it and the people who coded windows were paid to do it.

i am sorry that we hijacked this thread but to say that it's easy for the average user to get things done in linux(like install new software/configure stuff) is not in my opinion true.

but let's not spin this to a really long thread about windows vs. linux.

getting back on topic i would liken c++ to linux and c# to windows(their pros and cons) i still really like c++ but it is easier to get things done in c# and it's more portable.

------------------
John 14:6

Jesus answered, "I am the way and the truth and the life. No one comes to the Father except through me.