Archived

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

tai_tiger

C# - Is it any good

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
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
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
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
I believe the C# compiler is a free download with the .NET Framework SDK. But the VS.NET IDE is not.

Personally, I''m loving C#. It''s more like C/C++ than Java is, it''s easier to use than VB(coming from a strong C/C++ background) and the VS.NET IDE is 1000x better than any of the Java IDEs. I''ve been fooling around with it learning the .NET class library and figuring out the IDE. It''s a sweet language for building your GUIs. My thinking is that it''s still a good idea to develop serious backends in C++, but I''d much rather write my GUI code in C# than C++.

Share this post


Link to post
Share on other sites
I''m with you on the Java IDEs. I use JDeveloper at work and its the worst piece of crap I''ve come across. I have Forte at home which isn''t too bad but DevStudio.NET absolutely rocks in comparison still. It''s a joy to use.

Sieggy

Share this post


Link to post
Share on other sites
As to Java IDEs, i usually use JBuilder Foundation(totally free).
Its a HUGE GIGANTIC resource hog(try starting it on a 16MB laptop(it takes about 1.5 hours to start, and loads 30-60 secs for registrering a mouse click!) but is otherwise alright.

Share this post


Link to post
Share on other sites
herm.. well, I just downloaded the .NET framework SDK, and the only compiler I got was the vc7 compiler.. didn''t see anything regarding c# or vb.net

Share this post


Link to post
Share on other sites
I thought C# was very cool and I got even more excited when I found the C# Graphics Library ( http://csgl.sourceforge.net/ ). Then the bubble was burst when I discovered the 20MB .NET Framework runtime I''d have to distribute with my apps (or require end users to download from MS) if I want anybody to be able to run them. That looks like the number one Bad Thing about the whole .NET deal for the near future, until you can count on most people having the framework installed.

Share this post


Link to post
Share on other sites
quote:
Original post by daerid
herm.. well, I just downloaded the .NET framework SDK, and the only compiler I got was the vc7 compiler.. didn''t see anything regarding c# or vb.net

The C# compiler is called csc.exe, the VB.NET compiler vbc.exe. Search for them.

Share this post


Link to post
Share on other sites
quote:

when I discovered the 20MB .NET Framework runtime I''d have to distribute with my apps



I cant really see that this is a major with games, as they are usually distributed on CDs. And for development tools, youll already have it installed....
Anyway windows auto-update installs it, so anybody who runs auto-update will probably already have it.
And anyway it isnt any worse than java(WindowsXP doesnt have a Java VM, you are asked to download it the first time you encounter, say and applet).

For small GUI applications this can be annoying, but thats always a problem, even with Visual Basic and MFC.

Share this post


Link to post
Share on other sites
The runtime is probably out on half of the windows machines out there. It was put on the Windows Update site at least a month ago. I''m guessing that a good portion of the world already has it installed. And 20MB isn''t a big deal, even 56k users can download that in an hour and a half or so and they only need to do it once.

Share this post


Link to post
Share on other sites
quote:

even 56k users can download that in an hour and a half



Actually i think a lot of users would cancel a download like that(newbies to computers wants things to happen instantly or they think something is wrong BUT, as you say, its part of the windows auto-update, which will probably make people download it anyway.

Share this post


Link to post
Share on other sites
Brobanx,

MS actually recruited the fellow who wrote Delphi. I can''t rememeber the guy''s name but I''ve heard a lot of his knowledge reflects in the language and DevStudio.Net.

Playing with it, some you build forms, somewhat like in VB. The IDE then generates code for to place your controls. The nice thing is that the code is easy to understand, see, and modify if need be. Sort of the best of both worlds: control but also ease of GUI creation.

Sieggy

Share this post


Link to post
Share on other sites
Also notice the similarity to J++? Similar event handling, etc. Coming from Pascal/Delphi and C++ Builder C# is nice, BUT I still have a few issues wth it (deletion of components from the form view and empty method declarations are handled better in C++ Builder and Delphi - but these are problems with the IDE rather than the language though).

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