Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Reasons to like or hate Java, C# and C++

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Reasons to like or hate Java, C# and C++
Archon
Member #4,195
January 2004
avatar

I know this resembles this thread but I'd trying to ask in a more pratical and controlled manner.

What would be the benefits of each language compared to each other for:
1) Games
2) Business software
3) Anything else

And other questions?
4) What about in the future (whether any of them will die, be replaced, live forever or improve as it's relevant technology improves (probably only applicable to C# and Java))?
5) The interests of businesses? (ie, will business support C# or Java more?)
6) Whether any deficiencies of one language could be made up by the speed of development or ease of the other? (eg, VB vs those strange languages recently posted)
7) Availability and completeness of APIs?

Simon Parzer
Member #3,330
March 2003
avatar

Comparison between C++, C# and Java?

Quote:

1) Games

C++ wins, because the generated code is super fast, and there are tons of nice multimedia libraries for it.
C# is on the way to change that (WinFX, DirectX), but right now I think C++ is still better for games.
And Java, ... well it's too slow.

Quote:

2) Business software

Here's C++ the looser, because it lacks productivity compared to Java and C#. C# is better than Java for business applications because the resulting applications look better, run faster and are more usable.

Quote:

3) Anything else

Nothing of the three. Use a combination of LISP and Python.

Quote:

And other questions?
4) What about in the future (whether any of them will die, be replaced, live forever or improve as it's relevant technology improves (probably only applicable to C# and Java))?

C# gets stronger and better right now, Java will die eventually.

Quote:

5) The interests of businesses? (ie, will business support C# or Java more?)

C#, because it's better and it's by Microsoft. Seriously: Companies that switch from C++ to C# usually gain 50% productivity or so. Don't know about Java though.

Quote:

6) Whether any deficiencies of one language could be made up by the speed of development or ease of the other? (eg, VB vs those strange languages recently posted)

I find C# easier than VB. VB just teaches you bad programming habits.

Quote:

7) Availability and completeness of APIs?

C++ has the most complete API, I would say, because you can get just any library for it. On the other hand you can't compare the C++ STL with a .NET framework class library.
C# and Java both have a very complete and easy to use class library, but when it comes to additional stuff, like, using 3rd party libraries, C++ is the better choice.

Archon
Member #4,195
January 2004
avatar

Quote:

C# is on the way to change that (WinFX, DirectX)

But then wouldn't it "lose" by not being portable?

Quote:

And Java, ... well it's too slow.

Isn't it picking up speed as I think Marcello swears by it... Maybe Java would transfer into a JIT software like C# and speed up?

Quote:

C# gets stronger and better right now, Java will die eventually.

It's not that I doubt your words, but do you have evidence or sources?

See, Java would not be my choice of language if it is and will always be too slow for software - but I just thought I had hints that Java was improving and would be a feasible language to do anything with...

I really like C#'s syntax and semantics, but it just lacks the hardware-related libraries (DirectX and OpenGL bindings are supposed to be incomplete at the moment) and .NET 3 is coming out soon and Mono/.GNU are behind - I probably wouldn't consider C# if it wasn't cross platform... At least, not for games.

But I feel 'loyal' to C++ and it has the speed but I find it frustrating sometimes.

A J
Member #3,025
December 2002
avatar

i just hate the people that post daft questions.

___________________________
The more you talk, the more AJ is right. - ML

Indeterminatus
Member #737
November 2000
avatar

Claiming that "Java is slow" is like saying that "driving is slow". The language has no impact on speed whatsoever, it's the cars, erm, the VM. Not all implementations are utilizing JIT compiling, afaik, like VMs on PDAs and mobile phones, but some already do.

I don't think that any of those languages will die any time soon (say, the next 20 years or so). However, I lack the experience in industry, so I cannot back that up.

Having said that, don't trust any wild assumptions on the topic. A C++ dude most likely will answer in favor of C++, a Java dude in favor of Java, a C# dude in favor of C#, a programmer probably in favor of whichever language allows for the richest set of nifty tricks, and an engineer in favor of whichever technology allows for the most efficient development. Finding a person experienced enough to be able to fairly compare will be difficult, and given that all human beings are subjective in nature, even then the resulting advice would have to be taken with a grain of salt.

To put it in a nutshell: I cannot add positively to the discussion. Ignore my post. Bleh.

_______________________________
Indeterminatus. [Atomic Butcher]
si tacuisses, philosophus mansisses

Felipe Maia
Member #6,190
September 2005
avatar

Java is still a child. C# is a Java clone. Business software already uses both of them, because they have pre-built stuff, because OO programing on them are hundreds of time easier than on C++, because they're easily compilable, hence easy to make little changes, updates.
For games, compiled languages will always be more used, they're faster, and the previous "goodies" aren't much applied here, C++ is enough.

BAF
Member #2,981
December 2002
avatar

.Net is by far the best multipurpose library I've ever seen (except for that it's not portable). C# is nice too, and it inherits it. You want a nice sockets API? .Net. You want a native, good-looking, easy to use GUI? .Net. You want X? You can probably find it in .Net.

Marcello
Member #1,860
January 2002
avatar

BAF: what does .NET have over Java's standard libraries?

One of the wins Java has over C#/.NET is it's been around a bit longer and there's a huge wealth of libraries (many open source) available already. Plus you have stuff like applets and web start if you're dealing with that...

C# has the advantage of being designed for Windows, so its programs will feel more like native windows programs than Java programs will.

I think with much of game programming going into hardware (IE graphics), the "slowness" of Java or C# is much less of an issue. Most people these days aren't going to be writing games that are cpu-limited, or they're just using the wrong data structures.

