When it comes to server programming, you shouldn't take chances. A game server must be secure, because it's an exposed target for hackers. A game server must be stable, because downtimes will annoy everyone. A game server must not have bugs, because a glitch can cause irreversible damage to the gameplay and not just a mild annoyance. And a game server must require few resources, because I will be paying for the hardware. To ensure this, I want to do this in a programming language which fulfills these criteria:
- Object-orientation
- Static typing
- Runs on Windows and Linux
- Not interpreted
- I have prior experience with it
Out of these languages, C++ is the one I have most experienced with. I contributed a lot of C++ code to Manaserv, the new server for The Mana World, so I even used it in almost the same context. But in hindsight I consider it a bad decision to use C++ for Manaserv. Sure, it's lightning fast and allows to minimize memory usage, but it has a lot of problems. Its very slim standard library means that you need many 3rd party libraries when you want to do anything useful. And 3rd party libraries cause all kinds of problems. Licensing issues, unstable APIs, inconsistent programming styles, unsupported platforms etc.. Its pointer semantics are a source of hard to find bugs. And its lack of garbage collection means that you spend a lot of time with thinking about how to avoid memory leaks instead of solving your problem.
So it boiled down to C# vs. Java.
Anyone who has used these two language and has also experience with other programming languages will notice that these languages are very similar. Both are almost fanatically object-oriented, both compile to bytecode, both have a very comprehensive standard library and the syntax is so similar that it's faster to list the differences than what they have in common. The only two reasons for me to choose Java over C# are these:
- I got a tad more experience with Java
- I don't trust Mono to run my code on Linux as well as the .NET framework does.
No comments:
Post a Comment