Sign in to follow this  
Ntvu

Learning C# a Good Idea?

Recommended Posts

I'm interested in creating windowed applications and games. I've created games with C++ before but in my opinion it takes too much code and too much time, and currently I'm attending school so my leisure time is very limited. I heard of GTK Windows (something along those lines) with PHP but I'm concerned that the library will be too slow for windowed applications. I also considered using Java and Swing for creating windowed apps, but that seems extremely cumbersome, the reason being that I can't just drag-and-drop components onto the window like I can in Visual Basic. Instead, I have to create a bunch of JWhatevers, assign their attributes including their widths and X,Y coordinates, and then add them to a Container object. Would learning C# be a good idea? Can I drag and drop components and widgets onto the window directly (like I can in Visual Basic) easily and set their attributes in a window separate from the code? Also is C# good for creating games?

Share this post


Link to post
Share on other sites
Quote:
Original post by Ntvu
I also considered using Java and Swing for creating windowed apps, but that seems extremely cumbersome, the reason being that I can't just drag-and-drop components onto the window like I can in Visual Basic. Instead, I have to create a bunch of JWhatevers, assign their attributes including their widths and X,Y coordinates, and then add them to a Container object.

Both Netbeans and Eclipse have visual editors that will let you position the components on screen and write the setup code for you. However, from what I've seen, the experience is still not as smooth as Visual Basic. Part of the reason are the layout managers provided by Swing, although you can disable those and position your components manually.

Quote:
Original post by Ntvu
Would learning C# be a good idea?

It won't hurt you.

Quote:
Original post by Ntvu
Can I drag and drop components and widgets onto the window directly (like I can in Visual Basic) easily and set their attributes in a window separate from the code?

Yes, Visual Studio supports both of these functions.

Quote:
Original post by Ntvu
Also is C# good for creating games?

Microsoft thinks so.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ntvu
I also considered using Java and Swing for creating windowed apps, but that seems extremely cumbersome, the reason being that I can't just drag-and-drop components onto the window like I can in Visual Basic. Instead, I have to create a bunch of JWhatevers, assign their attributes including their widths and X,Y coordinates, and then add them to a Container object.


That is the cost of portability between platforms with Java. The reason why you can't just drag'n'drop widgets is because there is no guarantee that they will be displayed in remotely the same way on another platform's JVM. As the above poster mentioned, there are visual editors for Java, but they are not as streamlined as Visual Studio, and if you try to get them to display the same on every major platform, you will pull your hair out.

Quote:
Original post by Ntvu
Would learning C# be a good idea? Can I drag and drop components and widgets onto the window directly (like I can in Visual Basic) easily and set their attributes in a window separate from the code? Also is C# good for creating games?


I enjoy C#. In Visual Studio 2008, you can choose to use the old, simple WinForms system of forms creation to just drag'n'drop widgets like in older Visual Basics. Or, you can make a WPF application, which uses a version of XML called XAML to define window elements. WPF gives more freedom and options, but there is more to learn. C# also is good for making games, as you can use XNA with it.

However, if you already know one of the .NET versions of Visual Basic (VB.NET, VB 2003 - 2010), there may be little reason to learn C#. C# is just another dialect of CIL, the underlying language of all .NET languages. Both VB.NET and C# are converted into almost identical CIL when they are compiled, so there isn't much you can do with C# that you can't do in VB.NET. At this point, one of the only benefits of C# over VB is that XNA was built specifically for it, so using VB for XNA is cumbersome and officially unsupported.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ntvu Also is C# good for creating games?


Unity is based on Mono, which supports C# as a development language. Plenty of people are using Unity to make games now, so it wouldn't be an obstacle.

Share this post


Link to post
Share on other sites
Quote:

However, if you already know one of the .NET versions of Visual Basic there may be little reason to learn C#.


There is a lot of truth to that statement, but I have used C# for the last 4 years and I love using it. I moved from Visual Basic to C# and haven't went back, so you might find that using it is more enjoyable for you. If you use VB.NET then you wont get anything extra out of using C#. .NET compiles yer VB and C# code into the same CIL code so choosing a language on the .NET platform is just a matter of preference. I can tell you however, that if you google for .NET examples or help, 80% of the search results will return C# examples. However if you find you want to keep using VB, you can easily convert most of the C# source you find online to VB source by using an online convert

XNA is also a good reason to use .NET, and will work with VB, but all of the examples and project templates are C# so there will be more leg work needed in order to get a project started. Many engines and API's have wrappers available for their C++ based API's to run with .NET such as Irrlicht.NET

One last note, MONO.NET is very nice, I was able to take a Visual Studio.NET project of mine with 3,000+ lines of code and compile it on Red Hat with roughly 15 minutes worth of work. Granted it was a Library and not a windows Application. At one point MONO didn't contain the Windows.Forms win32 toolkit but after a quick peek at their site I guess it now does. Theoretically you should be able to dump yer source on the linux box and compile it with very little changes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this