will java become the next big language?

Started by
145 comments, last by the_nemesis 22 years, 2 months ago
On the speed issue:

www.javagaming.org (particularly the code section)

And my projects at:
http://studenti.lboro.ac.uk/~cojc5/BluePrint.htm
http://studenti.lboro.ac.uk/~cojc5/TerrainDemo.ZIP
Advertisement
No...
If you''re a highly skilled C++ programmer, exactly how much effort would it take to get up to speed on Java? I mean, the fundamentals of programming haven''t changed. I haven''t used Java myself, but I''ve programmed in Basic, Fortran, Pascal, Visual Basic 3-6, C/C++, Quake Script (Quake 1 in which a proprietary mod scripting language loosely based on C was created), Perl, VB Script, and a couple proprietary languages developed by the companies I''ve worked for. Roughly in that order over time. The one thing I''ve found after getting into C++ programming is that the fundamentals remain the same, and each new language is mostly a matter of learning the semantics of that language. Every language throws in a few of it''s own curve balls, but the bottom line is an experience programmer should have no trouble getting up to speed on any new (or old) language. A couple courses and/or a couple books and you should be all set. Why limit yourself? Flexibility is a marketable skill, and it makes predicting the future less of a requirement to keep your career afloat.
Stilby: I think, given the choice between a PC version and a console version of an FPS, most people will buy the PC version. Don''t try to patronize me regarding cache & operating system design. I still haven''t seen a valid argument as to how java can get fine-tuned memory control.

"In business the techie never gets his way, and always has to give in to the business decisions".
This isn''t true at Microsoft, and they''re the most successful tech company out there.

"I mean look at windows, is a huge success but not because of its technical advantages!"
No, windows is successful because it was the best product at the time, and was backwards compatible with previous software. Newer versions maintained this backwards compatibility that was so crucial to keeping market share.

I guess the end all argument is "Let''s imply that the person can''t think, and the give words of encouragement that maybe, someday they''ll be able to think on their own."

Maybe if you had some compelling counterarguments. But all you have is empty rhetoric.

AP: about java games - If they''re anything like the ones in SUn''s booth at GDC and SIGGRAPH this last year, count me out. They still have a long way to go.
Java is great for Web apps. Java is wonderful for non-real-time, non-resource-constrained systems. You can write games in Java, sure, although you''re not about to beat Q3A for performance. But there are places you''ll never see Java...

- Microcontrollers with limited RAM. On my current "day gig" project we''re using a National Semi COP8 microcontroller to handle some ADC work for temperature monitoring, battery monitoring, button handling, and some communications work. This chip has 32K of flash and 1K (thats right ONE KILOBYTE) of RAM. Let''s see you shove your JVM into this. Oh, and we need microsecond response for some external events and direct hardware access to handle these events as well.

- Hard realtime systems. There''s a small, slow movement afoot to add realtime extensions to Java, but it''s not there yet and there doesn''t seem to be a whole lot of interest. You can''t write an ISR (interrupt service routine) in Java. There''s no guaranteed response time mechanism in Java. For many implementations of Java (yeah, whose flavor are you using? lol!) GC will occur without notification and cannot be deferred or interrupted. There goes your response time.. poof!

Java''s a wonderful newbie language, it''s really good for large teams of so-so programmers as it''s a lot harder to shoot yourself in the foot - and there''s a ton of built-in functionality that nobody has to write, reducing development time in that respect at least. Business applications, Web applications, games that don''t require triple-digit framerates and massive number crunching in realtime, all fine. But once you get into the hardcore realtime world, Java is toast.

Java is already a big language for some things, but it''s not the holy end-all and be-all that so many hypemeisters would have you believe.
First of all, people who base their arguments on beliefs or rumors, shouldn't be eligible to write this thread at all! If you don't know about, don't write about it. And warning, this is a long reply!-)

I've relatively experienced with Java, I've used it for business software as well as for games. I previously used C/C++, but after learning to program with Java, I never ever would go back for C++ if I really had to. Why?

