Holger Benl writes “Sun’s Java site has a very informative article about the most important new language features planned for J2SE 1.5 (expected beta-release: late 2003). Looks like Java may finally replace C++ as my favorite programming language.“
Holger Benl writes “Sun’s Java site has a very informative article about the most important new language features planned for J2SE 1.5 (expected beta-release: late 2003). Looks like Java may finally replace C++ as my favorite programming language.“
yeah! Templates – er, genrics. But Python is still my favorite language.
I haven’t done much Java programming, but enough to have a couple of complaints about the language. When I read this article, I could hardly believe it: They’ve adressed every single complaint I had about Java and then some. Java (the programming language) is making a big step forward with this.
Sounds pretty cool. But for “Metadata” hope all tool vendors support it well. Else it will be a mess!
Personally I never had ay problems with the language itself, just it’s gui toolkit which makes it seem to run slow. Bolt bindings to a native OS GUI toolkit (SWT, Cocoa) and it was great already. IMHO it was far better than C++ already (no headers, references not pointers, same syntax for addressing an object directly and by reference). I’d be more interested in running multiple programs in the same VM rather than having spawn VM’s for each program which I thought was also coming in this release.
Lack of unsigned types. Very annoying for network/cryptographic programming.
Lack of operator overloading. Very annoying for mathematical programming.
Generics will definately help alleviate the ugly casting that happens all over the place.
the chap from Sun said:
“If anyone has any strong opinions, or better yet, convincing arguments on this issue, please pass them along to the JSR-201 expert group.”
if they continue like this they’ll have a very happy user base!
personally i think they shouyld beef up their Maths libraries … its the only time i ever use non-Java on large projects.
t
Personally, I think JAVA is just VB for platforms other than Windows. Yes it is definately better than VB but still incorporates a huge run time and gobbles more memory up than anything I have ever seen.
Perfect example, one of the Exchanges my company trades on used to have a front end written in C++ and the most memory I ever saw it take up was 25MB’s. A couple of months ago, they released a new JAVA version written for the 1.4 VRM and now it takes somewhere between 65 to 75 MB’s of memory. Where is the cost savings in that considering we had to upgrade over 100 of our workstations with atleast 128 MB’s of memory just to install it?
I am not going to bash something which I don’t code in, but I can’t stand it when someone decides to tell me JAVA is the end all language and is better than C++. Maybe it is for the coder, but definately not for the end user.
I can’t tell you how little things like this autoboxing and unboxing will make my life easier.
Of course, it would be nice if the language wasn’t so weak it had to have this added explicitly. In C++ I could have done it like this:
class Integer {
public:
Integer(int i);
int operator();
// …
}
I really think that Java was designed for mediocre programmers. Now that enough good programmers are complaining, Sun is painfully revising the language.
I guess no matter how we get to it, Java will probably end up being quite a great language, so that’s good at least.
No…
C++ is already perfect.. Why do we need Java to replace C++? Silly..
I must say that this fixes my major problems with Java. Generics (with EASY iterator syntax, woohoo) and enumerations both look very nicely done. These were my main gripes before. Java isn’t appropriate for all tasks (straight C++ is better for speed intensive stuff), but I feel more positive about it now, especially in comparison to C#.
I disagree with the idea that Java was designed for mediocre programmers. Java prevents the programmer from making a lot of stupid mistakes. This is generally a good thing and makes life a LOT easier for “good” programmers too. Us “good” programmers don’t have to worry as much about fixing the mistakes of mediocre programmers. I am speaking from my current and past experience as a C++ developer.
I think part of why Sun is introducing these features now is that they didn’t want to release a half-baked solution. This way, they can just depricate libraries and not have to invalidate out-dated syntax. I much prefer this to the way C++ evolved. C++ was originally released with a bunch of half-baked language features (implicit methods by default, ability to override a non-virtual method…kinda). Since these “features” were already in use, they couldn’t fix them later (though this is also due to C++’s C hacker background – i.e. “more power is better”).
C’mon Sun, now….
There are some good reasons for the changes, but I wonder if now is a good time to be making such fundamental changes to Java. Trying to be everything to everyone never works, and I think that turning Java into C++ with garbage collection is going to ruin one of the fundamental strengths of Java, i.e. its simplicity (or orthogonality, if you like).
I really think that Java was designed for mediocre programmers.
No, it was designed to increase programmer productivity. Even expert programmers write bugs. Java really isn’t much easier to learn than C++. But Java makes it harder to write bugs, which benefits everyone, not just mediocre programmers.
With Mono coming along C# is going to be the language to use even if you’re not on Windows.
They’re adding on the obvious fixes to Java in this release, which is definitely a good thing.
There is no reason, in my mind, not to have had generics from the start. If you want the standard Collections behavior, you could always create it on Object. Anytime you see a lot of casting going on, it’s obvious that it has to be fixed.
Same goes for RMI. Why do I have to make an interface (with everything throwing RemoteException) then implement it, etc. Over 99% of the time I’m only looking for basic functionality and will not be trying to do anything fancy. And in general, I’d differentiate between remote and local interfaces as part of good design.
Enums were an obvious short coming.
I think that this release is aimed at automating all of the mundane repetitive tasks that we’ve all been doing for so long, knowing that one day we wouldn’t have to do them anymore.
Must say that I’m looking forward to this release.
I will definetely learn Java 1.5, hopefully I can use the awesome Qt toolkit. Too bad trolltech does not support Java Qt, Java = completely poratable language and Qt = completely portable toolkit, sounds like no brain combination. They should extend their market to Java too, java is very popular and should be even better soon!
If any Java or C# people are feeling just a little too good about their language of choice, head over to comp.lang.lisp or comp.lang.functional and ask those guys what they think of it. It’s an interesting experience, to say the least. While I don’t really buy the idea that Lisp reached perfection decades ago, a glimpse of the world outside the current OOP dogma is refreshing, very humbling, and a little bit scary.
PS> Go C++
Thanks to C#, java finally gets stuff like enums or proper/easy templates
That was one of the reasons I never used java.
Finally someone noticed that of these new features 4 of them are directly inspired by .net and c# – particularly the extensible metadata. I guess its only fair since c# was directly inspired by java.
C# …
Hey all,
I was wondering whether its possible to write an Object Oriented Application in C, or Pascal? i.e. one of those functional languages.
Anon, of course it is possible to write an OO app in C! It was being done before OO languages exist, you just have to do a little more work since the language doesn’t support it directly. BTW, C and Pascal are not ‘functional’ in the language sense. Loop up ‘functional programming’ and you’ll see a whole new world, one that I haven’t fully explored yet myself.
I’d add comp.lang.smalltalk too. While it is still OOP, it is an entirely different way of thinking OOP.
one anonymous guy said :
“I was wondering whether its possible to write an Object Oriented Application in C, or Pascal? i.e. one of those functional languages.”
yes, you can also write object code in asm, if you want. OOP is a paradigm which has no link with procedural ( java, C, C++, pascal, ADA ), or functionnal programming ( lisp, caml, ocaml ).
Indeed, there ie some OOP functionnal languages, as objective -caml. Compare to that, C++ and java are nearly the same languages.
Some are arguing C++ is a real programming language, with the authority of comp.lang … It make me laugh. On a theoritical point of view, both java and C/C++ are very bad languages ( you really cannot do anything with it, cannot prove anything ). My last Lisp teacher kept saying OOP means nothing, and don’t like any OOP languages.
C, C++, java are PRACTICAL languages, for the industry, which reaaly doesn’t care about theory. That’s all ( and if someone wants to see a good OOP procedural language, he should see ADA95, not C++ ).
Thanks all, you have been very helpful.
I’m studying Computer Science, and I’m wondering whether its better to learn C, and try to create OO apps in C, would this be beneficial?
Java is too slow on my machine 200Mhz 32Mb Ram…can’t afford to have a new machine…yet.
I’m so new to this stuff, I really want to become a great programmer.
Anyone know if there’s a JCP proposal floating around to provide similar functionality to .NET’s multiple assembly versioning?
Remember the hassle of package conflict that occurred while JAXP was being formalised?
I’ve had problems like this crop up recently and had to revert to some clever classloader partitioning.
Java’s my server side language of choice, which has increased my productivity enormously, but that’s pretty much the last thing I’m looking for…
in any event, great stuff…
I don’t usually answer anonymous post and it would be even more appropriate if you left your email address( i would rather mail you) but here it goes anyway.
It is very wise to learn C as first language although it might look hard at first. C gives you nice outlook on coding styles, algorithms, coputer architecture(C is hell of a low level language) plus it is the language all other ones copy(from Perl through php to Java and of coure C++) so it would be easier to swtich from C. C is elegant though not the bright choice to stay long with nowadays(unless for some particular reasons).
C++ the language of languages, the bright side.
It was said before you can create OOP aplications in pure C but it’s more to OOP paradigm than having some things that behave like “objects”. The C code isn’t much reusable nor it is component based. You can create even inheritance in C(it’s sort of elite geek C training doing this), but why the hell would you do that?
OOP is just more than this, a lot more. It’s encapsulation with access priviledges, polymorphism, dynamic bindings, genericity, code-reusability, multiple and dynamic inheritance and many more.
Long story short, do object coding C++ or maybe Java it’s up to you, because C is pure structural language. And “objective C”(sort of modification) sucks arses, it’s only good for apple users.
back to topic: those are all great features introduced, they should be on since the start. but there are still few things that java lacks, like good preprocessor, mentioned unsigned types + operators overloading, decent(and please clean) math library and few others i am lazy of thinking of.
There are plethora of awesome compilers/IDEs that are considerably fast on your machine, from Visual C++(with SP5 preferably) and C++ Builder 4 through Kdevelop 3.x or KStudio(preferably) to some shareware powerful text editor using GCC.
Eiffel is very elegant language to look for, I think ADA plain sucks.
ok ADA doesn’t suck but why ADA if there’s Eiffel?
david would you mind giving me some URLs and studies on what you are claiming?