Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Why C# XNA When Everyone Wants C/C++


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • This topic is locked This topic is locked
165 replies to this topic

#21 Bru   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 March 2009 - 08:16 AM

Quote:
Original post by Imgelling
"but also the fact that c# is bound to windows"

That is not a fact, http://mono-project.com/Main_Page

tbh even if you can use this mono thing to run .net stuff on non windows systems, you can still say c# is bound to windows. if you make a serious and big game i am not sure you want to make the clients install stuff like that(beside i am not sure its if its very legal advertise mono with your game this way.
dont think i am a complete idiot, i am not talking with confidence just what i belive might be true.

Sponsor:

#22 Imgelling   Members   -  Reputation: 222

Like
0Likes
Like

Posted 04 March 2009 - 08:20 AM

Don't you have to install the .Net Framework for Windows too?
Don't you have to install the correct version of DirectX9 (according to the SDK the programmers used) to play those games?




#23 swiftcoder   Senior Moderators   -  Reputation: 10440

Like
0Likes
Like

Posted 04 March 2009 - 08:21 AM

Quote:
Original post by Bru
tbh even if you can use this mono thing to run .net stuff on non windows systems, you can still say c# is bound to windows. if you make a serious and big game i am not sure you want to make the clients install stuff like that
How is it any worse than requiring your windows customers to install the .net runtime?
Quote:
(beside i am not sure its if its very legal advertise mono with your game this way).
Please do us all a favour, and take the time to research the topic a little. It is perfectly legal to distribute mono with an application.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#24 Drilian   Members   -  Reputation: 1025

Like
0Likes
Like

Posted 04 March 2009 - 08:22 AM

Quote:
Original post by Bru
tbh even if you can use this mono thing to run .net stuff on non windows systems, you can still say c# is bound to windows. if you make a serious and big game i am not sure you want to make the clients install stuff like that(beside i am not sure its if its very legal advertise mono with your game this way.
dont think i am a complete idiot, i am not talking with confidence just what i belive might be true.


Okay. So, let me get this straight:

You can run .net code on non-Windows systems, but you don't count it because...uh...because installers might not want to install the mono runtime?

I think, if you're not confident about what you're saying, it's better to just NOT SPEAK than it is to keep spreading falsehoods and incorrect assumptions as fact.

#25 dascandy   Members   -  Reputation: 216

Like
0Likes
Like

Posted 04 March 2009 - 08:23 AM

Quote:
Original post by swiftcoder
This is one of those myths you see thrown around regularly, which has no factual basis whatsoever: any language can be decompiled, and a decent programmer can read raw assembly code without much trouble. If your security, etc. relies on obsfucated source code, it is worth exactly zero.


That's hardly true, now is it. I've made two classes in C++ to wrap mutex handling (mutex and lock class), made a construct involving a for loop and an operator bool() to allow


locked(mutex_name) {...}

to do exactly what you expect. The compiler removed *everything* except for the contents of the mutex_lock() and mutex_unlock() functions.

There's no way you'll get *that* back from the assembly code as it's just plain not there.

IL code is much more directly related to the origin language(s) and can be decompiled much more easily. It's also a higher-level language expressing more about the program - so it's inherently easier to understand. Assembly doesn't know objects and classes, IL does because it has to (JIT type-safety checking).

#26 dlangdev   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 March 2009 - 08:23 AM

OMG, this place is overrun by the C# horde!

For game development, my vote goes to C++ which is very obvious because most of the engines/SDKs I deal with are all written in C/C++.

You know, Bullet is written in C++. PhysX is written in C/C++.

#27 Imgelling   Members   -  Reputation: 222

Like
0Likes
Like

Posted 04 March 2009 - 08:31 AM

Quote:
Original post by dlangdev
OMG, this place is overrun by the C# horde!

For game development, my vote goes to C++ which is very obvious because most of the engines/SDKs I deal with are all written in C/C++.

You know, Bullet is written in C++. PhysX is written in C/C++.


Your reply would be different if you started programming with C# first, I'm sure. Then it would read...

For game development, my vote goes to C# which is very obvious because most of the engines/SDKs I deal with are all written in C#.

That Bullet and PhysX thing...don't understand how that fits in, but oh well.


#28 dlangdev   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 March 2009 - 08:37 AM

There ya go, you have to take in consideration the SDKs that are out there.

#29 Imgelling   Members   -  Reputation: 222

Like
0Likes
Like

Posted 04 March 2009 - 08:42 AM

Bullet also works for C#
http://www.gamedev.net/community/forums/topic.asp?topic_id=452106

So does PhysX
http://imaginary-project.net/physx-sharp/

Thats why I didn't understand why you posted them.

#30 Josh Petrie   Moderators   -  Reputation: 3892

Like
0Likes
Like

