Java SDK 1.5 'Tiger' Beta Finally Released
kingkola writes "Finally, after about two years of development, the Beta for Java SDK 1.5, aka Tiger, has been released. Features added in this edition include generics support, autoboxing of primitives, syntactic sugar for loops, enumerated types, variable arguments, sharing of memory between multiple VMs and a bunch of other bugfixes, enchancements, etc."
Link to discussion on TheServerSide.com
Nice to have a link on the top page for old releases. To many times I have gone to the java.sun looking for some odd 1.1.4 or what ever to try and replicate some bug the user is having.
Come the revolution, the Bourgeois, Capitalistic, "A PARKING STICKER HOLDERS", will be first against the wall!
C# innovated 'foreach'?
WTF crackpipe are you sucking on?
What Java is is a memory hog. "Hello World" can easily consume a megabyte of RAM. The shared memory will help this situation. (Incidentally, the shared memory idea was originally developer by Apple for Mac OS X. Apple worked with Sun, and donated code, to make it universal).
There ain't no rules here; we're trying to accomplish something.
A friend of mine is bitching about this: if you type a list, say ArrayList, you can't use that as an argument for a function that takes a ArrayList. He's tried casting it, it just doesn't like it. Anyone else seen something like this?
C# innovated 'foreach'?
Yeah, everyone knows it was Visual Basic.
Yay, finally some proper java support for IPv6 in windows. Im not an IPv6 zeaolot or anything but its great to be able to write (careful) java.net code using generic InetAddresses and be pretty sure that it will work regardless of which version of IP your network is using.
C# innovated 'variable arguments'?
WTF crackpipe are you sucking on?
Yeah - but lets face it, C# really sucks, and the only reason it's around in the first place is becasue Java existed. I use C# on a daily basis and HATE it. C# is just MS's bad hack of Java.
It bothers me when I read statements like this. Maybe Java is slower than C -- it really depends on what you are doing with each language. For example, heavy duty graphics are not going to fly in Java. However, the portability that a language like Java has, the ease that it can be implemented and the support that it is gaining/has gained in the corporate world makes it a solid competitor.
Every language out there has its own advantages and weakensses. C is fast. It is powerful. The gaming industry will probably always continue to use it unless something exceedingly better comes along.
Java is stable. It is secure. It is very easy to code. Web developers and businesses looking to get multiple systems working together quickly and efficiently will continue to use that.
I don't pretend to be an expert, but from what I've seen, Java is definitely a good thing to have around.
C++ had this way before. Next...
Ruby.. next...
Perl...
No, and not always very useful. It's just neat.
In the VM or in the java support classes library, i.e. j2ee.jar
-
ping -f 255.255.255.255 # if only
Grennis: C# innovated!
Inigo Montoya: You keep using that word. I do not think it means what you think it means.
That said, you do give C# much too much credit for "innovation." Microsoft may have a monopoly on a lot of things, but innovation ain't one of them.
There ain't no rules here; we're trying to accomplish something.
I'd say more like C#.
C# did not "innovate" any of these. It might well have implemented them before Java, but most of them were available in various programming languages long before C# arrived on the scene.
Another change that caught my eye was a skinnable theme for JFC called Synth. I wonder if this will help Java capture some of the kewl market for media players etc.
I also see the beta is being made available for 64-bit Linux.
As a platform, Java is still miles ahead of c#. But I sometimes wonder if the message is lost amongst all the specifications and implementations of specifications. The
Everything you mentioned was done in languages (C, C++, Python) years before C# was even existed.
So, finally Java is finally catching up to C#.
Eh, considering C# is pretty much a clone of Java, I wouldn't crow to loudly about being first.
As for your specific points here, I think they illustrate that it is good that Java and C# are competing, both are striving to better themselves.
As for the trollish tone of your post, why take this so seriously? You are not your programming language.
Being bitter is drinking poison and hoping someone else will die
Bollocks to that. C# copied generics from C++ (which likely copied it from somewhere else) and so did Java. And they both (C# and Java) got it wrong and missed the point.
Java didn't have this before? LOL
Lack of enumerated types in Java has been a real pain in the ass as was lack of typedef.
Memory sharing between VMs is not so easy to do when you have umpteen platforms to support. Much easier when you have one like in .net.
What .net lacks however is more substantial. There is no API in .net for doing O/R mapping such as JDO or CMP (belch). There is no API for distributed clustered components like EJB session beans. MSMQ is only usable in the Microsoft world. JMS queues can generally be used to integrate with legacy systems. Java has a bunch of great open source tools for it like Eclipse and all its plugins not to mention the Jakarta project. .net has bugger all for a developers' community, unless you consider Microsoft's astroturfing a vibrant community.
Finally .net lacks real credibility in the enterprise. The company that I work for (biggest consulting shop in North America) has a strategy of using .net for quick several week hack jobs but the real projects are always done with J2EE.
Your pizza just the way you ought to have it.
Here's a very nice PDF giving actual code examples of the new language features:
- Ti ger.pdf
http://www.javasig.com/Archive/lectures/JavaSIG
Remember, though, that this is a beta release of 1.5. Unfortunately, Mac does lag in JDK releases, but not nearly as much as we did in the "Classic" days. If history is a guide, Apple will release "developer previews" of 1.5 before it reaches GM for Windows et al.
There ain't no rules here; we're trying to accomplish something.
Well, it might be in the spec, but it is not in a released product, just like the SDK 1.5 is not in a released product.
They are both in the works.
I played with the alpha and gave a presentatation about it at my employer. Lots of people were enthousiastic.
Plug: java-1.5_new_features_en_v2.ppt
8 of 13 people found this answer helpful. Did you?
generics support
C# innovated this, and already has this in the spec
-- You got to be kidding me, try AdA 25 years ago, much less C++ if you want to talk about an OO language that had it first.
syntactic sugar for loops
"foreach": C# innovated and already has this, implemented years ago
-- Innovated? had been in scripting languages for umm, well since scripting languages existed.
enumerated types
Java didn't have this before? LOL
-- Heh yeah it's not really a horribly useful programming construct. In truth, I've seen way too many bad programmers abuse enumerated types to make thier code hard to maintain and difficult to modify. So woopde do dah.
C# is/was just a glorified MS copy of Java to begin with. I'd hope they would have added something on to an idea they ripped off that someone else already figured out the difficult solutions for.
C# innovated generics...
*cries with laughter*
Linux, AIX, Windows. We can develop our J2EE apps on any of these platforms and they 'just work' on the other 2 with no extra work. It's glorious. Ever try to cross-compile a non-trivial C/C++ program. Yuck.
Blar.
Java is probably the most popular language today;
No it isn't, and it never will be.
Check sourceforge.
You probably just imagine this that because you probably program in Java sometimes and read the glossy Java developer mags. Silently you're afraid you are missing out on all those other wonderful languages that you don't really understand. I call that wishful thinking out of fear.
regards,
Walden.
Looks more and more like Python. All I need now to move from Python to Java is just same small size of memory footprint and ability to interprete the source code. No need to mention FP-things like list comprehensions. Until then - keep your coffe for your blind-dumb managers. I use a real language.
Less is more !
utter rubbish. the opposite is true.
You must make some assumptions about the used classes however verifying the correctness of these assumptions in nearly impossible.
nonsense. THE point of generics is that the work for all types
The reusabilty "argument" is rubbish: that's what we have already OOP for.
nope. subtyping/classing does NOT give you the reusability of generics and vice versa. they are orthogonal problems.
The above mentioned problems create new security holes.
since the above arguments are rubbish, this one is too
That's why the use of generics/templates in strictly forbidden in e.g. the banking sector.
rubbish
Due to turing completeness of most template/generics systems the compiler is slowed down to 30 percent performance.
this is a problem with the C++ typing system. other approaches to generics do not have turing complete typing systems in this sense.
in any case, what's a problem with a 30% slowdown, when you get all the great benefits of increased safety that genericity affords.
More evil is that templates push the grammars into the Chomsky-0 type making secure (=100%) correctness checking impossible.
rubbish.
Summary you have no idea what you are talking about. please read a good book about
typing systems like Benjamin Pierce's
I knew that 1.5 beta was coming out soon, because Apple just released Java 1.4.2.
Actually, 1.5 beta has been available for a few months now, but the link wasn't on the main java.sun.com page.
Here are some highly unscientific benchmarks of startup time I just ran on my Athlon XP 2000+ under Mandrake 9.2:
These are relatively consistent over multiple runs.
The type checking is much weaker thus introducing new potential holes for error to slip through.
In collections, generics make type checking much stronger. They allow you to find casting problems at compile time instead of run time by not boxing things to Object and back. This also gives a huge speed increase (about 300% in my tests).
>>>generics support
>>C# innovated this, and already has this in the spec
> C++ had this way before. Next...
C++ does not have generics, it has templates, which are quite different. Templates cannot be verified when they are compiled, only when they are instantiated. Generics can be verified when they are compiled, so when they do compile you are guaranteed that they will work for any instantiation. Also, generics (in the MS implementation, at least) do not duplicate code as much as templates: methods that can use the same instructions because the instructions do not depend on the actual type share the same code.
>>>enumerated types
>>Java didn't have this before? LOL
>No, and not always very useful. It's just neat.
I do not think there are may people that share that view; I certainly don't. Defined constant integers take more typing to enter, they cannot be reflected over as a unity (as they aren't), and they are not type safe.
I do agree with you that most items in the grandparent post are no innovations, but they sure are nice to have.
When I first learnt Java, I was so excited about the write once read anywhere functionality but many language features (or the lack thereof?) simply bugged me. Then I discovered C# and was happy to have found a usable Java - until I saw the probs Mono is facing porting .NET, particularly System.Windows.Forms, to Unix ... and the fact that they would always have toplay catch up, with no big company to support them (IBM, Sun and other Linux/Open source backers already have a huge stake in Java)
When I read about the proposed features for Java 1.5, I knew i could stick with Java for the long term. Good news!
C# invented them? Are you sure?
> > generics support
> C# innovated this, and already has this in the spec
C++ and Eiffel innovated this. Generics have been available for Java for *years* in this implementation ( http://www.cis.unisa.edu.au/~pizza/gj/ ). It just don't get accepted into Java right away. (BTW, Generics aren't currently part of C#, are they?)
> > autoboxing of primitives
> C# innovated this, already implemented years ago
LISP, C, heck even PL/I implemented this years ago.
> > syntactic sugar for loops
> "foreach": C# innovated and already has this, implemented years ago
Python, Basic, Smalltalk, and Perl did this years ago.
> > enumerated types
> Java didn't have this before? LOL
The new enumerated types aren't simple integers, they're more like Ada enumerated types. They're objects that can be used in switch statements. variable arguments. BTW, enums aren't really needed for most programming as long as you have constants. Many high level languages (e.g. PHP, Python?) don't have enums and there's no strong demand for them.
> > variable arguments
> C# innovated and already has this ("params array" arguments)
FORTH, LISP, and C had this for ages.
> > sharing of memory between multiple VMs
> C# already has this
Actually, this is more to do with multiple implementation sharing loaded classes. Currently Java startup times are slow because classes aren't preloaded or shared as they are on the Microsoft J# and MacOSX Java platforms.
> > and a bunch of other bugfixes, enchancements
> Bugfixes in a language? WTF?
Yes, bugfixes do happen. Oh, I forgot you live in the Microsoft world.....
Seriously, why is it when when C# cherry-picks good features from Java, it's called innovation but when Java learns from other languages it's called playing catchup?
Java has gone very far without these features and it still doesn't need them. They're fluff. The only feature that really needed to be added is the shared memory VMs since it'll solve the perception that Java is slow once and for all. The metadata feature is also nice, but it isn't really necessary. XDoclet had C#-like metadata for years (I believe before C# did). It just hasn't been recognized and officially integrated with the EJB spec.
I really like the new language features (and will use them in about 5 years when our server is upgraded :-().
But Swing is even uglier than before. Metal still looks very old, but now it looks like someone very old with obscene amounts of make-up on.
The GTK+ look is even worse. It doesn't look like GTK+ at all (I'm not even sure whether it's supposed to be GTK1 or GTK2).
Worse: font rendering is abysmal. Buttons and menus are barely readable using the GTK+ emulation L&F. The Java VM still doesn't use Xft/Freetype, which pretty much makes the attempt at GTK+ emulation useless.
I noticed you didnt say anything about my open ECMA standard comment.
It is sad that I have to post this as an A/C since I am voicing an unpopular opinion here on slashdot. Pathetic groupthink sheep.
Are we talking about the same thing ? What's safer ? A Java collection that takes *any* object without type-checking, or one that's restricted to a particular type/subtype ? I know which one I'd take.
The compiler performs at 30% of it's former speed ? Not with the 1.5 beta release. Or the pre-release available last month. Or the generics add-in from last year. Have you tried these ?
Finally I've worked in the finance sector for the last 10 years. Nowhere are templates forbidden as suggested above. I'm desperate for these to be widely used to give the run-time object-typing security that Java has lacked in its collections. This is a huge gain in my book.
J2SE(TM) 1.5.0 New Features
J2SE 1.5 In A Nutshell>
do you know java ?
;). we speak about generics as implemented in jdk 1.5
do you understand what are generics in the context of 1.5 ?
I don't understand how you were moderated interseting.
Here, we don't speak about generic generics
And from my experience, the banking sector avoids STL because they came years after C++, (which itself took years to be standardized)
So you like writing container classes for every possible type that could go into one? Yeah, that's the way to do it. None of this saving time and getting reusability in the horizontal (with inheritance being in the vertical). Why would someone do that?
And there are techniques to get better performance with generics, it's just that the C++ compiler camp hasn't found them yet.
And isn't Lisp effectively a typeless language, or at least dynamically typed? Generics are actually there by default then.
Steve
remember Sammy Jankis
Like you, though, I think it's a bad idea. I'd rather they had multiple inheritance.
Generics weren't innovated in C#. The syntax is semi-borrowed from C++, while the constraining capability was borrowed from Eiffel. Both languages had this capability before C#, while Eiffel had it before C++.
Steve
remember Sammy Jankis
You're talking about C++. Generics in Java 1.5 is very different. Basically, Java generics is a way to avoid a lot of ugly casts when using collections like ArrayList and HashMap. That makes code more readable, and will catch more type mismatch errors at compile time. Nothing more, nothing less. That's a far cry from a "turing complete template/generics system".
If you need to make an assumption about the classes on which you operate, you can either just perform the operation you need (static compile-time checking will usually cause a compile-time error when the class on which you are operating does not give the requisite guarantee, for example, offer the method you need) or, failing that, you can use the Java language feature which was designed to comminicate interface contracts between classes and their users - that is, use an Interface.
" Someone in Suns marketing department should produce a massive wallchart detailing everything Java can do, every major solution for it and arrows showing how they all join together and then mail it out to every CEO / CTO in the country."
Sun has a marketing department? Jeesh, its like saying Novell has a marketing department. This is one thing that companies need to really wake up and smell the coffee on. Although good products can sell themselves, they sell better with good marketing to entice the corporate types. Marketing is the reason why M$ is where it is today.
As much as anyone loves a good berating of a pro-Micrsoft poster, I think both posters missed some relative points.
.NET developer, but I choose the right software for the right job . I'm glad to see Java stepping it up a notch, I just hope that it is not too late.
While the parent mod, loved to cite counter example of technologies utilized previous to C#, I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago. Don't get me wrong, I'm a java (mainly) and
Sig it.
No. Type checking is stronger because you can avoid type casts. (Note, I'm talking about generics in general, not the Java implementation which is slightly broken because of VM compatibility problems).
What the hell are you talking about? Be more specific.
The lack of speed of virtual methods has NOTHING to do with processor technology. It is there because you MUST do a lookup at runtime (which there is absolutely no way to avoid). This will ALWAYS add overhead, regardless of processor technology. The only way to avoid this overhead while still having "reusability" is to have "compile-time virtual methods" (i.e. templates).
Now you're talking pure nonsense. What security holes? Generics AVOID security holes because they avoid typecasts (invalid typecasts are one typical reason for security holes).
Nonsense. Compilers are not slowed noticably down by generics in general. All functional programming languages support "generics" (type-variables is a more correct term), but the compiler for e.g. O'Caml is still as fast (or faster) than gcc is for C code. Compilers for C++ may be slower because of templates, but that's because the C++ templates are nothing more than macros with a little added type-checking (so the compilers usually have to compile lots and lots of extra code).
There is no such concept as "generics" in LISP -- since everything is dynamically typed generics are the default. If you're talking about macros, then some people may discourage them, but those people are idiots. Macros are the precise reason that the LISPs are so powerful.
HAND.
Here is a more detailed look at what 1.5 has to offer.
Some of my favorites:
- Autoboxing and Auto-unboxing of Primitive Types
- Enhanced for loop
- Enumerated types
- Formatted Output
- Concurrency Utilities
- Improved Diagnostic Ability
- Desktop Client
[alk]
More evil is that templates push the grammars into the Chomsky-0 type making secure (=100%) correctness checking impossible.
Chomsky-0 and 1 grammers cannot be parsed by the common LALR parsers, like the once generated by YACC. If your statement were true, there would be an enormous effort needed to adjust the java compilers to accomodate the new grammer.
That C# implemented them is true. That Java is implementing them as a catch-up to C# is likely also true. That C# innovated any of these features is laughably incorrect.
Java has gone very far without these features and it still doesn't need them.
I think that's amazing. I do a lot of development with Java, but it's not by choice... Java is an increadibly clunky language. It is IMHO impossible to do anything elegant at all.
But Java has a huge amount of industry support, which I think is amazing.
Generic is good, if you're smart enough to use them correctly. Let's take the List example.
The type checking is much weaker thus introducing new potential holes for error to slip through.
Plain wrong. With the current list, if you've got a list of Foobar, then each time you want to extract a Foobar from the list, you have to fool the type system with a (Foobar) cast. If what you extracted was not a Foobar, then you get a runtime error (which is exactly what a type system's supposed to avoid). Symmetrically, if you try to put an integer in a list of widgets, the compiler won't notice. These issues are adressed by polymorphic type systems.
You must make some assumptions about the used classes however verifying the correctness of these assumptions in nearly impossible.
Wrong again: basically, a type is the statically verifyable part of the assumptions you make about a value. Maybe you're confused with dependant type systems, that allow to parameterize a type by a value (e.g. an array by its size), and is indeed often undecidable.
The reusabilty "argument" is rubbish
It wasn't for OO, and it is even more false about generics. Obviously quick and dirty code written by coder with low to average skills is not reusable, because writing reusable code asks a lot of smartness, and smartness can not be provided by a compiler. OTOH, STL in C++ are highly reusable, but very few coders are able to produce a code of such a quality, and noboby knows a way to fix that human issue. Reusability is about few code, written by few wizards, and used by many average coders.
The above mentioned problems create new security holes.
I'd be glad to see any concrete example backing this assertion. Actually, the evilest type system feature is the cast, and genericity is the way to get rid of most of them.
Due to turing completeness of most template/generics systems the compiler is slowed down to 30 percent performance. More evil is that templates push the grammars into the Chomsky-0 type making secure (=100%) correctness checking impossible.
Is this a random association of "sounds-good" term you've seen in a theoretical paper, or some very old and approximative quotes from a lecture during which you played Tetris on your phone?
Turing completeness doesn't lead to "slow downs", it immediately causes complete undecidability. The whole point of a type system IS to be decidable, hence not Turing complete, as opposed to the values. Moreover, templates keep the language in the "context free grammar" category. Last but not least, correctness checking is not related to grammars: grammar is just about parsing.
In old languages like Lisps the use of generics is usually strongly discouraged [...]
You know why it's discouraged? because it doesn't exist! List is dynamically typed, so templates don't make much sens. I guess you're confusing with macros, that are, indeed, Turing complete and can arbitrarily mess up the grammer in unskilled hand.
I've really seldom seen such an accumulation of BS in a single post.
Hey, have you seen that film, the one with the white kid who near the end "you're sayin' the same shit he said".
If not, you should see it.
I luv spin. But, if C# says it's an innovator, then it already admits that C# isn't an original language and a pure marketing ploy.
In reality, you may only use the term "Incorporated".
Replace the term "innovated" with "incorporated" in the previous post, and suddenly it's matter of fact, instead of a troll.
Note that templates != generics. Templates are more powerful than the generics in java. In fact C++ templates are Turing complete; I seem to remember someone even implementing the Towers of Hanoi in C++ templates (it would generate print statements which would print the correct sequence of moves. Truly evil stuff!).
Correctness checking the code generated by templates is impossble, but that's just because (in general) correctness checking programs in any Turing Complete language is. So correctness checking an arbitrary C program is also impossible. However, note that type checking C++ templates is very possible; my compiler does it all the time.
HAND.
I don't want to start a flame war, but do you think that the pressure of .Net pushed some of these features through that Sun seemed to be holding off on for the longest time.
.Net made it's comming out in 2002.
Such as enums, generics, boxing, foreach loop, etc.
Just a question that I have had, because I never heard anything about these features comming into Java until after
1.) Type checking is much weaker? How could
int i = container.get(0);
be weaker (where container is a template instanciated for int specifically, so you get compile time error) than
Integer i = (Integer)container.get(0)
where you'll get a runtime cast exception if you happen to be unlucky?
2.) Compile time checking of capabilities can be done with templates. Check out for example the Concept Check library of boost.
3.) reusability rubbish? not if you want a type safe, efficient container library for example (no, the current java library is not type safe. See point 1. And it's not efficient either (try storing ints in a HashMap for example)
4.) I've never heard about any such constraints for banking software, but you might be right on this one. I'd be surprised though, since I'm pretty sure some banking software is written in c++, and the standard library is using templates heavily) Templates creating security holes are beyond me, though...
5.) Compilers getting slower doesn't really matter. Correctness proof is not possible in general (at least, not feasible for real world applications). Templates make this maybe twice as hard. So?
oh well, at least your post was not "informative", but "interesting"...
cheers,
mitch
// "If human beings don't keep exercising their lips,
// their brains start working." -- Ford Prefect
this feature is what c# needs! Too many times I come across all sorts of casting errors, and I can't be botherd typing up all the casting needed.
Um. That link shows Java as having 11132 projects - the highest number except for C++ (12686) and C (12706). Given Java's big uptake in commercial development and the fact that it hasn't been around and mature for as long as C/C++ (how far back do Sourceforge projects go) I'd say you've not really done much to disprove his claim. Java is certainly one of the most popular languages out there today, and might even be at the top of the heap.
Of course, I understand that Britney Spears is rather popular too...
++ Say to Elrond "Hello.".
Elrond says "No.". Elrond gives you some lunch.
Whoops! Sorry, blame it on the (unfair) moderation - I normally don't view posts which are at -1!
I guess great minds just think alike, eh?
Slow Down CowboyNeil, you fucking fat fuck!!!
Aww... someone needs a hug and a warm cup of cocoa!
If we can have millisecond JVM startups, then can we finally write our CGI in java ?
The type checking is much weaker thus introducing new potential holes for error to slip through
...
No, the compile time type checking is stronger. Since, for example, you can declare the exact type that a collection may contain, there's no need for unsafe casting at run-time. This is *much* safer, as a whole class of run-time errors has been eliminated.
The reusabilty "argument" is rubbish: that's what we have already OOP for. And when you now claim performance problems due to heavy stack/virtual methods use: that's an issue of the processor design not of the programming language. When you think that running serious software on system compatible to 30 year old rubbish is cool, then you must accept the performance of 30 year old waste in the same turn.
I don't see what this has to do with generics. But I agree in so far as "virtual" methods should be the default as they are in Java. And they still are. Adding generics to Java hasn't changed that one bit.
The above mentioned problems create new security holes
Such as? I've never heard of such a thing.
That's why the use of generics/templates in strictly forbidden in e.g. the banking sector
Aside from the fact that your argument about "security holes" is untrue on the face of it, this is just incorrect. Evidence? I know people using C++ at various banks, and they've never mentioned any such thing.
Due to turing completeness of most template/generics systems the compiler is slowed down to 30 percent performance
This is true - and actually it's much worse than that. But honestly, is that an issue today?
More evil is that templates push the grammars into the Chomsky-0 type making secure (=100%) correctness checking impossible
Firstly, this kind of thing will only effect a tiny subset of Java programmers. Secondly, correctness checking *is* impossible to get 100% right. Turing showed that, after all
In old languages like Lisps the use of generics is usually strongly discouraged to users unless they are ultra-gurus due to the bad experiences. It's not clear why this should be different for Java or C++
I don't think I'd be going out on a limb to say that you don't really know what generics are as they apply to C++ and Java.
Given that Lisp is a dynamically typed language in the first place, I'd imagine that "generics" are a very different feature entirely in that language. So what are generics in Lisp, exactly?
I find it hard to imagine that anyone is still using Swing these days unless they are locked in to it, SWT is the future of Java GUIs.
I know the compile-time checking for things like ArrayList is a good thing, but is there any note on how this may impact things like HttpSession or HttpServletRequest attributes, where different data types are essential?
I believe that overall, much more time is spent maintaining code than in writing it, and yet languages seem designed mainly for the latter. (Perl particularly!) Some of the changes -- new for() loops, generics -- will improve readability and maintainability too, but I worry that the new imports, and maybe enums, won't. At present, it's fairly easy to look at a small section of Java code and know exactly what it's doing. With no preprocessor, and nice easy scope rules, you can easily tell what names and objects are being used -- that's one of the things I really like about the language. Additional imports, not just of class names but of other identifiers, risks muddying this. Has anyone done much actual work in 1.5 and can speak from experience?
Ceterum censeo subscriptionem esse delendam.
I'm still stuck on 1.3 due to the Blackdown JVM's Debian package not being updated for 1.4. I could do it non packaged-managed, but I'd really rather not...
"foreach": C# innovated and already has this, implemented years ago
...
Innovated?! How long have Perl and Python had this feature?
That's a bizarre definition of "innovate" you've got there
Java as a memory hog?
Yes, and without a lot of careful work this affects performance in real world medium and large size applicatins more than code execution speed.
Shared memory helps?
*Only if you run multiple programs simultaneously*
What is really needed for single program performance is object structure changes so that commonly used things (GUI elements, datastructures, threads...) within a single program share and save memory or are allocated and reallocated from pools automatically. Generally, this is more imporatant on the client-side but each situation is different.
It bothers me when Java's portability is extolled. C is portable too, to more platforms than Java is. And the system call libraries on most platforms have C interfaces, not Java. The only interactions with the host OS that Java supports natively are through the weak File and System objects, through which I can only get the most generic information. For everything else I have to use JNI and, you guessed it, C.
Java's only better if you don't know what you're doing (you can't have pointer bugs, for instance). C and C++ are better when you want to build your language constructs from the bottom up at the same time that you write your program from the top down.
"There is no API in .net for doing O/R mapping such as JDO or CMP (belch). "
There is in the next version - almost identical to JDO (Except that M$ have decided to re-invent OQL at the same time). In the meantime, search for 'bytecode' on the gotdotnet site and find my semi-transparent object persistence code, or look at freshmeat and search for Gentle.NET which is another O-R mapping tool.
Asmo
Try this in Visual C++
you'll get a compiler error stating that i has been declared twice. For some reason, Visual C++ puts the 'int i' in the function scope rather than in the loop's scope.
- C# innovated this, and already has this in the spec
- C++ had this way before.
Actually, first implementations of generics come from the functionnal progrmming community, esp. Philip Wadler et al. So, the java genericity's genealogy would rather lead to Hindley/Milner type sytems, through Haskell
Pretty cool stuff, and it shows that Sun does accept changes to Java from the outside that are of clear benefit.
- Vincit qui patitur.
[humor]Why, yes, he's obviously using Gentoo![/humor]
Michel
Fedora Project Contribut
Yes, enums are generally of little use - but that's because all an enum is is a watered down variant type.
Real variant types, combined with ML-style pattern matching, are incredibly useful. For example, you can define a fully generic binary tree in one line of Caml -Call me again when Java has that level of sophistication and I may be interested.
Our open source SwingSet toolkit for making the Swing components database-enabled/aware will now be much easier to install/distribute. Hooray!
Sun have been promising generics for Java since 1997, and I have been patiently waiting for it all this time.
:)
I haven't had the chance to look at C# in detail yet, but it's certainly no co-incidence that these features finally saw renewed activity after C# appeared. So, thanks, MS, for applying a little competitive pressure onto Sun for us
I'm also a little disappointed to see just how similar Java generics are to C++'s templates. I was hoping that we were waiting for a *reason*, and that reason might be because it was a new and interesting approach. But, at least superficially, this looks almost exactly like C++ templates, with all the positives and negatives that go along with that.
I hate it when someone makes a valid point and gets modded down because it's controversial.
Come to the realization friends; Java IS slow.
Personally, I LOVE Java as a pedagogical tool to aid in teaching computer science, and I had the same love for Logo, but obviously both of these languages have at least one thing in common; they are hampered by the fact that they are slow.
I don't know the meaning of the word 'don't' - J
All I want is structs. Passing by value. Right now I'm working on a funky text editor that needs a little extra info per character, and without structs I have to twiddle bits in a 64-bit integer. Don't really want each character to be a reference to an object, I don't think the performance would too great. Good thing I can cram everything in 64 bits, but I'd rather have a bit more space and reference fields by name.
Doesn't seem like so much to ask.
Broken Bones fan, perchance?
Are you serious??
You should try to do some netowrk programming, say for example real time analysis of netowrk packets, see if java can handle a gigabit network...I didnt think so.
Java has gotten a lot better, and the learning curve is shorter, I think generating machine code from byte code would make it as fast as c/cpp , something like what gcc/java is doing.
sorry officer, left my sig in my other computer.
Sure, there can be bugs in languages too, but your example is clearly a bug in Visual C++'s compiler, not the language itself...
Microsoft has it REALLY easy, and is cut way too much slack, when it comes to development environments and languages. They control the operating system and the hardware specifications and compliance. And, they have done so for well over a decade.
Java is truly platform independent, which is a huge challenge. That challenge was met with a well designed language that operated slowly. However, between 1.4 and 1.5 there are substantially speed increases in the VM which bring it up to par with the fastest languages available.
When you think about developing applications you need to consider many things other than pure technology:
..the list goes on.
- Who will be around in 5-10 years (both MS tech and Java tech will)
- Access to developers (while MS is the clear winner in the US, this is not so in other countries, where even gov'ts are against MS)
- Vendor independence and support (this is clearly in favor of Java)
"Ain't I a stinka..." - Bugs
I mean apparently some level of pressure from dotnet does show up... And that's good I think. Not that I like either of Java or C#... Both look too restrictive (without real benefits) and kinda old to me. I'm leaning more and more to move all the stuff I do to Python (i.e. where I may decide what to do it in, sigh). Slick, reliable, and just very nice to work with.
It seems to me that as time goes on, the JVM specification adds functionality that can possibly exclude it from being ported to other platforms. With this new release, the whole "Shared memory between JVMs".. I am pretty sure there are some not-so-advanced or alternate-goal OS's that doesn't support these kind of things.
Sure, maybe the blame can be put on the author of the OS, but I know that the "write once, run anywhere" vision is starting to slip.
"When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
Finally! I can use a 64 bit version of Java on the Opterons and see how the speed on the large (~6 to 8 gig datasets) improves/decreases
Agile Artisans
Here's a screenshot of my EBLA project using the new default look & feel and the new SwingSet navigation bar.
Curious if 1.5 has a simple method of keyboard entry. As a 1st year Java student, I find it odd that System output is done with a simple command, but System.in is a hoop jumping affair. Of course, I may not know what the hell I'm talking about...
Their basic tactic has always been "embrace, extend, extinguish" - not "steal, sue, squash".
You might want to talk to the many companies Microsoft has stolen from, notably Stac (I think was their name). Sue? Squash? Yep, sounds like Microsoft. You must be living in some weird dream world.
Infuriate left and right
This has been fixed in VS .Net, (if you compile with /Ze) though, Microsoft being Microsoft, this scoping issue is not a bug but a Microsoft language extension (a.k.a. "feature").
Ummm, actually they do release the source, maybe not for beta code, but for the release versions. When my gentoo box upgraded to a new version of gcc, I had to recompile J2SE, took forever but when you ran java -version it would show my hostname. I actually just finished downloading and installing and they do include source (though i'm not sure that you could build with that alone)
no such luck, unless it's from the fortchoming Nintendo game "Goatse: a Link to the Past"
But hey, I'm mostly a docs guy
that explains everything.
The .NET generics implementation is a little different than the Java and C++ versions, in that only one copy of the template code is generated - if you have a List template, and you have lists of 10 different types of objects, you have 10 copies of the list code. With .NET you have one.
- Steve
Java is slow today in 2 main places:
[] because array references are bounds checked, and if you do anything more than minimal array work your bounds wont get hoisted so you're screwed for performance. Maybe the 1.5 compiler will hoist more references, the 1.4 misses a lot of obvious opportunities. Also, there are some optimizations that can be done on 64-bit architectures, so hopefully this will at least get somewhat better in a couple of years. It would be nice if they added an unchecked keyword or something to let the programmer decide when they want bounds checking.
Swing is pretty slow, and I don't see sun promoting any of the alternatives yet.
"Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
Shouldn't 64-bit support come naturally by the VM extending the pointers? Does this mean class files compiled for 32 or 64 will be sub-optimal or incompatible with the other environment?
there are a _huge_ number of problems with multiple inheritance.
for example, if classes A and B are inherited from C and D is inherited from both A and B...
1. do we have one or two parent C objects??
2. which one gets intialized first?
3. when in D, we call a virtual function in of C, is it the A or B overloaded version that is called?
4. and many many more...
Great, now I'm hungry again....not.
Trolls lurk everywhere. Mod them down.
Actually, the scoping of the loop var was changed in the standard a few years ago. Formerly it was function scope, now its scoped to the loop. Your version of the vc++ must be old. If you try that code in vc7, it will compile just fine. Even if you were correct about that being a bug though, it would not be a bug in the language but in the compiler implementation.
:-)
You can try out most of the new features (since they are largely compiler changes) using this preview compiler. It requires a minor amount of fiddling with the scripts, and the new coolness is your reward.
Slashdot looked deep within my soul and assigned
me a number based on the order in which I joined
From Ada-83
Another thing regarding the packaging that pisses me off is that the RPM version for Linux they distribute behaves unlike any other package you can find on your system. Java is the primadonna that refuses to fit in, "Oh, you think just because you installed the RPM that you can actually run the program now? Hah!". Why distribute it as RPM if you're going to start creating top level directories in /usr, what makes Java so special it thinks it deserves this privilege? Maybe on Solaris you can get away with that sort of stuff, I dunno, but not on Linux in 2004.
THIS is how RPM packages work (Sun People take notes):
1. I install the package.
2. I type "java" or "javac" and the program better run!
3. There is no step 3. The browser plugin and other stuff if applicable was autodetected and installed in step 1.
Ok, I'm done ranting now.
"However, Java's OOP is a little limited in one aspect: it doesn't allow multiple inheritance."
Actually, multiple inheritance _isn't_ "real" OOP from an OOP theoretic viewpoint, it is simply a C++ specific OOP implementation.
Multiple inheritance is also riddled with problems, which is why Java omitted it on purpose. The problems are everything from "simple stuff" like what happens if a class inherits from two classes that both have the foo() method in them, and the inheriting class doesnt override it? You are most likely bound for trouble using multiple inheritance, its more of a headache than useful.
"I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago."
I think you in turn missed his point. The post he was replying to claimed that C# had innovated these features. He was demonstrating that those features had in fact existed in other languages previously.
I never created container classes for every type-specific container I wanted. If I wanted typing in the elements of an ArrayList, for example, I wouldn't create a FloatArrayList and an IntegerArrayList. That'd be a waste of time. Instead, I'd create a TypedArrayList that extends ArrayList and takes a Class in the constructor. Then, whenever you store anything in that collection, it checks the class of the object you're trying to store against the class specified at instantiation time.
It's not as clean as generics (I'm glad they're here), but did anyone seriously write fifty different ArrayLists, one for each type they needed to store in there? That's not using your head...
sev
but have you considered the following argument: shut up.
As long as you compile with JDK 1.5, the new language features are available to you now -- except the generics implementation of the collections classes and even that is solvable. This is because the bytecode generated by the JDK 1.5 compiler is 100% compatible with JDK 1.4.
I have recently switched one of my company's JSP sites to jrocket from BEA because we noticed a visible speed improvement using it over SUN's jvm
I would like to use SUN's JVM.
Does anyone know for sure if 1.5 has any significant performance improvements?
Steve
Typical for M$ - innovation means copying from somewhere else...
I've played realtime 3d games on java, and it doesn't look slow to me. Oh, wait, I _write_ realtime 3d games on java, and it doesn't look slow to me.
You can't just "recompile" Java. There are lots of architecture specific code in there that requires ALOT of work to port. Go download the SCSL code from Sun, and then tell me how easy it was to port to HPUX.
You dont understand, just so the manager can keep his $250k job, he has to justify it by refusing developer requests, and say, "no to points 7 thru 12". Otherwise if he agreed to it all, whats his job purpose? Any good developer can self micro manage.
We know sun can't afford 15 machines and an auto compile script, even compilers with different system outputs.
Seriously, I think java has those other venders under partner relationships so they 'tweak' it for those systems if they feel like it, but still, they should get of their ass, we aren't asking for 12 dvds per platform sent out to 50000000 homes like AOL.
Liberty freedom are no1, not dicks in suits.
Heh....good points, and "foreach" is even older than that.... Wasn't it in csh?
Don't whine at Sun my friend...go the the HP site and get the JDK from them...they may have even released a 1.4 version by now...
Oh BTW, since Sun itself only directly supports Linux Solaris and Windows with all of it's other software, you should not be surprised when they don't release a BETA on another platform. *BSD may be good, but Sun are not experts in *BSD. When The 1.5 SDK is final, I'm sure you will see a quick release to *BSD, jsut as there is a 1.4x fro *BSD now (actually maybe only NetBSD but there is one....).
You see, unlike some other software giants, Sun will let other companies and organizations port Java to their platform at their own speed since they are the experts not them...
Never by hatred has hatred been appeased, only by kindness - the Buddha
the JDK 1.5 compiler is 100% compatible with JDK 1.4
Unfortunately, you're wrong.
To use the new language features, you have to use the "-source 1.5" switch with javac from 1.5.0. That makes javac create bytecode that can only be used with JDK1.5 (see the javac docs).
Is it just me who loves that typo?
To have a right to do a thing is not at all the same as to be right in doing it
Hotspot checks your array indices, and if it figures that no bounds are broken, the checks are disabled. So if you loop over an array a couple of times, C and Java perform almost identically. You can easily check this by benchmarking.
- If one can only read values of type C with A methods, then the relation is covariant, i.e. to get A<As> <: B<Bs> we need As <: Bs.
- If one can only WRITE values of type C with A methods (e.g. pass them as function parameters), then the relation is contravariant, i.e. to get A<As> <: B<Bs> we need Bs <: As. Counter-example:
- If parameters of such types can be both read and written, then you need both As <: Bs and Bs <: As, i.e. As == Bs. That's what happens with java. If you want your structures to be covariant, you have to forbid their modification (here, forbid to change the cells' contents).
If in some exceptionnal cases you want to enforce subtyping, it's up to you to use casts. But you cannot assume a bogus subtyping relationship without noticing it, therefore the type system did its job.It's a convenience, to be sure, but it seems to me that autoboxing is a setup for programmers to make mistakes, as certain classes can get automatically and invisibly created, where before there would have been an error message issued by the compiler. Hopefully there's a command line switch to disable it so that the compiler can still catch those errors.
Everything else in 1.5 I absolutely love.
File under 'M' for 'Manic ranting'
But, but, java was the language designed for idiots - what's this? You're saying you have to be careful? That's not the spirit in which java was created.
The vision behind java is you can hire a bunch of idiots, throw them at some problem, and maybe the code looks terrible, but it'll run, and you can pay them less.
The Java version works this way too. Only one copy of the template code is generated. Even C++ is allowed to work this way, by the specification. It's just that virtually no C++ compilers actually do it that way.
If the only tool you have is a straightjacket, everyone else looks insane.
Scanning the docs, I don't see anywhere where it says that's a problem.
Wouldn't it be possible to java -source 1.5 -target 1.4?
Information: "I want to be anthropomorphized"
Java conceptors did not want a C++-ish feature, ie 'preprocessing inside', they want somethin that will not break the object point de vue of Java.
;-)
.net almost 4 years old now (if you include earlies and beta ey!).
About the other functionalities,
enum was discussed long time ago, but they did not think it worth adding it. But according to experience, it appears that having some defacto feature is better that depending on people to understand an advanced pattern pro&con.
The foreach loop, was long time requirement, since the collection framework appeared, but unfortunatly they did not had time to build this in befire.
About the boxing and anotation, those are just MS ideas improved ! Who gonna blame Java for supporting interresting features ? No MS that just CC the Java spec after leaving the Java playgound in late 1998
Anyway, the new functionalities and improvement are so dense that IMHO, this is the best release ever brought out of Java !
FYI,
Umm, yeah, I call shenanigans.
Collections still contain only Objects, which must generally be downcast to be useful. Generics just automate this downcasting. If anything, generics result in *less* efficient code, as sometimes you don't need to downcast all the way to Integer when you just need a method from Number.
Okay, so maybe you're just misinterpreting the results, not lying. That's the thing about ad-hoc benchmarks: you never know quite what you're testing.
"In a 32-bit world, you're a 2-bit user. You've got your own newsgroup, alt.total.loser." -Weird Al
And many serious problems remain with the Java language:
The most serious problem with the Java platform is and remains, however, that it is basically proprietary: all Java 2 platform implementations depend crucially on code licensed from Sun (e.g., there is no independent Swing implementation). Furthermore, there doesn't exist a Java standard that people can implement without having legal constraints imposed on them by Sun.
Java is NOT portable in my gentoo running kernel-2.6.2
I want the JVM-1.5 sources !!!.
open4free
No (assuming you mean javac). javac reports "javac: source release 1.5 requires target release 1.5" if you try that.
For example, here is a recent paper that includes a comparison of Java and C/C++ for XML processing tasks. The conclusion is that Java based implementations are not yet competitive with the C/C++ implementations.
Don't get me wrong, I *love* Java, but when I do highly performance critical stuff, it's just not the right tool for the job.
We recently switched from Java Servlet development to ASP.NET, and ASP.NET is MUCH faster to develop in. Yes, I know that we're locked in to MS OS and server, but given the incredible productivity increase, this is a small price to pay.
All things being equal, I'd much prefer to stay away from MS. But ASP.NET is far too superior a way to go.
It looks like the new Java release finally makes it roughly as good as C# (or Delphi, after which C# is modeled), but more is needed to for the Java world to be as efficient as the ASP.NET world:
1. A good IDE. In ASP.NET, I can drop components on an HTML form, which bypasses a lot of HTML grief. The entire paradigm is easy-to-use and integrated. In Java, I need to use the comparatively awkward Eclipse or Forte IDEs, muck with Dreamweaver and whatnot - it's a productivity-destroyer.
2. Servers that are not obtuse. I can get IIS to do anything in about 5 minutes. It takes hours or days to do anything in Tomcat or Resin and Apache. My time is precious.
a Swing app in 2.5 secs? it takes about 2 secs to start gedit, a freakin' text editor.
pr0n - keeping monitor glass spotless since 1981.
C# language? Maybe. But .NET framework? I dont think so, though in places one is ahead of the other. And Java has some things (EJB) that it is not clear the other needs or wants.
.NET is that it adds many features by binding straight to the windows implementation. The file model? WinNT. The data access model? Sql Server. The UI model? Windows.
.NET gets interesting is in Longhorn, though it will be some time before that moves from being a VMWare image on my box, to being the base OS.
The thing about
Where
Generics just automate this downcasting.
My understanding of generics is that the type-cast is completely omitted.. If the compiler can PROVE that what is going in to the collection is a Foo class, then when you pull the material back out, no type-cast is needed. Thus it is in the retrieval of generalized objects that performance is saved.
So again, to my understanding there is NO downcasting.
-Michael
I may have missed it, but I couldn't spot a final release date. Anyone know?
I'd like to use 1.5, but I don't want to ship a commercial product based on a beta devkit.
But also on the platform.
.net.
.net impl). Whereas Java do run on most OSes !
:)
Do not forget that Java (the name) is used for 2 things : The Java platform, and the Java language.
By default, you application for the Java platform using Java language itself (like you defacto develop in C# for MS.net), but there are lots of differents language that can compile to java's bytecode as well.
IMHO, the strength of Java is the platform and not the language. Without the platform concept, it would never have been different from his ancestors C++/SmallTalk/ObjectiveC ! There is the big difference with
MS.net only run on some MS windows OS (No Mono is not&will not be a complete and real
This is no b*illsh*it but just truth.
If you want to contribute to Java libre world then i invite you to join the FSFGNU Classpath project, as they are building a full GPL implementation of the Java platform!
This can exist because all Java spec (JSR+TCK) are available to the public (including Reference Implementation) so even if the RI is not GPL, you can just create a new implementation that apply whatever license you want. That's how Java managed to balance freedom & compatibility
Linux+Java is the baregain for enterprise solution, and with Java 1.5 and Linux 2.6 functionality & TCO are there ! Here we got the reference platform for developement of the next decade.
I'm crossing my fingers...And I must say, I'm quite excited about future possibilities...
Just think:
Java 1.6 : Overloadable operators
Java 1.7 : Pointers
Java 1.7.1 : Void Pointers
The prospect of the combination of overloadable operators and pointers? Oh baby baby baby!
Apple (finally!) has a 1.4.2 out, and it's superb. For a brief moment, OS X is up to date on Java.
Does anybody know anything about Apple's timeline on 1.5? Will we see a beta? Will we at least see a concurrent release? Apple has been notoriously out of date in the past, but they swore that they would improve; now's the time for them to prove that they are.
AS far as i know, BeanShell is able to execute (read: interpret) *any* java code. That doen't help with the memory-footprint, but it allows dynamically generated java to be run without having to invoke a compiler first.
BTW: The BSF (Bean Scripting Framework by IBM) has a engine-interpretation that allows using java-code as scripts. This is however implemented to compile the code into a class-file (which is quite slow the first time you run the code).
BSF is REALLY COOL as it provides a generic interface to scripting languages. So you can make your app scriptable without having to worry about the scripting language to use. Languages supported include (IIRC) JavaScript, Java, Python, Perl, Tkl, BML (bean Markup Language) and even Scheme and VB (i think). And it's quite easy to implement a custom engine for other languages...
I have discovered a truly remarkable sig which this 120 chars is too small to contain.
Britney Spears is rather popular too...
Yeah, and if you peek under the JVM's covers, you'll find it has nice legs and titties, too. This explains why most Java programmers are men and lesbians.
Now if they would just implement unsigned types (uint, ushort, uchar) the jvm could be used much more effectively for lots of things. Especially vision, graphics, and all kinds of numerical algorithms.
Guess what? I got a fever! And the only prescription.. is more cowbell!
Has anybody tried to download and install this baby on a Windows XP machine? I'm not able to use any of the new features (compiler tells me that symbols (methods, etc.) are unknown).
Is this possible? I don't have any other JDK on my system and I took the examples on the Sun page. Is anybody else experiencing this?
No...Please re-read my post. I never claimed C# innovated anything...I said they were the first to put them all under one roof.
Sig it.
Sun are not experts in *BSD.
Well, they used to be...back in 1982. Solaris and the *BSDs are cousins, so they best not be courtin' now!
Vote in November. You won't regret it.
He (teromajusa) wasn't claiming that you (AbbyNormal) claimed that. He was claiming that sporty (in the great-great-grandparent post, or thereabouts) was bashing the original poster for claiming that C# innovated these features.
Java is for the idiot programmer. I bet you just lost 95% of the readership, when you emitted that line of code.
Java isn't about development power - it's about management power. It's about being able to hire idiots to write bloated code for big companies and pay them peanuts.
All of the people who like java are nothing more than mgt's biatch.
[T]he type-cast is completely omitted.
Wrong!
Well, I'm pretty sure you're wrong. Take a look at http://www.artima.com/intv/generics2.html , specifically the section titled "Comparing C# and Java Generics". All that's happening is that the compiler is inserting those downcasts for you. Well, it's also verifying that whatever you put into the Collection is the right type, but that's at compile time, not runtime.
It'd be neat if you were right, though. Point me to your source on the no-casting solution, and it'll make my day.
"In a 32-bit world, you're a 2-bit user. You've got your own newsgroup, alt.total.loser." -Weird Al
.Nyet. I like it. If you don't mund, I will adopt the term from now on... :)
Just skip this and program in much better JVM based languages than Java:
Scala
Nice
Prior to macOSX apple didn't bother to release newer javas (I think 1.2) because the OS8-9 wouldn't support some of the features it needed. Most modern OSs should easily support what the JVM needs
The fastest you have a running program, the better. Everything else, nice as it may be, is accessory. If you want to read something buy a book, I garantee you will find better entertainment. If you want to understand a program, read the docs, the comments and the diagrams.
I'm glad to see the JAXP tools finally embracing DOM level 3 and SAX 2.0.1. All sort of XML Schema goodness involved there.
Of course Apache's Xerces-J has this support for a while with 2.5 (2.6)? Yeah it should be portable but, eh, why switch horses midstream?
What is music when you despise all sound?
Swing is pretty slow, and I don't see sun promoting any of the alternatives yet.
You need SWT. But I don't think you'll see sun promoting it:)
It's nice to see that a Java site such as theserverside.com completely ignores Mozilla. Check it out for yourself...
"Access to developers (while MS is the clear winner in the US..."
Says who? I haven't used a MS development tool in what...7 years now. They may still rule the desktop with regard to OS, but dev tools don't necessarily follow that. It's been Borland and IBM for me....
This release is fantastic. Java keeps on growing.
-----------
Create a WAP server now
It was my understanding that the first versions of Java were called simply "Java". Then at some version (1.2?) they started calling them "Java 2", despite not being 2.0. So, is this 1.5 version still "Java 2" or have we moved on to "Java 3"? (which, as I understood it, was the title likely associated with 1.5)
Schnapple
You know why it's discouraged? because it doesn't exist!
Not true -- Common Lisp has generics.
Lisp is dynamically typed, so templates don't make much sens.
Lisp includes facilities for specifying static types, so its templates. However, generics are useful for more than just static typing; they provide polymorphism that inheritance alone can't provide.
I guess you're confusing with macros, that are, indeed, Turing complete and can arbitrarily mess up the grammer in unskilled hand.
He probably is confusing SOMETHING, but macros aren't discouraged in the Lisp community
I've really seldom seen such an accumulation of BS in a single post.
I agree with this sentiment, although I've seen worse
-Billy
macros aren't discouraged in the Lisp community :-)
Indeed. That's "unskilled hands" that are decouraged :)
The downcasts must still be in the bytecode -- think about the JVM security model, and the bytecode verifier.
Of course, IMNSHO the whole "Java 2" name was just marketing run amuck. I don't see how it's done anything but cause confusion. If marketing absolutely insisted on having a "Java 2", engineering should have bumped the version number to 2.0.
I'm not a fan of marketing determining version or release numbers, nor version number inflation, but changing a marketing product name to include something that looks like a version number without having it match the actual engineering version number is obviously bad.
I used to love Java. Then came the fuc**** dotnet world to wreak havoc. Now Java responds well enough for me to take a look at it again. :P
Sorry. You've confused source and target. If you compile with -source 1.5, it tells the compiler to allow the new 1.5 constructs in the source code, but the target bytecode is still 1.4 compatible.
There have been no bytecode changes in the JVM since it was released, though class file formats have changed.
It's nice to see that a Java site such as theserverside.com [theserverside.com]completely ignores Mozilla. Check it out for yourself...
What are you implying? The site comes up fine in mozilla based browsers.
Big installation aside, it installs a giant .MSI file, plus a backup of all the library files! Does anyone know how to turn the duplicates off?
You've confused source and target.
No. -source 1.5 implies -target 1.5. And even if the bytecode is basically the same, jdk1.4 refuses to run code compiled with -source 1.5 (with javac from 1.5.0beta). All you get is a java.lang.UnsupportedClassVersionError.
I'll just clarify a fact that has been missed or somewhat obfuscated by other replies. You're completly confused as to relationship between macros/templates as found in C++/LISP and how they are used for achieving genericity in C++ on one hand and true generics as found in Ada, ML, C#, or Java 1.5. With the latter kind the generic functions/types can be statically type checked in isolation, long before it is instantiated as must be done for C++. When they type check they are type safe and end up providing much greater type safety than Java 1.4's idiom did, by providing type constraint on type parameters and type guarantees on collection content.
Generics are not templates, but genericity can be achieved using templates. However, since generics aren't as powerful as templates they are also very easy to make perfectly type safe. You have some (fun) learning to do!
-
Listen. Strange women lying in ponds distributing swords is no basis for a system of government.
will be code like this:
s ()) { ...
Enumeration enum = collection.elements();
while(enum.hasMoreElement
}
Guess what... that is a compile error now. "enum" is a new keyword, and is no longer valid as a variable name.
Scott
Actually, C#, C++, and Java's OO systems are not conceptually similar to Smalltalk.
If you want languages that implement an OO system with semantics similar to that of Smalltalk, try Ruby or Objective-C.
All the systems do have inheritance, encapsulation, and polymorphism, yes, but beyond that they differ.
The former systems have very rigid 'static' type systems -- types are determined at compile time, and are verified by the compiler.
Smalltalk-like type systems are much more dynamic. Types, as such, aren't seen as being as important as the kinds of messages an object can receive. These systems have the disadvantage of requiring a small runtime to keep track of what object can receive what messages, but they allow marvelous flexibility, and lend themselves to quite a different style of programming.
It's interesting to note that the generics support that's been added to Java 1.5 is completely unnecessary in a dynamic language like Smalltalk, and, in effect, is an attempt to wallpaper over some of the unnecessary coding that a static type system require.
If you've tested it, then I believe you, but the docs are wrong then because they say "target -1.4 is the default."
I understand that multiple inheritance can be complicated in some situations, but it can be useful when used carefully. Why can't the compiler just force you to be explicit in the case of a conflict?
The docs are (obviously) not very clear. But in fairness -target 1.4 is the default - unless you specify -source 1.5.
Actually, it's like this:
C++: generates 10 copies during compile
dotNET: generates 10 copies during runtime
Java: generates 1 copy (generics is only at the syntax and code verification level)
http://www.artima.com/intv/generics.html
This explains why most Java programmers are men and lesbians.
Don't you think that can be explained by the fact that most people are men or lesbians?
I've had this sig for three days.
In many languages nowadays, be it fortran, c++, perl, python, etc. etc. etc. it is possible to use straight math operators on arrays or matrices, which has a clear and concise syntax that everybody that learned math understands. This cuts down on the code to write, the formula is clear and can actually be looked up in the original paper if you care, and, the libraries are usually pretty well optimized. Compare this with java, where, if you use a matrix library, you get some cooked up API that doesn't resemble the way you think about arrays of numbers at all.
Okay, as you seem to claim that operator overloading is absolutely bad always, please explain why:
matrix c = a + b - c;
is bad, and
String c = a + b;
is considered acceptable? Hell, the addition operator on strings isn't even associative.
Hey there.
I was wondering if you have any info on 3rd party SDKs or JREs for Mac OS X.
Specifically I was pretty annoyed that no official 1.4 JRE was ever made available for Mac OS 10.1, and now I strongly suspect that no official 1.5 JRE will be available for Mac OS 10.2
this is not a bug in the language, it's a bug in the compiler. Given that this is MSVC such bugs are not at all surprising.
Just replying to one in a whole series. Guys, don't you realize that the word 'innovate' when used in the context of MS means 'appropriated'? Give the grandparent a break, it's a good troll.
My beef with Java is that the Sun SDKs are such a pain in the ass to download from a command prompt.
They use some extremely arcane methods to make sure you have to agree to their licence (which is fair enough) but then once you've started downloading, you can't pause and resume! I even tried their stupid download manager, and it couldn't deal with it.
For those of us on modems (and have ISPs who boot us off every 2 hours to avoid hogging), this is really annoying. I had to get a friend with broadband to download it, then upload it to my FTP server.. so I can stand a chance of downloading it properly!
Um, STL.
However, Java's OOP is a little limited in one aspect: it doesn't allow multiple inheritance. ... otherwise known as schizophrenia. MI isn't central to OO, both Smalltalk and C# do without it too. So perhaps it's MI that's the bad idea?
Using nested classes as delegates you can accomplish nearly anything you would want to use MI for anyway.
I've seen some really complex explinations in this thread. It's really not that complicated. If an argument is of a certain type, the supplied value must be of that type. End of story.
So, let's think about inheritance. All ArrayList objects are List objects. However, not all List objects are also ArrayList objects. If you declare a variable as List, all anyone knows is that it is simply a List object, even if its initialized as ArrayList. You can, however, test for the type of the value ( getClass().getName() , instanceof , etc.) and then cast appropriately. So, if you are certain that your List variable contains a value of type ArrayList, you can down-cast it to ArrayList and pass it in.
By the way, at the risk of being too specific, here's a pointer when you're using the Java Collections Framework. Usually, you want to use the interface classes for your arguments and return values. Use List, Set, etc. for arguments and returns, not their implementations. The whole point of an interface is you don't care how it's implementing, you just care about what is implemented. In certain cases, you do care about the implementation. For example, TreeMap sorts the entries by key, where as LinkedHashMap guarantees the results will be kept in the same order as they were added. These properties are useful in some cases, but in general, use the base class whenever possible.
So, in summary remember or learn inheritence rules and the distinction between the type of a variable and the type of a variable's value.
Join Tor today!
The "enhanced" loop removes readability from the language, but just that.
Autoboxing is more problematic. For example, if you declare
you might be thinking the intList is backed by an array of ints (int[]), but they are not. They are backed by an Object[] and every element is an Integer.
AFAIK, There is no way to create an ArrayList backed by an int[], so you have to create an alternative class or use int[] directly, but naive programmers are surely going to believe that an ArrayList will be as efficient as an int[] when it will clearly not be.
My heart is pure, but make no mistake, it's pure evil
...this should not be a reply-to-self but a reply to the AC telling me about OCAML. damn.
I have discovered a truly remarkable sig which this 120 chars is too small to contain.
Come on, cut the guy some slack. He's obviously using the term the microsoft way, which means 'appropriated'. Innovation is not a verb, that alone should have given you some clue.
Kind of funny, considering that Solaris is a derivative of BSD.
Join Tor today!
Among all the posts from java users containing disinformation, paranoia, and FUD about C#, I finally found an _even more_ biased one going the other way!
I shall call this new sport 'ignorance surfing'.
Whence? Hence. Whither? Thither.
Compare the rendering of the page in Mozilla to IE. I'm using Firebird 0.7 and the header section is borked.
I remember OpenGL being announced, but never saw any mention of it again. The JOGL site seems to be dead. what is going on? First they get my hopes up...
I'm using Mozilla 1.5 and is just fine. A great improvement over the previous theserverside L&F that had problems in Mozilla.
"I think this line is mostly filler"
That's funny -- it seems that in another 4-6 years the language features of Java will approach those of Common Lisp.
The main difference being that CL is standardised and thus isn't a moving target -- you don't have to worry about the language changing from under you every once in a while. You can concentrate on your libraries and applications.
Mark my words. All of that will come in time.
See, Java started out like so many projects. "We'll do it better because the current stuff is too complex."
Then they learn, like everyone always does, it's complex for a reason.
The ratio of people to cake is too big
Finally! I can use a 64 bit version of Java on the Opterons and see how the speed on the large (~6 to 8 gig datasets) improves/decreases
Unless and until the language supports a construction like the following, so-called "64-bit" support is utterly meaningless:
So: Did we get 64-bit array indices this go-round? Or do we have to wait another two years?If the latter, then: HELLO C#!!!
I'll correct myself, it doesn't render properly at 800x600 in Firebird 0.7.
Sigh
I think this internet thing sounds like a good idea
I saw an estimate once that 80% of the time spent on code is maintenance. (Of course, this will vary between systems and projects. But it seems reasonable IME.) That means that people will spend four times as long reading code, amending it, extending it, and fixing it, than they do writing it in the first place. Code that suffers from being knocked out quickly takes longer overall -- bugs are harder to find, it's harder to change without breaking, it's harder to learn from, harder to fix, harder to read, harder to do anything with. That applies whether it's the writer or anyone else -- but especially for anyone else, who might have trouble following the author's disorganised thought processes or labyrinthine code.
IME, clarity and neatness isn't something you can turn on and off. People who don't care about how code looks or functions, often don't care about how well it works, or even whether it works...
As another commenter said, I hope I'm being trolled here!
Ceterum censeo subscriptionem esse delendam.
I would like to ask the question "what fool came up with the idea of writing code inside comments, aka metadata" Are we now not allowed to change comments anymore? This is pure stupidity... At least C# solution is more elegant than this. Sorry.
That's exactly what I was wondering. I was getting. Example:Now it works. Thanks!
A programmer is a machine for converting coffee into code.
I'll correct myself, it doesn't render properly at 800x600 in Firebird 0.7.
.8 of firebird. The site can't really be held responsible for the fact that different versions of mozilla browser's render it differently.
If you are going to use a pre 1.0 release of anything, you aren't really entitled to complain, especially when you aren't even using the latest pre 1.0 release of said software. It renders fine in
Reflection breaks the typesafety of the generics model, which is enforced only at compile time. Therefore, any reflection-driven manipulation of generic collections, such as via Jython, will completely bypass the typesafety of the system, probably yeilding ClassCastExceptions at retreival time (I've not played with the beta yet, so I'm talking out of my ass a little bit here).
It would be nice when / if the EJB CMP relation interfaces switch from vanilla Collection and Set to these typed collections. Would ever so pretty up EJB code!
* - A Lisp macro is a function that manipulates it's arguments before they are evaluated, with the result spliced back in the place of the macro call (this is pretty much the same thing as parse-tree manipulation in languages without explicit program representation). Peter Seibel's upcoming book explains them very well.
PS - Note that when I say Lisp here, I'm referring to Common Lisp. Scheme macros ("syntax-case") are a bit different, and Scheme doesn't come with multimethods or other goodies.
In the great CONS chain of life, you can either be the CAR or be in the CDR.
Firebird 0.8, hmm?
Most languages seem to use . to cat strings, but I suppose Java needed that operator more elsewhere :)
Personally, I don't mind using -> to invoke a method. It gets around the overloading problem and doesn't seem like that much extra typing when you consider that most of the stock classes and methods have incredibly long names. Which leads me to my pet peeve, the encouragement of one letter variable names, leading to bizarre stuff like:
PortKnocker p = new PortKnocker();
p.knockOnSomePorts();
Vino, gyno, and techno -Bruce Sterling
C# copied generics from C++
.... try remoting with IIS to achieve scalability and distributed performance.
.Net for the moment is supposed to be used on MS Windows
.Net is catching fast. OpenSource tools for .NET. Consider SharpDevelop. Not enterprise quality. But usable. Enterprises and professionals can always afford Visual Studio.Net
.net lacks real credibility in the enterprise ... just check google.
.net for quick several week hack jobs but the real projects are always done with J2EE. .Net coders in your company.
Wrong. Generics(templates) in c++ is more like macros. (You can read up on what i mean)
O/R bridge(JDO-CMP)
This is not really as important as you claim it is. In any case, you will get equivalent functionality if you derive your data-related classes from a dataset.
There is no API for distributed clustered components like EJB session beans
ahhh
MSMQ is only usable in the Microsoft world
But
Java has a bunch of great open source tools for it like Eclipse and all its plugins not to mention the Jakarta project
Considering Java had a headstart, and the equation between them right now, you see that
Finally
You will be surprised at how many sites are turning to ASP.Net. I just met someone who told me that Infosys(large indian company employing 20000 people) ported their Core banking solution(Finacle) to C# using JLCA. Numerous otehr examples
The company that I work for (biggest consulting shop in North America) has a strategy of using
Simply means that there arent enough good
Life is just a conviction.
It is. Maybe you learned to make do without one but it is a pain in the ass. Don't even try convince me otherwise.
try remoting with IIS to achieve scalability and distributed performance.
Homogenous clustering is not always the answer. Heterogenous clusters utilise resources more effectively and some things simply cannot be built without them.
See, here's the crux of the problem with Microsofties. They want you to convert to everything Microsoft so that their new pet project will interoperate with their MS stuff. Yeah, most companies are going to ditch all their existing enterprise solutions just so that they can bring
Finally .net lacks real credibility in the enterprise
Throwing up a webpage with a shopping cart is not building an enterprise solution.
means that there arent enough good .Net coders in your company.
.Net is not ready for the enterprise I take their word for it.
We have many folks here who have 10 years experience coding on Windows and if they say that
Your pizza just the way you ought to have it.
If your code only depends on other open source software, you are correct. If you must interact with closed source APIs then things get ugly. Your shared libraries just work on multiple Unix servers? Java server plugins do.
Blar.
Innovated?! How long have Perl and Python had this feature?
Ten years, twenty, who knows. But you don't except 11 year old pre-teen like grandparent to know that.
This is a new feature Reachability of host
Implemented using ICMP & echo !
And will help Scripting and dynamic bytecode generation tools Yet another cool feature in Tiger :)
The apps we've developed with SwingSet all use a shared connection.
True enough, but that hardly qualifies them as experts in OpenBSD, NetBSD, FreeBSD, ${any other BSD I don't know about}BSD.
And if that's the case, it shouldn't be too hard fro some smarty-pants *BSD guy to sign the SCSL, get he 1.5 beta source and make a *BSD port from that... or use the Solaris one.
What?
You mean *BSD and Solaris are not binary compatible? You mean they have drifted that far apart? You mean Sun may not actually be experts in any variation of *BSD except Solaris?
Who'd have though...
Never by hatred has hatred been appeased, only by kindness - the Buddha
I wonder if Sun plans to roll out a Java programmer certification upgrade exam for the 1.5 platform before my 1.4 certification expires in March 2005.
I have indeed set off a number of bullshit detectors, and rightly so. I apologize. My statement that C# code must be run on a Windows-supported platform under Windows is incorrect. This is admittedly very old information that I should have checked out, in fact the only time it could have been true was in the formative stages of the language and the .NET platform.
I try to be as responsible as I can in posts to the /. community because it is the first forum I've found that self-moderates so well (in most cases, anyway--I'd apply a negative mod to my own post here if I could).
Anyway, thanks to those who pointed this out.
sev
but have you considered the following argument: shut up.
I too thought of this as a possible means of explaining this situation, but rejected it (and I'm referring to your intended meaning pointed out by tbspit in this thread). The explanation you put forth here does not satisfy because the same argument could be applied to Integer[]s and Number[]s.
Alas, the corresponding array code does indeed fail at compile-time, and it is well-defined and unambiguous:
There's no reason in generics why the compiler couldn't have been designed to similarly reject code if you replace the arrays with type-parameterized ArrayLists.sev
but have you considered the following argument: shut up.
Yup
Bablefish Translation of Parent Post:
"Shit! I know C inside out, even the tricky stuff like not dereferencing null pointers! Who's going to pay me $$$ to be that smart when any yahoo with a copy of Eclipse & the JDK can write apps for any platform! Hmmm if only I'da thunk a bit longer, I could have brought up a real objection to the Java language - no guaranteed behaviour at object destruction, for example. Too late now though.."
Worthless. Pitiful.
None of your angle brackets are being rendered.
Discussions of generics never seem to get very far on Slashdot.
I know various people that are taking Intro to Computer Science at my university. The class starts out in Scheme (ie Miniture LISP) then progresses on to JAVA. There teacher tells them that Scheme is the basis for JAVA (not the syntax but the underlying-operation). I've used both and I really don't see any parralles... Does anyone else see how JAVA is built upon Scheme (if it is at all...)