JDK 1.5 features

Started by
16 comments, last by thwart 18 years, 8 months ago
SiCrane: Curly braces are nothing to be afraid of.

Case-sensitivity is a good thing as long as you have a compiler -- it's a part of writing good code. Just because you are using a scripting language doesn't mean that you should write bad code. If there is a compiler, case-sensitivity is the way to go.

However, I like how states are implemented in Unreal Script. Simulating threads is also cool. I wonder if that could be done with Java? Annotations could help with decorating methods to be run in a simulated thread. Your pipeline could handle the rest.
Advertisement
I'm not against curly braces, several perfectly fine scripting languages use curly braces. It's just that UnrealScript eliminates one set of braces in class declarations that are redundant in a one class per file system. That means less keys to press than in Java. Similarly lack of case sensitivity means that code is more likely to compile the first time than in Java. See a trend here? Go back to my original point: a scripting language should make it quick and easy to modify code. UnrealScript is more forgiving than vanilla Java so it is more suitable as a scripting language.

Now compare Java to Lua or Python, languages designed from the ground up to create quick code. Consider a trigger function for an event map that just displays a message on the screen. In Python that would look like:
from game import messageboxdef trigger():  messagebox("You feel a draft")

You could even skip the import if the code is executed in a namespace where the game module was preimported. Now tell me, how much code would it take to do the equivalent in vanilla Java?
Quote:Original post by thwart
I know this particular reply to this post is a little off topic, but I want to make sure that all developers are aware that Java is one of the most used language platforms in the world. Everything from rinky-dink little applets to full-scale Enterprise applications are being written in Java all over the world.


Yeah, this is largely because middle-management all over the world were obsessed with it, thinking that it would solve all their problems. It hasn't. It was severely overhyped from the start and popularity has been largely imposed top-down (business asking for it) rather than bottom up (programmers choosing to learn it). I don't mind Java, but I don't particularly see it as being anything amazing either. What does it gain you as a scripting language, beyond being a language that you personally like? In the absence of a business need (ie. needing to find programmers, or needing to convince customers that you use a stable technology), what balance of priorities does it meet that can't be better met with a different language?
I guess I should go to the top and read why I started this thread in the first place. I was just seeing if anyone else is re-evaluating Java as a possibility for a scripting language. Given that Sweeney seriously considered it a few years back and given how far Java has advanced in version 1.5, I thought that it was worth it to pose the question.

After reading all of the responses to the thread it appears that no one has considered Java to be worthwhile as a scripting language. In fact, most people here on this board have little or no experience with Java and consider it to be a 'silly little doo-doo' language.

No one in this thread has called it a 'silly little doo-doo' language. If you have a chip on your shoulder regarding Java, you may want to take it off before posting otherwise people may react to your tone rather than the points you are trying to make. All that has been said is that there are other languages better suited to be used as a scripting language than Java.
You're misinterpreting my tone. I'm sorry that I wrote my comments in a way that could be misinterpreted.


I was only trying to see if anyone else was considering Java or has used Java as an embedded scripting language. It is much easier and faster to write Java code than C++ code. A few weeks ago I started working on a prototype engine with embedded Java. So far everything is going swimmingly. I have not had any issues that would push me away from continuing to use Java.
You're right that Java is easier to write than C++ code, at least if you are equally competent at both. I would say slightly easier, rather than much easier. You gain a lot on the more fully-featured libraries but lose a bit of that on the verbosity. You don't gain much from the syntax at all because they're almost identical.

Anyway, most people, having made the decision that they want a scripting language, look for something which gives them something significantly different from C++. Generally the 2 directions people look in are either flexibility and expressiveness, to write scripts in much less code, or lightweight/ease of embedding, to write scripts that allow automation while carrying little overhead. Java doesn't give you much of either of these, compared to the other scripting language options. I will get more expressiveness from Ruby or Python. I will get much less overhead from Squirrel or Lua, even &#106avascript. Java can make up for this with the libraries but many scripting applications don't use many libraries anyway, instead relying on callbacks to the host application, so this isn't much of a win.

I think I am the only person on this thread to have come close to calling Java a 'silly little doo-doo' language. I don't actually think that; what I actually think is that it's overhyped, which is not so much a comment on the language itself but more on the people who assume it is something amazing when really it is just an incremental step from C++. Many of these people are not actually programmers. People with considerable more knowledge about languages than me, such as Bruce Eckel, will say that Java occupies an uncomfortable middle ground between C++ and the higher level languages such as Ruby or Python, and that most people who consider using one of the latter won't go back to Java afterwards.
Kylotan: You make some very good points. Thank you for your post.

This topic is closed to new replies.

Advertisement