Posted 04 March 2009 - 08:44 AM

Quote:

That's hardly true, now is it. I've made two classes in C++ to wrap mutex handling (mutex and lock class), made a construct involving a for loop and an operator bool() to allow

I think he point was more that it is possible (it's certainly not easier to grok raw assembly produced from machine code). This seems related to my point that it doesn't matter that mucking about in assembly is harder than mucking about in something Reflector produced, because hackers mastered the art of the former years ago so it's pretty easy to them anyways.

Quote:

You know, Bullet is written in C++. PhysX is written in C/C++.

Who cares what the SDK is written in, if you can still use the SDK from within your desired language? You know that good chunks of Windows and Direct3D aren't C++, right?

It's (in general) irrelevant so long as you can use the SDK.

Quote:

OMG, this place is overrun by the C# horde!

Don't make silly such statements. Correcting the misapprehensions of one who (admittedly) knows little of the subject is not indicative of being part of any kind of 'horde,' and there's no reason to put such a negative implication there.

Josh Petrie | Game Developer, Undead Labs


#31 Greycrow   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 March 2009 - 08:53 AM

C++ vs. C# is a HOT topic these days.
I pearsonally try to keep up with both.

Here are 3 reasons I think most apps (99%!) are NOT written in .NET

1) OLD habits die hard. We learn C and C++ in school. So we become comfortably with the language. It's hard for people to try to learn a whole new (And I mean that) language like c# when they are use the old. I think that's wrong thinking if you are looking for a JOB in programming. You need to learn it ALL.

2) ABSTRACTION - This may be reason number one. If you are just staring out in programming, c# is a very abstract language. It is not as close to the machine, and so some people feel disconnected from it. C is very close to the machine.
Assembler is even closer. programming in C we feel that connection more strongly. But again I still think we need to learn it ALL.

3) There are things in c# that are just plain frustrating in c# and some people just give up and do it in C. You could argue perhaps that you just don't know enough about the language to do it. But does ANYONE really know all of it?. No , of course not. I've seen PHD's stumped by .NET.

4) C books are 200-300 pages. C# books are up to 1500 pages!. Which is easier to learn?

5) If I had to learn programming again I would still take the same path:
a) C
b) C++
c) The API
c) Assembler
d) C#
e) Java
f) ASP
ect.









#32 Telastyn   Crossbones+   -  Reputation: 3730

Like
0Likes
Like

Posted 04 March 2009 - 09:07 AM

Quote:
Original post by Greycrow
3) There are things in c# that are just plain frustrating in c# and some people just give up and do it in C. You could argue perhaps that you just don't know enough about the language to do it. But does ANYONE really know all of it?. No , of course not. I've seen PHD's stumped by .NET.


Having worked with PhD's out of academia, I am not surprised.

Though frankly, I suspect the average C# programmer knows more about that language than the average C++ programmer does theirs. And really, the number of things that are frustrating to do in C# (bit fiddling, certain buffer tasks, certain scripting tasks) are far fewer than things that are frustrating to do in C (anything involving strings, anything involving a UI, anything involving containers).

Quote:

4) C books are 200-300 pages. C# books are up to 1500 pages!. Which is easier to learn?


That's odd. All the C++ books I know of tend to be the 'bible' sort, and even then need to be supplemented with Josuttis' Standard Library book and some of Meyers' texts. (to be fair, K&R is nice and concise, but plain C is not exactly practical for many apps [imo])

#33 Greycrow   Members   -  Reputation: 122

Like
0Likes
Like

Posted 04 March 2009 - 09:20 AM

Those are some good points.

I did mean c and not c++ when it came to book size. Do even get me started on c++ and all of its so called helpers ... lol

grey






#34 swiftcoder   Senior Moderators   -  Reputation: 10440

Like
0Likes
Like

Posted 04 March 2009 - 09:25 AM

Quote:
Original post by Greycrow
We learn C and C++ in school. So we become comfortably with the language.... I think that's wrong thinking if you are looking for a JOB in programming. You need to learn it ALL.
QFE - I learned programming on my own, largely influenced by what I observed from the luminaries on this very forum. I started with C, Objective-C and C++, learned all of tem quite thoroughly, and moved on to Python and Java.

By the time I first took a formal programming course in University, I possessed programming skills on a par with the final-year grad students. Most students here learn only the C/C++ or Java they are taught in courses, and this often severely limits the ability to think through a problem/think outside the box.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#35 Washu   Senior Moderators   -  Reputation: 5605

Like
0Likes
Like

Posted 04 March 2009 - 09:27 AM

Quote:
Original post by Greycrow
C++ vs. C# is a HOT topic these days.
A rather frequent topic, and generally a silly topic.
Quote:
I personally try to keep up with both.

