Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tai_tiger

C# - Is it any good

This topic is 5912 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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++

Share this post


Link to post
Share on other sites
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?!?!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
What about OpenGL? It is compliant? (just like Visual C++ 6.0)

Share this post


Link to post
Share on other sites
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:

/// <summary>
/// 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

Share this post


Link to post
Share on other sites
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



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!