C# - Is it any good

Started by
34 comments, last by tai_tiger 21 years, 11 months ago
C#, is it any good? and if so how much easier is it to develop than Visual C. Also do Games Development stand a chance in the .NET environment? I have tried to write some DirectX routines in C# and didn''t get very far, so if anyone knows any tutorials or sites I would really appreciate the info. According to Microsoft, .NET technology is supposed to make games and DirectX apps run faster.. WE shall see i guess.. Tai
===========TAI================
Advertisement
C# is an interesting language. Its a bit closer to C++ than java is to C++ in "difficulty"/complexity and it offers alot of small things to make programming with the OOP paradigm easier/cleaner(allows you to define get and set method which can be accesed just like public variables for example).

As for game programming, it definetly isnt where its focus is right now, its much more oriented towards web and business applications(which it seems to well suited for, sporting the standard WIN GUI through a Java(swing)-like class framework for example). Direct directX support should be available with DirectX 9, so id guess that is something to wait for, before spending to much time learning C#.
On the other hand, access to C++ code and libraries arent supposed to be hard, but im not sure if this holds up in practice.

My reason for learning this language(the syntax and basic notions can pretty much be learned in a day, if you know C++ and java) is for tools development. Decent access to native/C++ code and the standard windows interface combined with its ease of use, are good reasons to use it for tools.

I cant see how .NET should allow faster programs, the big deal about is more that it is language-agnostic, that is, you can write some code in VB, some in C#, and some in C++ and then use them almost seamlessly together(at least thats the idea). If they also make it platfork independent, then this just might be a big deal.
I''ve done some playing with it and I tend to agree: it''s more towards C++ than Java was. On the surface they are very similar but underneath the languages tend to take different directions.

As said above I think it''s big contributions are going to be web pages, web services, and a replacement for the aging MFC. My initial look at the Windows forms code gave me a positive feel and hopefully one should be able to write equally superior windows apps in far less time and also in a far more object oriented and cleaner fashion than in MFC. Swing (Java), IMHO, never quite delivered so I betting MS is looking to fill that void with C#.

One nice thing is the interop between older COM components and newer C# classes. C# is supposed to be fast - I read C++ in Dev Studio 6 is optimized for a Pentium. C#, in theory, is supposed to take into consideration your particular processor class and its new and nifty features. However, I can''t validate that from personel experience yet. Anyhow, despite it''s theoretical vs. C++ speed, I would probably still write renderers in C++. The beauty is, though, with the COM interop having a tool or editor in C# speak to your C++ renderer is incredibly painless. C#/Windows Forms code is so superior to MFC I would seriously consider that route. Chances are you could save yourself a lot of time.

All in all I think C# stands to push development another leap forward. Having done Java and C++ (and liking both langauges for their very strong positives) I think C# brings yet another evolution to the table.

Sieggy
C# will be officialy a DX enabled platform at the release of DX 9 - it will be a very good choice for many games, but it''s said that performance will be a couple % lower than doing it in c++
---Quite soon...ICQ: 163187735
Had a play myself and like it. If you are still with C++ I would SERIOUSLY reccomend looking at C++ Builder first though as it has the EXACT syntax of C++ with many of the benefits of c# (set/get methods work in the same way). IMHO it will make the transition easier if you use this route.

One thing I don''t like about C# however is the way methods are defined in the body of the class (like JAVA). This always seemed to make finding methods so much harder to find and the header based approach to me is much simpler. I believe that the only reson to have the sntax this way is to simplify the compiler - which should not place a burden on the programmer when implemented - this does.

Otherwise I like it. Will look at it more though if DirectX 9 supports it directly........

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
quote:
One thing I don''t like about C# however is the way methods are defined in the body of the class (like JAVA). This always seemed to make finding methods so much harder to find and the header based approach to me is much simpler.


I can understand your point, but having header files is still having a double representation of the interface, and double representation is BAD(TM). When you are coding something, you continually switch back and forth between the header and the implementation file, and its annoying as hell getting compiler errors because you changed something in the implementation and forgot to make the same change in the header files.
If the header file was automaticly updated, it would be cool, but the VC# IDE can already show a list of methods/class, and anyway you are only a double click away from the definition.
What about OpenGL? It is compliant? (just like Visual C++ 6.0)
Also the VS.NET IDE can collapse method bodies into just their declarations, which is a great feature.

C# also supports XML-based documentation based on the new /// comment tag:

/// &ltsummary>
/// Some funny class.
/// </summary>

Then you can run a program that generates fancy HTML documentation (btw there are other doc tags other than ''summary'' ) It is very similiar to Java-docs.

C++ will still be the way to go when developing games, at least for now.

One awesome feature of the CLR is being able to generate classes and IL code at runtime and then executing that code. That is an amazing feature...





Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
quote:Original post by Dire.Wolf

Then you can run a program that generates fancy HTML documentation (btw there are other doc tags other than ''summary'' ) It is very similiar to Java-docs.

To add to that: The /doc switch to the compiler emits a pure xml file. You can then write your own XSL sheet to transform that into an HTML representation of your own design.

There''s also the open source tool NDoc[1], that can be used to create documentation files like the ones supplied with VS.NET.

[1]ndoc.sourceforge.net



--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by ALH
What about OpenGL? It is compliant? (just like Visual C++ 6.0)

Using OpenGL with C# is pretty easy. See [1].

[1] csgl.sourceforge.net

--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement