First steps in C#
I finally got started with C# today. I plan to develop games with XNA at some point in the future, so I decided to go ahead and already start learning the appropriate language. As great as Torque Game Builder is, it has some limitations I can’t get around. Besides, XNA is completely free, while Torque isn’t. I downloaded and installed Visual C# Express, a free version of the development environment. The full version is part of Visual Studio .NET, and expensive as hell. The free version, of course, has some limitations, such as:
- Only supports SQL Server Express and MS Access databases (not exactly needed for game development)
- No ASP.NET
- No Windows Mobile development support (kinda sucks, would be cool to write games for Windows Mobile)
- No Crystal Reports (not needed at all for games)
- Fewer project templates (no big deal either)
- Limited debugging options; I’ll have to see just how limited these are, but I hope not too limited
- No support for Windows Services (again not needed)
- No OpenMP (I don’t even know what that is and I’m too lazy to Google it)
I don’t expect it to be difficult, since I already have a bit of programming experience. I got started with it in high school, when I learned Turbo Pascal. Back then it was considered one of the best compilers around. After Turbo Pascal I learned Delphi, one of the first real rapid application development tools. At the time (this was in 1996) it was incredibly popular because it was both easy and powerful. If you wanted to develop Windows applications, you had the choice between Visual Basic, wich was slow, C++, wich was difficult as hell, and Delphi. Since Delphi was both easy and powerful, it was a very popular tool at the time.
I had developed a few applications with it, plus a few component libraries (components were customizable controls and objects you could use in your applications), some of wich were actually quite successful. When I got started in game development, though, my interest faded, for a simple reason: hardly anyone uses Delphi, or Pascal in general, for that. Not that it can’t be done, far from it, but since so few people use it there aren’t that much tutorials about it. Besides, Pascal is as good as dead in general. My brother is a professional programmer and apparently, they don’t even teach it anymore! You can still get it, and a new version was even launched quite recently (wich also supports .NET programming), but C# is definitely the language to go for when it comes to Windows programming at the moment.
I have already done some reading about C# and it doesn’t seem difficult at all. I once tried C++ and DirectX, and compared to that everything is easy, of course. Good thing C# got rid of pointers. That’s got to be any programmer’s worst nightmare. The idea behind is isn’t that complicated, though, but when working with pointers, even a tiny error can have very unpredictable results. Also, pointer-related bugs have the reputation of being very hard to track down. An advantage of pointers was the possibility of creating very flexible memory structures, such as linked lists, but these required lots of error checking to avoid memory leaks. Besides, every language has excellent and easy to use dynamic arrays and other structures now, making linked lists obsolete. Also, multiple inheritance is gone, wich never seemed very useful to begin with in my opinion.
So right now I’m exploring it with some simple programs. Of course, the first thing you’re supposed to create is an application that simply prompts “Hello World!”, but since that sentence is so over-used (not to mention it’s also a song by a very annoying local singer; if you’re from Belgium or anywhere near it you probably know who I’m talking about) I decided to change it to “It’s alive… Muahahaa, IT’S ALIIIIVE!”. I should also try to make it play an audio file with demonic laughter.
