![Java Java](http://a.fsdn.com/sd/topics/java_64.png)
![Programming Programming](http://a.fsdn.com/sd/topics/programming_64.png)
![Software Software](http://a.fsdn.com/sd/topics/software_64.png)
Java SDK 1.5 'Tiger' Beta Finally Released 602
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."
For more information check out theserverside.com (Score:5, Informative)
Re:For more information check out theserverside.co (Score:3, Informative)
What are you implying? The site comes up fine in mozilla based browsers.
an annoying quirk (Score:4, Interesting)
Re:an annoying quirk (Score:3, Informative)
I'm guessing that you dropped some text between angle brackets, and what you meant to say was something along the lines of:
It is indeed true that, though s contains only Integers, which are all indeed Numbers as well, you cannot make this assignment. The reason is that, though Integer extends Number, the new types you've created (ArrayList<Integer> and ArrayList<Number>) using the
Re:an annoying quirk (Score:5, Informative)
Check out this paper [bracha.org] for information about this other kinds of variance available in Tiger.
Re:an annoying quirk (Score:3, Informative)
Re:an annoying quirk (Score:3, Informative)
You can write a cast operator to get around this problem in C++. For example, here's a cast operator inside a smart pointer class:
This cast operator will only work with fairly intelligent C++ compilers, though. GCC and VC7.1 support it, but VC6 did not.
Not a quirk, it's called inheritence. (Score:4, Informative)
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() [sun.com].getName() [sun.com] , instanceof [sun.com] , 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 [sun.com]. 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.
About polymorphidm snd subtyping (Score:5, Informative)
IPv6 for windows finally (Score:5, Insightful)
Re:IPv6 for windows finally (Score:5, Informative)
Now that being said, the really cool part about Java supporting IPv6 on windows is that it actually makes it much, much easier for developers to add support for IPv6 on Windows. You see, Microsoft didn't provide a dual stack implementation which means an IPv6 socket can not talk to an IPv4 host. It's stupid and contrary to what the RFCs strongly recommend. So if you're a
Now, with Java, none of that, a Socket is a Socket and that's it. To make it better, chances are your Java application doesn't need to be modified, or even recompiled! Imagine that: your application was already IPv6 enabled and you didn't know it.
About time too (Score:5, Interesting)
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
Re:About time too (Score:3, Interesting)
How is java less lock-in than
In my eyes you are about equally locked in - but people tend to hate
My view is that c# is a bit more "clean" as a language, but the classlibrary is much more
Re:About time too (Score:5, Informative)
On the other hand, MS always, always, always seems to take care to leave some proprietary poison pill in their work, so you can implement 99% of their offering, but w/out the last 1%, your offering is worth substantially less (if anything at all).
MS-Kerberos is my favorite example: all these bytes are yours, except these two over here. Touch them not.
I think Mono is another case in point: it's an implementation of C# and the VM (yes?) but the
(Consider me trolled. Oh well, it's been a while since I've bitten any hooks.)
John.
Re:About time too (Score:3, Insightful)
All they hear at the seminar is that ".NET has a portable runtime just like Java and offers an end to end solution". And then the brain disengages without detecting the ambiguity. How many ask for clarification - the runtime might be portable but has it been ported and what about the rest, is that portable and ported too? Of c
Re:About time too (Score:3, Insightful)
While in general I agree -- the core implementations of both are closed source -- the two are entirely different when motivations come around.
Sun: Motivated to create a Java developer base and sell related goods on various platforms.
Microsoft: Motivated to create a C# developer base and sell related goods on Microsoft platforms (Windows NT and Windows
Re:About time too (Score:5, Insightful)
Thus you have a lot more choice. You could be using Java on Mac OS X, Tomcat and PostgreSQL to power your website, or you could be using IBM mainframes with WebLogic and an Oracle backend.
With
Re:About time too (Score:3, Informative)
BOTH groups would be basicly fucked - there is no REAL port of any of them - and from my point of view, Mono actually looks quite a bit more promising than Kaffe does.
If you asked me 1/2 year ago, I would definately put my money on java(and I do all my private coding in java - and has done it for the last 6-7 years or so), but now i start to be unsure - not because
Comment removed (Score:4, Interesting)
Re:About time too (Score:5, Insightful)
Because Java has freely available, industrial strength implementations on dozens of platforms. If you use it, you aren't locked in to deploying on any particular OS or hardware. (BTW, don't forget gcj in your list of "free" alternatives.)
I hope that helped clear things up...
Re:About time too (Score:3, Interesting)
While the immaturity of Mono is the reason I'm looking into Java rather more seriously than
Remember that the only potential legal threat to Mono is Microsoft's patent portfolio. But even if Mono is infringing on something - and I haven't seen any evidence that it
Are you talking about THAT Microsoft?!? (Score:4, Insightful)
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.
Re:About time too (Score:5, Informative)
This is one of the most misunderstood aspects of the C# vs Java debate.
If you write code in Java, you can run the same compiled class files on any platform. In C#, any code you write MUST run on a Windows-supported platform under Windows, but because every .NET language compiles to the CLA (Common Language Architecture), they are all translated into a single, compatible language before going to bytecode. Meaning, you can interoperate between any .NET language, have C# functions call a C++ function (assuming C++ is a .NET supported language now or someday) and just have it work...no CORBA, no distributed programming, etc. Furthermore, the CLA common language provides stuff like garbage collection so you can neglect free() and delete() in C++ and not worry about memory leaks (just don't compile that code with a non-.NET C++ compiler). The grand vision here is that everyone using .NET is locked into the .NET framework running on a Windows platform. There's nothing open about that.
sev
Re:About time too (Score:4, Interesting)
That's not correct. Next time, please say "according to blah,
According to the Mono faq [go-mono.org]:
So in short, yes, you can compile C# and C++ to bytecode under Windows and run it under Linux.
Although what you said about CLA (being able to call other languages' functions) is correct.
Re:About time too (Score:3, Interesting)
But look at one of my other answers
And personally I love java - and has for about 6 or 7 years...
Code Examples (Score:5, Informative)
[javasig.com]
http://www.javasig.com/Archive/lectures/JavaSIG
Saves loads of code (Score:5, Interesting)
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 [vankuik.nl]
Code is for reading as well as writing (Score:4, Insightful)
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?
Benchmarks (Score:5, Interesting)
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 [sun.com] I just ran on my Athlon XP 2000+ under Mandrake 9.2:
These are relatively consistent over multiple runs.
Re:Benchmarks (Score:5, Informative)
Also here [jinchess.com] are some [jinchess.com] snapshots of the new and improved Metal Look&Feel and of the GTK+ Look&Feel [jinchess.com]. You can also see how much antialiasing of bright text on dark backgrounds has improved from (unreadable) 1.4 [jinchess.com] to (rather decent) 1.5 [jinchess.com].
Also, Swing seems to be much more responsive! It is therefore my humble opinion that this release is going rock Java.
In Response to C#? (Score:5, Insightful)
When I read about the proposed features for Java 1.5, I knew i could stick with Java for the long term. Good news!
Re:In Response to C#? (Score:3)
Make your mind up. Either Mono "is an open source implementation of the
You can't expect people to invest in something on the grounds that it's Dotnet compatible and then not care if it suddenly isn't.
Looks more like a naive yearning than a strategy.
The good and the ugly (Score:4, Interesting)
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.
Re:No need to wait... Bytecode is backward compati (Score:3, Informative)
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 [sun.com]).
Re:SWT (Score:5, Insightful)
SWT doesn't come with a MVC approach as Swing does. Besides, you'll have to deallocate your GUI resources with SWT yourself.
SWT is the future of Java GUIs
That's a very bold prediction. SWT is a valid alternative in some cases. Before picking a GUI one should think a bit about which toolkit is best-suited for the job. But in no way is SWT always the right choice.
Re:SWT (Score:3, Interesting)
Quick Links (Score:3, Informative)
J2SE 1.5 In A Nutshell> [sun.com]
J2SE 1.5 in a Nutshell (Score:3, Informative)
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
Just a Question for everybody: (Score:5, Interesting)
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
Re:Just a Question for everybody: (Score:5, Insightful)
This is what competition is about. MS already has C# 2.0 designed (which sports many of the features introduced/present in jdk1.5) and no doubt they'll start marketing that in a couple of months. It's a technological arms race. Of course the big question is which of the two will make the first move to support the other. My guess is that they will let IBM do the hard work. Already there is some
What about HttpSession objects? (Score:3, Interesting)
Someone please make a debian package! (Score:3, Interesting)
Re:Someone please make a debian package! (Score:5, Informative)
Why are you stuck on that?
I'm running 1.4.2_03 update 3 on Debian Sid.
Download the Linux.bin self-extracting file. and install as root where you want it to be installed.
First do a chmod 777 on the .bin file as noted by Sun. It will extract a structure as 1.4.2_03/ I don't like that so I just moved it to 1.4.2/
$mv j2sdk1.4.2_03/ j2sdk1.4.2/
Set the pathways for your .profile. and root's as well, and every user who needs access to the tools.
Here are my settings:
#Java SDK 1.4.2 SDK Path Settings JAVA_HOME=/usr/local/SunJava/j2sdk1.4.2/
add JAVA_HOME to your export PATH list.
Your choice of where you want your install directory is your choice. I made everything from Sun under SunJava.
Now as root run update-alternatives. (Man page for more info about the following).
$update-alternatives --install /usr/local/bin/java java /pathToYourJ2SDK/bin/java 100
Repeat for javah, javac, jdb, javap, jarsigner, java-rmi-cgi keytool, etc underneath the Sun /bin directory.
Then run update-alternatives --all to make sure it has Sun's sdk 1.4.2 set.
Run update-alternatives --config java
$update-alternatives --config java
Make sure its set.
Class Data Sharing comes from Apple (Score:5, Interesting)
Pretty cool stuff, and it shows that Sun does accept changes to Java from the outside that are of clear benefit.
Good News for SwingSet (Score:3, Interesting)
Our open source SwingSet toolkit [sourceforge.net] for making the Swing components database-enabled/aware will now be much easier to install/distribute. Hooray!
Screen Shot (Score:3, Interesting)
Can we thank .NET for giving Sun a push? (Score:4, Interesting)
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.
Where the value is (Score:5, Insightful)
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 [osnews.com] 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)
"enchancements" (Score:5, Funny)
I like most of it... (Score:4, Insightful)
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.
not enough (Score:5, Interesting)
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.
Re:not enough (Score:3, Insightful)
Re:not enough (Score:4, Insightful)
Some thoughts:
Java genericity has no special support in the runtime, which limits the type safety it can provide.
True.
Generics over primitive types are boxed, meaning they are inefficient.
Collections were already boxing primitives. How often do you think this will come up for you in the real world? Can you come up with a convincing example?
Java's native code interface is still inefficient and complex.
Funny, I've used it for a few different things (in 1.4) and never found it to be either. But perhaps if you made a more specific complaint...
Java still lacks value classes and operator overloading, making it a poor choice for applications involving numerics or graphics.
Pardon my ignorance about value classes; I'm wondering if you can be more specific about when they're really useful and what benefits they have for numerics or graphics?
And finally, when you say operator overloading, you lose me. My opinion of operator overloading is that it is absolutely bad. Let me be clear. It is always bad, under any circumstances, when used for any reason. It has exactly zero functional value, and, as opposed to other kinds of "syntactic sugar" it has a tendency to make code where it is used with any frequency into a confusing, unmaintainable minefield. When advocating for operator overloading you are basically advocating a programming style with 1 letter method names, only it's worse, because you're limited to a few "commonly used" letters.
operator overloading (Score:3, Insightful)
In many languages nowadays, be it fortran, c++, perl, python, etc. etc. etc. it is possible to use straight m
Nice First Step, But.... (Score:3, Insightful)
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.
Re:Nice First Step, But.... (Score:5, Insightful)
Vendor lock-in is never a small price to pay. From now on your project will be dependant on one and only one vendor, unless you're willing to completely re-write it from scratch one day. As IDEs evolve much quicker from every vendor except Microsoft, you'll be disappointed when you can't use the future version of Eclipse or JBuilder or whatever when it far surpasses Visual Studio. When a new useful free library pops up for Java, which happens all the time, you can't use it. You're stuck on a new platform with less features, less free tools, and less support for the foreseable future.
Re:Nice First Step, But.... (Score:3, Insightful)
As another person has already pointed out, this is never a small price to pay.
From a technical point, you've tied your entire IS structure to one company. Your innovations, flexibility, and ability to create services for your environment will be dictated by a single company.
From a business point of view, implementing business critical functions based on a single proprieta
Java 3? (Score:3)
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)
Re:Java 3? (Score:4, Informative)
Java 1.5 bytecode is fully backwards compatible with 1.4 JVMs and 1.4 bytecode was backward with 1.3 JVMs (asserts would only cause library issues). I'd expect Java 3 to appear only if the JVM bytecode spec changes.
"Java 2" product name (Score:3, Insightful)
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.
The biggest problem with compatibility... (Score:3, Interesting)
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
Pain in the ass to download (Score:3, Insightful)
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!
Re:Why? (Score:5, Interesting)
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).
Re:Why? (Score:3, Insightful)
[] 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 some
Re:Why? (Score:5, Informative)
Of course, I understand that Britney Spears is rather popular too...
Re:Reality check (Score:5, Insightful)
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.
I work for Yahoo. Many of our web servers are powered by Java, and they're fast enough for us. Are you suggesting that your network performance needs are higher that frickin' Yahoo's?!?
I do freely admit that we don't use Java for the super-high-volume stuff like My Yahoo and Mail. But we're Yahoo. Even our low-volume properties are high volume. Java is fast enough to serve a lot of purposes around here.
Re:Reality check (Score:3, Informative)
My team uses JDK 1.4 with Tomcat and Apache running on Linux. I admit that we can't handle nearly the load that My Yahoo can, but low-volume for us still translates into ten million hits a day per server.
The high-volume properties like My Yahoo run a custom version of Apache on a custom version of BSD with a custom non-relational database backend. There is no off-the-shelf software that can even come close to handling Yahoo's traffi
Re:Why? (Score:5, Insightful)
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.
Re:C is portable too (Score:3, Insightful)
Re:C is portable too (Score:3, Insightful)
Re:C is portable too (Score:3, Insightful)
Thats an exageration. My company sells several non-trivial Java apps which are binary portable. While we've encountered some platform inconsistancies, particularly in networking, its been fairly trivial to find ways to make things work portably.
Re:C is portable too (Score:4, Insightful)
I have never known an issue in a (100% pure) Java program that relates to what platform it was compiled on. What platform it executes on, certainly, but not on what platform the build was done on. The compiler either produces valid byte code or it doesn't. There's no issue such as byte code being valid on Windows but not on Solaris.
If I compile with a 1.4 compiler on Windows it will run on a 1.4 VM on Windows, Solaris and Linux without recompilation. I may occasionally find that my threading or I/O behaves slightly differently because I haven't accounted for subtle differences inherent in the underlying OS (not as big an issue as when coding in a natively compiled language), but that's not because the byte code is not compatible across different platforms.
Re:C is portable too (Score:3, Insightful)
#ifdef SPARC
#endif
#ifdef X86
#endif
Re:MOD PARENT UP (Score:4, Informative)
Re:Too little, too late (Score:5, Informative)
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
Re:Too little, too late (Score:3, Interesting)
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
Re:Too little, too late (Score:3, Interesting)
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.
Re:Too little, too late (Score:3, Interesting)
Re:Too little, too late (Score:3, Funny)
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.
Re:Too little, too late (Score:5, Funny)
Grennis: C# innovated!
Inigo Montoya: You keep using that word. I do not think it means what you think it means.
Re:Too little, too late (Score:5, Insightful)
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.
Re:Too little, too late (Score:5, Informative)
Re:Too little, too late (Score:3, Insightful)
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.
Re:Too little, too late (Score:5, Insightful)
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.
Re:Too little, too late (Score:3, Informative)
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 tr
Re:Too little, too late (Score:3, Insightful)
> > 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.
>
Re:"generics" (Score:5, Insightful)
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).
Re:"generics" (Score:5, Informative)
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.
Rubbish. (Score:3, Insightful)
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.
Re:"generics" (Score:4, Informative)
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.
Excuse me but: (Score:4, Interesting)
Re:steps toward Python (Score:4, Insightful)
"Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform."
This means you can even run python on a palm pilot or a cell phone.
jython code can even be compiled into java bytecode (*.class files)
Re:steps toward Python (Score:3, Informative)
By your logic then, VBScript is ok since it does dynamic typing as well.
Yes, because char* points back to the ascii value for the character and not the string itself.
Re:steps toward Python (Score:4, Insightful)
Dynamic typing being a Good Thing depends on the context. Dynamic typing tends to move more bugs which could easily be caught at compile time to runtime. This means more testing needs to be done which actually drives up development costs and thus negates any benefit gained from "rapid development".
Indeed, I find that writing test suites saps much of the development speed advantage I gain from using a dynamically typed language.
However, using a soundly designed dynamic language, I can write dynamic-implementation+test-suite in about the same time I could write only static-implementation in, say, Java. But since I have an extensive test suite, I end up with much more reliable code.
Re:Simple input (Score:3, Informative)
Re:Same old same old (Score:3, Insightful)
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 t
Re:Same old same old (Score:3, Informative)
Kind of funny, considering that Solaris is a derivative of BSD.
Re:Some Insite please (Score:3, Informative)
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.
Please go read the spec before jumping to conclusions.
Re:New features - Half way there (Score:3, Funny)
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!
Re:Java 3.0 (Score:3, Insightful)
Admittedly, I didn't even bother to look at either of the languages you point to, but it's irrelevant. Here in the real world, popularity matters. You could be using the best damned programming language in the entire world, and if you're the only one using it, good luck finding a job.
I'm not saying that we should hold back progress. If these languages are really better than Java, then by all means support them and encourage people