Obvious advantages of Java/C# over C++ is ease of development, and for businesses that's a definite win. Also potentially more stable/reliable by design (garbage collection etc). You can have less experienced (and thus cheaper) programmers developing in Java/C# and still get the job done (I'm dumb! @ thedailywtf.com though).

Definitely for web applications C++ is just stupid these days. You need something that can be dynamically compiled/reloaded easily/on the fly.

I will probably try to develop my next game in Java, if only as a self-challenge and to see how reasonable it is (there are a few java game libraries out there, but I haven't really played with them much), but my guess is it's at least feasible now. (Freaking nonstop crashes and system incompatibility with c++/openlayer kinda pissed me off of using C++.)

Marcello

Kitty Cat
Member #2,815
October 2002
avatar

Java is resource hungry. If you have a program in Java, and an otherwise-identical program in C-something, the Java version will put more strain on your system. This will always be true until they can get Java programs to run without a JRE. That's where Java loses, in my mind. I also prefer a language that does what I say, instead of what it thinks I mean (eg. implicit safety checks, opt-out garbage collection, etc).

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Archon
Member #4,195
January 2004
avatar

Would you (ie, any of you) install Mono, .GNU or .NET if someone programmed a freeware game or would you all expect native binaries?

[edit]
... and one of the compatible Java software?

Marcello
Member #1,860
January 2002
avatar

No, because I already have it? :D

Marcello

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

(except for that it's not portable)

...and...

Quote:

Would you (ie, any of you) install Mono, .GNU or .NET if someone programmed a freeware game or would you all expect native binaries?

So pretty much download this file, extract to its own folder, and double click on ltln.exe (or run mono ltln.exe). If you properly installed the Tao framework (you can get binaries for that at http://www.taoframework.com), you will get a working application. It uses OpenGL through C#, and that particular binary was compiled from Linux. It works in Windows, too, I promise.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

I'm going to go look at Tao too... CGamesPlay is good as persuasion.

I'll be able to test it out and program a small game as a test -- though it won't be using Allegro.

If I remember, I'll give out cookies just before this thread closes itself.

CGamesPlay
Member #2,559
July 2002
avatar

The nice thing about all of this is that someone can make a C# wrapper for OpenLayer, and then we will all be one big happy family. I'm still deciding whether or not I want to write the wrapper. I want to, but then again so far I have just taken OpenGL commands straight from OpenLayer's source and it has worked fine :P

In conclusion, how much of Allegro does OpenLayer really encapsulate? If writing a wrapper for OpenLayer would actually involve writing a wrapper for Allegro also, then I'm not interested. But if it's possible to get all of Allegro hidden under OpenLayer, then writing a wrapper would be a breeze (relatively).

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

In conclusion, how much of Allegro does OpenLayer really encapsulate?

The AllegroGLDriver class has all of it, and it's not that much after all. You could actually write your own SDLDriver, for example, and use that instead.

I've been thinking about "porting" OpenLayer to Java myself, maybe the C# version would be similiar?

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Marcello
Member #1,860
January 2002
avatar

PORT IT TO JAVA! :-D

Marcello

CGamesPlay
Member #2,559
July 2002
avatar

C# would be remarkably similar. For C libraries, it involves making a single static class with static methods for all the functions. For a C# wrapper, we would actually use classes to wrap the classes, with perhaps a static ol class for holding global constants.

[append]

Oh, does OpenLayer use a DLL or static library? It needs to be a static library if it is to be compatible with "platform invoke", which is the technology used to make these wrappers.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Simon Parzer
Member #3,330
March 2003
avatar

I've made bad experiences with mono. I once installed it on my system, including a bunch of applications that use it (Tomboy, Beagle, Banshee, ...). Every three boots or so I encountered 100% CPU usage, which always was one of these mono apps running in some endless loop. (I think it was mono itself, because it happened with every mono application now and then).
I really hope that mono gets better and more complete in the future, but I believe this only starts to happen if Microsoft supports it with some developers (nothing against the mono hackers, but Microsoft devs have more knowledge about their own framework/system).

Felipe Maia
Member #6,190
September 2005
avatar

Quote:

PORT IT TO JAVA! :-D

Seconded

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

I really hope that mono gets better and more complete in the future, but I believe this only starts to happen if Microsoft supports it with some developers (nothing against the mono hackers, but Microsoft devs have more knowledge about their own framework/system).

Mono is developed by Novell, and Microsoft's framework is simply an API that is open to anyone. The language itself is a published spec also.

What version of Mono were you using? Very recently (within this month, I think: http://www.go-mono.com/archive/1.1.16/) they have pushed a new version, featuring lots of bugfixes.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Fladimir da Gorf
Member #1,565
October 2001
avatar

Quote:

PORT IT TO JAVA! :-D
Seconded

OK, I'd like to use it in Java myself, too, as nowadays I like Java a lot more than C++, so... I should just go and do it :) Of course, everything takes some time, even if the conversion won't be too difficult (however, the few template classes, for example, can't be converted as-is)...

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Marcello
Member #1,860
January 2002
avatar

Will you use jogl?

Marcello

Billybob
Member #3,136
January 2003
avatar

These arguments are stupid. We're just comparing crap to more crap. Call me when someone develops a language/library/environment that actually works.

_________________________________________________
"God speed, my lonely angel."
Bitcoin | Bitcoin Ponzi Scheme

Felipe Maia
Member #6,190
September 2005
avatar

Actually William, they both work, not high performance, but work very well. Eclipse is the best IDE I've ever seen, and it's java, and if you have enough memory (more than 512mb ram) it's perfect, better than any microsoft crappy shit

Billybob
Member #3,136
January 2003
avatar

Well then you just haven't been coding long enough.

_________________________________________________
"God speed, my lonely angel."
Bitcoin | Bitcoin Ponzi Scheme

 1   2   3   4 


Go to: