Client / Server Languages

Started by
22 comments, last by hplus0603 18 years, 9 months ago
I'm curios as to what languages people are using for their client / server systems. I assume most clients (game-wise anyway) are written in C++. But with that in mind, do most people program a server for a C++ client in C++? Or is Java at all popular? Obviously sticking with C++ for both the client and the server provides the benefit of code reuse. But is it easier to get a distributed server built out of Java? Or are there other benefits to Java? Or do people just stick with C++? Thanks for the input!
Advertisement
Our server and client are both written in C.
While there are MMORPGs written in Java (at least for the client) you can do much more, graphic wise, in C/C++.
Most people who don't know how to write java to the same level they know C will tell you that C and C++ can do "lots of things" that java cannot. In general, that's mere ignorance (and people who haven't learnt to keep their mouths shut when they don't know what they're talking about).

In general (again, must stress that), since java has direct access to native memory (including to the graphics card over the AGP bus) you can do anything in java that you can do in C++. This is no surprise if you think about it: java is just like C++ in that it compiles down to native assembler, although there are advantages to each in the particular implementations.

On the server side, the fact that java is 100% cross-platform makes life much easier: you can develop on anything, windows, unix, etc and then deploy on anything (including deploying on systems you don't have in the office, e.g. Solaris).

Further, java has in-built optimizations which are not possible in a C++ compiler that make any application run faster after the first few minutes, speeding up continuously for up to several days...which really helps when writing server code (servers should be online for months without rebooting.

Similarly, the extensive hot-swapping of live code in java makes it easy to keep that server running (don't restart the process) and patch in updates.

On the flipside, the market for java client engines (graphics, physics, etc) is woefully immature compared to C++. Many people write the server in java and the client in C++ - it's easier - although you do lose out that C++ is much more bug-prone and takes longer to write code to do the same task.
Quote:Original post by redmilamber
On the server side, the fact that java is 100% cross-platform makes life much easier: you can develop on anything, windows, unix, etc and then deploy on anything (including deploying on systems you don't have in the office, e.g. Solaris).



Hmm. Just realised, you probably don't know why this is so important: there is no standardization in the I/O libraries used in networking code across OS's. Java has a single unified library that is guaranteed to work on all platforms, whereas C does not. Unfrotunately, since java's lib is relatively young (released about 4 years ago, gold for the last 3 years), it still has bugs - although you get similar problems when coding in C with OS I/O libs (windows, linux and OS X all have infrequently encountered yet annoying OS bugs in this area that continue to cause me grief :( ).
Quote:Original post by redmilamber
Most people who don't know how to write java to the same level they know C will tell you that C and C++ can do "lots of things" that java cannot. In general, that's mere ignorance (and people who haven't learnt to keep their mouths shut when they don't know what they're talking about).

In general (again, must stress that), since java has direct access to native memory (including to the graphics card over the AGP bus) you can do anything in java that you can do in C++. This is no surprise if you think about it: java is just like C++ in that it compiles down to native assembler, although there are advantages to each in the particular implementations.

On the server side, the fact that java is 100% cross-platform makes life much easier: you can develop on anything, windows, unix, etc and then deploy on anything (including deploying on systems you don't have in the office, e.g. Solaris).

Further, java has in-built optimizations which are not possible in a C++ compiler that make any application run faster after the first few minutes, speeding up continuously for up to several days...which really helps when writing server code (servers should be online for months without rebooting.

Similarly, the extensive hot-swapping of live code in java makes it easy to keep that server running (don't restart the process) and patch in updates.

On the flipside, the market for java client engines (graphics, physics, etc) is woefully immature compared to C++. Many people write the server in java and the client in C++ - it's easier - although you do lose out that C++ is much more bug-prone and takes longer to write code to do the same task.



1. Java cannot acess hardware exept through its api.
2. Java is jit compiled, and 'native asm' is ~= BS.
3. Since when could you hot swap java code?
4. C++ isn't bug-prone, the coder is. (tho you do make a somewhat decent point there, C# is better at this)

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Quote:Original post by redmilamber
Most people who don't know how to write java to the same level they know C will tell you that C and C++ can do "lots of things" that java cannot. In general, that's mere ignorance (and people who haven't learnt to keep their mouths shut when they don't know what they're talking about).

In general (again, must stress that), since java has direct access to native memory (including to the graphics card over the AGP bus) you can do anything in java that you can do in C++. This is no surprise if you think about it: java is just like C++ in that it compiles down to native assembler, although there are advantages to each in the particular implementations.

On the server side, the fact that java is 100% cross-platform makes life much easier: you can develop on anything, windows, unix, etc and then deploy on anything (including deploying on systems you don't have in the office, e.g. Solaris).

Further, java has in-built optimizations which are not possible in a C++ compiler that make any application run faster after the first few minutes, speeding up continuously for up to several days...which really helps when writing server code (servers should be online for months without rebooting.

Similarly, the extensive hot-swapping of live code in java makes it easy to keep that server running (don't restart the process) and patch in updates.

On the flipside, the market for java client engines (graphics, physics, etc) is woefully immature compared to C++. Many people write the server in java and the client in C++ - it's easier - although you do lose out that C++ is much more bug-prone and takes longer to write code to do the same task.




Hmm, Java sounds like the best language EVER!
It is as fast if not faster than C++ (which by some accounts it is faster than Assembly), it is cross platform unlike C++, and, of coruse, you just can't have bugs in Java.
I wonder why doesn't everyone use it for everything. I think people should uninvent all the other programming languages and just sue Java!
FASTER THAN ASSEMBLY?!

Who reinvented the computer while I was in engineering college?
Quote:Original post by Anonymous Poster
FASTER THAN ASSEMBLY?!

Who reinvented the computer while I was in engineering college?


It was sarcasm, of course.
But I ddi hear stuff such as:
"C is faster than assembly because the compiler does optimizations you don't know how to do"
"C++ is faster than C because [...]"
"Java can be faster than C++ because of the JIT optimizations"
So Java is faster than ASM :)
I definitely didn't want this to turn into a war of the languages, though I should have seen it coming as anytime the two languages are mentioned in even the same city, sides are instantly formed and words are thrown like weapons.

So maybe a better way to approach this is in the form of a poll. Instead of asking what people think is best, how about, what have people done and to what success?

So the new question: In building a client / server game (MMO prefered, but any other form of client / server system works as well), if your client was written in C++, was your server also written in C++ or Java instead?

Thanks for the input!
If you ask such a question, it's normal to get a holly language flame war :D
Many people will claim that Java is good for servers, but I am curious how many here actually wrote a MMO server in Java.
Mine is built in C, and works very nicely.

This topic is closed to new replies.

Advertisement