Pointers and memory management
Not to have separate pointer types makes programming a lot easier. I mean it. You don't need to think whether to pass objects as real object, references or pointers to a method. Or how to catch your exceptions. Also, without need to actually release the allocated memory frees you to concentrate to the actual problem instead of hunting memory leaks. To do professional and efficient memory management you need to be quite a seasoned C++ programmer (C++'s memory management and exceptions => oh my god...)

Code readability
Ever looked the interface declaration of c++'s istream? And looked the declaration for Java's InputStream? Compared to istream's 300+ lines to InputStream's 100 lines (comments removed from both), the Java version is far more readable. And together with comments Java version gets to 300 lines too - with full embedded documentation!

Here's few lines from istream. Imagine that you've never known C++ before and someone asks what these methods do:

      inline istream& istream::operator>>(istream& (__cdecl * _f)(istream&)) { (*_f)(*this); return *this; }inline istream& istream::operator>>(ios& (__cdecl * _f)(ios&)) { (*_f)(*this); return *this; }      

Can you explain it?
(I can't find a methods in InputStream class that would be as messy as those above, sorry...)

Compile times
Compile time of Java code is usually fractions of compile time of comparable C++ code. Java is "lacking" the preprocessor which makes it considerably more efficient in terms of compile times. Preprocessor had to be in the C for memory reason in the early 70's. No modern languages need preprocessing, only weak languages do. Few header files #including few other header files sum up many thousands of lines of code pretty quickly. Not convinced? Ever tried out to see what the preprocessor of C compiler spits out for actual compilation. You'll be scared, I bet you. We once developed a PC game in my company, and the time to compile the whole project was about 2 mins (about 100 files). Nothing to compare with fully commercial games, 30 mins is a standard! But recompiling our enterprise Java code base with 166 source files and equal amount of lines that there was in our PC game's source, it takes only about 10 secs compile. Incredible, eh?

Multiple inheritancy
How about multiple inheritancy? How many times you've actually needed it when doing C++ code? Do you know what are its real benefits? Do you know why it is hard to implement for a compiler? Ever tried to derive a class from two base classes with identical methods in their bodies? Then you should know. When they designed Java, simplicity was one of their primary goals. There is rarely need for multiple inheritance, and when it can be always avoided. Check your design if it becomes a problem.

Exceptions and debugging
Ever struggled with page fault error when doing a C++ project? Mysterious crashes? Due to Java's sophisticated exception system, tracking down bugs has never been so easy. To be honest, I've never ever debugged a Java program in my life. Haven't had need to.

ides
And talking about IDE's. Some one said here that "how many Java programmers actually use IDE's written with Java". Well, almost every respectable Java programmers do. There is a huge variety of Java IDE's, my favourite being the IntelliJ's IDEA, which can perform dozen of different refactorings and real-time error checking. http://www.intellij.com/idea for more. It makes Visual Studio to feel like a notepad!-) To be honest, my productivity has increased about 1000% from the days I wrote C++. But you C++ fanatics are never going to belive that, I feel sorry for you...

So where is Java used today? Everywhere. Many of the enterprise web business solutions are made with Java, many web sites use either jsp, servlet or applet technologies, there are Java mobile phones (Nokia predicts that it will sell 50 million Java phones this year!). Some of the latest games use it too. Many interactive scientific visualization are made with applets.

In my work, such things as portability, development efficiency and high reliability are important. Only Java can deliver us this all. Our SMS applications run already on Windows, Linux, Unix and god knows on what platforms, WITHOUT even single modification to the code. We simply can't afford to modify the code to support new platform, the workload would be ernomous.

Using modern development tools with refactoring, error highlighting and deployment capabilities is a key for rapid development. If you don't know what refactoring is, please find out. Then find out how many refactoring tools there are for C++. And you'll cry.

Games
So let's talk about games. Games often require highly responsive user interface, and many Swing applications are certainly far away from that! But don't let it fool you, Java itself isn't slow, it is the burden of backward compability, portability and customizability that make Swing slow.

Some 3D would be nice too. For simple arcade games Java applets (and applications too) are sufficient, but for bigger projects you need some more. Java3D is already here, and if you only need 2D capabilities, JDK 1.4 delivers hardware acceleration for that. But wait, there's more than that!

I'm currently developing a game that is developed with both C++ and Java. The core graphics engine is made with DirectX (Direct3D, DirectInput) and other native libraries. Java is used for all game logic and non-number crunching processing. Those two worlds can be combined with Java Native Interface. The benefits are:

- high responsivity and framerates (as with any standard PC game)
- coding on the fly (run-time class loading, really handy!)
- improved development speed
- understandable error messages, far less actual crashes

The resulting game will be an .exe file with bunch of dll's, jar's and data files. The user won't feel the difference. Of course, JRE must be installed, but I'm currenlty finding out if it is possible to include the actual JRE into the game package to make it completely standalone.

Java will definately be one of the programming languages of the future. Taking in account its relatively young age, it has already gained much attention. If you haven't already learnt it, I suggest that you do. Even just for fun.

Cheers,

^Conrad2k

Edited by - conrad2k on February 28, 2002 4:46:27 PM

Edited by - conrad2k on February 28, 2002 4:51:54 PM
^Conrad2k
quote:But there are places you'll never see Java...
- Microcontrollers with limited RAM.

You might want to check out JavaCard that runs on smart cards, some of which have 1k RAM. If you are talking about Java not being able to work on devices with less resources than a smart card... ...I think I can live with that

Edited by - HenryApe on February 28, 2002 5:02:07 PM

Edited by - HenryApe on February 28, 2002 5:02:36 PM
quote: Java3D is already here, and if you only need 2D capabilities, JDK 1.4 delivers hardware acceleration for that.

Actually, for the most C++-like performance you should probably use direct Java bindings to APIs such as OpenGL (GL4Java is available for Mac, Linux, Solaris, Windows etc.), or as in your case, Direct3D. Java3D has A LOT of functionality built into it but the performance of simple apps that use Java3D is not likely to be as good as that of similar apps using OpenGL bindings. I am just mentioning this before someone tries a Java3D app and has a "Swing-experience" and starts blaming Java for slowness in an optional API.
In pretty much everything except the game industry, java has already taken over. You can debate various features all you want, but it doesn''t change reality. For the majority of people in the software industry, Java offers enough improvements over C++ to make it worthwhile. Do a monster.com search of your local area; the odds are java positions outnumber C++ positions by at least two to one.

Within the game industry, I see Java making inroads. Games are already becoming more and more "script based", where only the most graphic intensive code is done in a compiled language with the rest done in some sort of scripting language. Computers are becoming fast enough that the loss in raw processing "through-put" can be made up for with the decreased development time. A company can either come up with their own bytecode engine, or use one that has been highly optimized already. I think you''ll see more and more games come out that have scene rendering and the like done as JNI libraries, with the rest of the engine done in Java.

That could be an interesting GameDev coding contest. See who can come up with the best Java game. That beats sitting around debating it, since the majority of posts seem to be from people who wouldn''t know Java from a hole in their head.

Take care,
Bill

Is it just me or does anyone else absolutely love the way the Java Runtime Env. destroys Win2K with certain hardware configurations? I just love having to help people on my floor format their machines after Limewire has them install the J.R.E. SUN should change the slogan to "just about the only VM that has a crappier architechture than AOL''s browser".

On another note...
UIUC requires CompE. majors to take java for a semester. I was excited going in to the class (I knew C/C++ and I thought a new language would be interesting), what a disappointment though. That has to be the biggest newbie language ever created. I see how it can catch on since it only takes a week to get good at it, but you run out of options way too fast. When you finish your project and the optimization process starts, there is nothing you can do. Everything is abstracted like you''re some kind of retard. C/C++ lets you throw in assembley when you need it but Java doesn''t allow for cool stuff like that. Ugh. It''s frustrating as hell. If this does take over (and I''m sure it will since any idiot can learn it and idiots rule the world) I will sadly shake my head in disgust and make a trip to the local bar to drink myself into oblivion.

-atreyu


| particlefield.com |

This topic is closed to new replies.

Advertisement