pouët.net

Is C# worth a look?

category: general [glöplog]
 
Hello,
i want to start learning C# / XNA. Is it possible to create demostuff with it too? I have read something bad about C#. Whats your opinion? Better work with C / C++ or C# is it worth a look?
added on the 2008-12-15 05:58:26 by dcclark dcclark
I used to have a 3D engine working in 100% C# (on .NET 1.0) back in 2004. Your main concern when using .NET should be portability... but if it's not a concern... go for it.

Optimizing to get every possible cycle from the CPU is not really needed nowadays... plus, the .NET JIT does indeed a very good job. Might not be as fast (on the CPU) as C or C++ but it's not really needed if your engine's architecture is good.

Not sure about XNA for demos though, have never tried XNA myself.
added on the 2008-12-15 07:20:20 by Jcl Jcl
imho it's a good platform even if there is of course a performance hit - that might be absolutely acceptable as jcl suggests.
i think the main problem for demos as of is with with compo rules (forget anything >= 64k eg).
added on the 2008-12-15 07:35:52 by makc makc
For demos C# is ok. It will cut some horsepower from your cpu-budget, and will not allow you to do some of the tricks (with pointers etc) you are used to from C/C++.

XNA is a good and intuitive framework. However, it is a pain in the ass library to use when it comes to resource (asset) management. It takes control of the entire "content pipeline" as it calls it, everything has to go through XNA's content preprocessing engine (you don't get real access to the file system). Its probably good for beginners, but if you prefer to control these things yourself you are up for some resistance.
added on the 2008-12-15 08:08:20 by Duckers Duckers
By the way... about the CPU... C# doesn't really have to be slower. Meaning: C/C++ should be faster if your program is well designed... but making a good program design in C/C++ is much harder and requires much more skills than doing it in .NET. As I said, the optimizing compiler and the JIT compiler both do a great job.

Also, if you have any algorithm that benefits hugely (in terms of performance) from using pointer arithmetics, nothing stops you from implementing that algorithm in unsafe/unmanaged C++ and call that from .NET (don't know if it's possible to do it on XNA though, more likely not).
added on the 2008-12-15 08:51:35 by Jcl Jcl
Here is a nice C# vs C++ benchmark : http://www.gup.uni-linz.ac.at/~gk/Code/GlutGrafik/ray.html

Of course, things will have changed a little since the introduction of VC++/VC# 2008.
added on the 2008-12-15 11:40:25 by trc_wm trc_wm
C# is quite nice, especially for the average applications. When I coded a 3D engine in it I sometimes wished I was coding C++ though, missing all the nice pointer tricks :)
With XNA you can step outside the content framework and load files directly if you like. If you want your app to be cross compatible with the xbox360 though this can’t be used.

I recently did a shit demo using XNA on the 360 as my first attempt to learn pc demo programming (http://www.pouet.net/prod.php?which=52078). I found it really easy to use and managed to find a lot of blogs to help get started.

If you want to get started quickly, XNA provides a lot of code such as the main game loop, timing etc that gets you concentrating on learning the graphics side of things.

It does weird things with rendertargets and depth buffers that are different to dx so it can catch you out if you are reading non XNA materials.

Also size coding is basicly impossible and forcing the user to install the XNA framework before they can watch your demo may or maynot annoy you or the user.
added on the 2008-12-15 15:53:12 by iTeC iTeC
sure the xna can read and write regular files on xbox360 as well, just add files to content "pipeline" and it'll copy them into the deploy package.
added on the 2008-12-31 21:33:13 by jmagic jmagic
I stand corrected 8)

Another limitation is sound if your trying to target XBOX. With windows nothing stops you stepping outside XNA and using some other playback system though with XNA's native sound crapola (pretty much XACT) you can't access any sound buffers directly.

I.E say good by to soft synths etc
added on the 2009-01-01 04:01:26 by iTeC iTeC
i ported AHX player to x360, it writes PCM data to xna soundbank :) I can try to find the code if you are interested
added on the 2009-01-01 09:30:10 by jmagic jmagic
definately, that would be very nice!
added on the 2009-01-01 13:59:33 by iTeC iTeC
I developed a game with C# and XNA. My conclusion is that XNA makes your life easier and leads faster to results if you are a beginner. But with a little more effort, you could also implement everything with C++ and DirectX or OpenGL. You just have to code or rip routines for displaying bitmaps, creating and handling windows, processing keyboard and mouse, and getting the tick count. Once you've done this, you won't need XNA any more.
added on the 2009-01-01 15:22:28 by Adok Adok
C# is simply a fail , .NET in general ..
added on the 2009-01-01 17:42:23 by panic panic
"Sponsored feature"
added on the 2009-01-01 18:49:00 by stijn stijn
"
"Sponsored feature"
"
Adok I think you have missed the whole c# vs c++ point there
added on the 2009-01-01 23:07:36 by iTeC iTeC
Quote:
i want to start learning C# / XNA. Is it possible to create demostuff with it too?

these days you can write demos in any fucking self-respecting language, including C#, python, java, lisp, ocaml, haskell, assembly, whatever. In fact, C++ would be probably my last choice. So don't worry, go for C#. Or even better, F#.
added on the 2009-01-01 23:59:16 by blala blala
you know why c# is great for database-handling?

'cos C# = Db!

HA HA HA.
added on the 2009-01-02 00:49:54 by Gargaj Gargaj
the idea behind .NET framework is gah imo >.>;
added on the 2009-01-02 01:21:23 by panic panic
mix managed and unmanaged code like real men!!!!!

login