Good.
Quote:
1) OLD habits die hard. We learn C and C++ in school. So we become comfortably with the language. It's hard for people to try to learn a whole new (And I mean that) language like c# when they are use the old. I think that's wrong thinking if you are looking for a JOB in programming. You need to learn it ALL.

I've done FORTRAN. I had no problems learning C#. If you're stuck in the old ways, perhaps it's not that it's hard to learn, but that you’re just stuck in the old ways and resistant to change.
Quote:
2) ABSTRACTION - This may be reason number one. If you are just staring out in programming, c# is a very abstract language. It is not as close to the machine, and so some people feel disconnected from it. C is very close to the machine.
Assembler is even closer. programming in C we feel that connection more strongly. But again I still think we need to learn it ALL.

You are really no more closer to the machine in C/C++ than you are in C#. All three of them run against a reference machine that exhibits certain behaviors. Furthermore with modern things such as virtualization, virtual memory (old idea really), etc. you are quite distant from the actual hardware. The same is true of assembly as well.
Quote:
3) There are things in c# that are just plain frustrating in c# and some people just give up and do it in C. You could argue perhaps that you just don't know enough about the language to do it. But does ANYONE really know all of it?. No , of course not. I've seen PHD's stumped by .NET.

There are plenty of things in C++ that are extremely painful to learn/do.
Quote:
4) C books are 200-300 pages. C# books are up to 1500 pages!. Which is easier to learn?

C#. Because you’ll be up and running in an hour or less. Those 200-300 page books also generally start with “Learn” and end with “in 21 days.” Which is generally a prime example of exactly why C++ shouldn’t be your first language, also the C++ standard is over 700 pages.


#36 Imgelling   Members   -  Reputation: 222

Like
0Likes
Like

Posted 04 March 2009 - 09:33 AM

At least you all had decent computers to start on, my first language was BASIC that ran on a computer that only ran BASIC programs off those big floppy discs. After I got my next Super Computer (IBM PS/2 386 16mhz with 2meg RAM, 40meg Harddrive, 2400baud modem), moved on to Pascal w/ assembly (the days when mode 13h was king), to C, to some C++ (mostly C code with .cpp on the end), then c# and have never looked back. It was just easier for me. And that is another reason I suggest C#.

And I know I shouldn't complain about that first computer, at least it wasn't punch cards.



#37 Intrawebs   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 March 2009 - 09:43 AM

Wow, I go have lunch and all hell breaks loose.

I think Greycow put it nicely, "we need to learn it all". Now for a beginer (which Im not to programming) I still don't know which would be best to start with. For me however, since I've been working with c# for years I will start my game dev experience with c++.

I've always felt I never had a solid foundation that all the other skills can stand on, and what better way to get that than doing something fun like game dev.

Thanks everyone!



#38 Drilian   Members   -  Reputation: 1025

Like
0Likes
Like

Posted 04 March 2009 - 09:45 AM

I guess, here's the thing, for me:

I have done a lot of C++. Well more than a decade of it. I work in C++ at my job. I'm fairly comfortable with it.

However, I use C# whenever I can, such as in my home projects. I haven't seen a performance penalty on my PC for using it, and even if there is one, it's minor enough that I don't care. Whatever I (hypothetcally) lose in the (hypothetical) tiny performance drop is more than made up for by the amount of work I can get done at one time.

C# is easy to work with. When I'm coding in C#, I feel like I'm working on my PROJECT, and not wrestling with the language to get it to do what I want. It generally allows me to focus on the high-level side of my algorithms instead of having to get bogged down in the details.

So say whatever you want about "OMG C# PERFORMANCE IS CRAP" or "Every professional developer uses C++ so obviously C# is crap", but for my productivity, C# is an invaluable asset.

#39 Fiddler   Members   -  Reputation: 856

Like
0Likes
Like

Posted 04 March 2009 - 10:02 AM

Quote:
Well, the Playstation 3, the Wii, the PSP, and DS are all still relevant. Mac and Linux aren't, for better or worse.

Mac and Linux aren't relevant? The makers of World of Goo would beg to disagree:
Quote:

Update 4: It’s only been 2 days since the release of the Linux version and it already accounts for 4.6% of the full downloads from our website. Our thanks to everyone who’s playing the game on Linux and spreading the word. Here are a couple of nifty stats:
[...]
More copies of the game were sold via our website on the day the Linux version released than any other day. This day beat the previous record by 40%. There is a market for Linux games after all :)


[Edited by - Fiddler on March 4, 2009 4:02:34 PM]

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]


#40 dlangdev   Members   -  Reputation: 100

Like
0Likes
Like

Posted 04 March 2009 - 10:41 AM

You guys are getting olllllddddd, two pages and it's all over.

By the way, you call that C# binding of Bullet & PhysX SDK?

Come on!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS