Slashdot Mirror


Preview of Java 1.5

gafter writes "An early access prototype implementation of the proposed new J2SE 1.5 language features is available. The prototype includes generics (JSR 14), typesafe enums, varargs, autoboxing, foreach loops, and static import (JSR 201). In other words, all the new language features planned for 1.5 except metadata (JSR 175). The prototype includes full sources for the compiler, written in the extended language. You can download the prototype from java.sun.com. It requires J2SE 1.4.1 and provides some examples of how to use the new language constructs. The prototype includes an experimental type system (variant type parameters) for Generic Java that is being considered for Tiger (1.5) based on a paper by Igarashi and Viroli at ECOOP 2002 . Comments and votes for the new type system are being gathered at bugParade."

32 of 461 comments (clear)

  1. Too litttle, too late. by mrright · · Score: 2, Insightful

    For years java zealots have told us that features like automatic boxing and templates are dangerous because they hide what really happens.

    Now that java has them too, they are suddenly the biggest thing since sliced bread. Most modern languages have had automatic boxing for ages, and never made a big deal about it.

    And about the new templates: they are just syntactic sugar. For example if you have an ArrayList, the elements will still be stored on the heap as Integer objects. That is very inefficient.

    And what about VM sharing? Will it be in java 1.5, or will we still have to wait 30 seconds for java programs to start up?

    --
    Private property is the central institution of a free society (David Friedman)
    1. Re:Too litttle, too late. by Anonymous Coward · · Score: 2, Insightful

      And what about VM sharing? Will it be in java 1.5, or will we still have to wait 30 seconds for java programs to start up?

      mod up. this is major pita that makes java almost unusable for small&trivial stuff. (ironically - the stuff it was designed for)

    2. Re:Too litttle, too late. by tcopeland · · Score: 2, Insightful

      And don't forget Java Web Start apps, like this (Tetris) and this (GForge client).

      Java Web Start is great stuff - always downloads the latest version, easy to deploy... don't know why more folks aren't using it...

      Tom

    3. Re:Too litttle, too late. by Baki · · Score: 2, Insightful

      Generally, I'm sceptic towards syntactic sugar (such as operator overloading, or even overloading in general). However, if you call generics syntactic sugar, you don't know what they are or what you are taling about.

      Sure, its implementation may be in terms of what already exists (i.e. internally you still have Lists of Objects, being cast into Integers or whatever). However, the burden of typecasting is removed from the programmer into the compiler, which is very significant and not syntactic sugar at all!

      C++ in its first incarnations was also just a precompiler to C, so following your reasoning one might have called C++ just syntactic sugar. Or even a compiler as mere syntactic sugar w.r.t. assembly, since in the end it is machine code that runs in both cases.

      No, getting rid of typecasts, a source of many errors and mistakes, is a big step towards a more safe and better readable language.

      As far as the remaining lack of stack variables: I agree it would be nice to have them. However I consider this an implementation/optimization detail. It should be up to the compiler to decide whether to use stack or heap for a particular case (though I'm not sure if current compilers can make the best decision). Kind of like the 'register' keyword in C, that hinted the compiler to store an important variable in a register. Due to progress in compiler technology it has become totally redundant and even harmful.

  2. Re:I'll care when native compilers become the norm by 73939133 · · Score: 5, Insightful

    Java can walk on water and I'm still not going to use it to develop anything I expect anyone to use. Give me a native optimizing compiler and I just might reconsider.

    You mean like GNU gcj?

    For languages that are intended for general purpose use and especially for situations where performance/efficiency is important they're just a BAD idea.

    You seem to think that by compiling stuff to native code things magically run fast when the problems are actually library design, class loader design, bad memory management, and other issues. Java's JIT is about as fast as natively compiled C code and Java's lousy performance is living proof for the fact that making a great native code compiler is not sufficient for getting good performance.

    Python and Perl programs often run rings around equivalent Java programs in terms of actual, end-user visible performance and memory usage, despite being interpreted. If anything, the compromises people need to make to make languages easily compilable into native code make it much harder to build efficient systems in them.

    Of course, it's not like we needed any more proof of that: the inefficiency and bloat of systems like Windows, Gnome, and KDE demonstrate the same point, as did several generations of systems before them. And generation after generation of programmers repeats the same mistake you are making.

  3. I doubt that Java will succeed. by Krapangor · · Score: 1, Insightful
    While the interpreted compile-once-run-everywhere and the garbadge collection scheme and pretty nice and useful, Java will take down the road to oblivion in the long term nevertheless.
    Why will this happen ?
    The Java system is based on the cleaning of a partly object-orientated language: C++. I know C++ coders will hate me for this, but if you compare C++ to real object-orientated languages like Smalltalk or CLOS, you'll have to admit that it's the plain truth.
    Java's goal where to simplify and objectize C++. However during this process some of the most promising parts of C++ where thrown out - operator overloading and generic programming. But this Java's power was seriously crippled and it will never reach the state-of-art level of academic theory of OO-languages.
    Secondly the Java interpreter scheme was extremely promising, too. However, SUN fuck this advantage totally up by concentrating on their modified C++ clone. MS did recognize this potential much better with their .NET system providing a platform for a huge range of languages ranging from C++, C#, Java, VB to even Eiffel.
    Some people will now protest that "There is this Gonzo++ implemenation of the Java VM." This is indeed true, people got stuff from C++ to Lisp running on the Java VM. But this argument is rather pointless: the power of a modern VM system does not lie alone in the interpreter, but in the system libraries, too. And SUN failed unlike MS to provide decent interoperability here, because their Java VM was never really meant to run with other languages.

    Personally i think that these design flaws will kill Java in the long term. There might exist many apps with Java these days, but this holds for Cobol, too. Even people in the OSS community start to realize this and move the MS's .NET system with projects like MONO etc.

    --
    Owner of a Mensa membership card.
    1. Re:I doubt that Java will succeed. by Billly+Gates · · Score: 4, Insightful
      Go do a job search on monster.com and count the java vs C++ programming?

      Java is growing. Its not horribly complicated and buggy like MFC and the win32api and your not locked in with .net.

      Corporations use Java for servlets and they use if for the built in libraries, low cost and portability.

      Java is a great language and I am sick and tired of legalists complaining about it. First the LISP academics complained about Unix or anything non lisp. THe unix haters manual was a result of this. It went nowhere. Now we have smalltalk and Eifel purest who claim that everything else is inferior.

      Your little world may be great in University teachings but in the real world they lack functionality and libraries to accomplish real world bussiness tasks.

      Mono is very alpha and lacks many of the winform libraries that are mature on Windows. If you use it your asking for vendor lockin eventually which is Microsoft's goals. Look at the hasle SCO has made in the corporate world in regards to Linux? If Microsoft begins taking a similiar approach and everyone uses Mono then they are SOL. Its all Windows lockin. The microsoft version will always be better and more supported so your PHB's have a great argument to switch to Windows.

      I chose to live in the real world and use what everyone else is using and that is java.

    2. Re:I doubt that Java will succeed. by oops · · Score: 4, Insightful

      Wake up! When it comes to delivering enterprise solutions (I work mainly in the financial industry) then Java is the primary choice currently. I'm not (necessarily) defending the language, but as a consultant I wouldn't have the same choice of work specialising in any other language.

      That may change over the coming years with .Net, but the current 'standard' is Java. Like it or lump it.

    3. Re:I doubt that Java will succeed. by be-fan · · Score: 2, Insightful

      The fact of the matter is that operator overloading always leads to evil abuses.
      >>>>>>>>>
      I've seen many C++ libraries, and I've never seen an evil abuse of operator overloading. Of course, I work mostly alone, so I don't encounter crappy programmers that often. But I don't think that a language should sacrifice completeness and orthogonality for the sake of bad programmers.

      Some of which are evident in the C++ standard libraries as glaring examples of how irresistively seductive the temptation to abuse operator overloading is.
      >>>>>>>>>
      Its not the same operator. One is the bit-shift operator, and is only defined for integral types, because it only makes sense for integral types. It's just like how the % operator is only defined for integral types, and not floating point ones. The other is the stream operator, and is the one that can be overloaded. The fact that they look the same is irrelevent. In Java, addition and concatenation are both operator+, and nobody seems to have a problem with that! Integral division and floating point division is both operator/, and again, nobody seems to have a problem with that. Beyond that, the C++ streaming mechanism is a lot more flexible than Java's method of requiring printable objects to have a toString method.

      --
      A deep unwavering belief is a sure sign you're missing something...
  4. All the features of C++ by Chromodromic · · Score: 1, Insightful

    With none of the performance.

    Anyone still convinced that Java is neato needs another viewpoint; Paul Graham's is reasonable.

    Anyone convinced that Sun is anything different than Microsoft, oh, except for being less successful, is delusional. How's that Java standard comin'?

    Avoid this crap. Go C++, or better yet Eiffel with C, and stop kidding yourself that Java getting a shiny "for" syntax is a reason for celebration.

    "What's that? Oh yes sir! I'll have those UML diagrams detailing the Bloggorgian-Rienmarch Reverse Upside-Down Cake Factory Singleton Dweeboid Pattern for you by next month! Then we can start coding!"

    --
    Chr0m0Dr0m!C
  5. Re:Sounds like what C# has that makes it better... by Jugalator · · Score: 4, Insightful

    Yes, I noticed this as well. I found it pretty interesting, and it reminded me of the old IE/Netscape browser wars. One implements the new features of the other. Let's just hope they don't get too carried away and bloat the language. :-/

    To me, Java was a lanaguage with a minimum of "redundant" features. You can write a "for" loop without using "foreach". You can use a class instead of a struct. And so on... I'm actually a bit surprised that Sun are throwing in features the language doesn't really always seem to need. I thought that was C#'s area. :-)

    --
    Beware: In C++, your friends can see your privates!
  6. Re:Simplicity lost by girl_geek_antinomy · · Score: 4, Insightful

    It's interesting that you say that about teaching, and I think you have a point. I'm a CS student at Cambridge University (currently avoiding finals revision) where Java is the fundamental teaching programming language, the one they teach you right up front, the examples language for code fragments in algorithms situations (well, along with ML) etc.

    Actually though I think for this kind of teaching you can just use the simple subset of Java that's been about since 1.1 - after all, you're teaching principles of programming and OO - you can teach actual Java *development* down the line and cover the complexities, bells, whistles and dongles then...

  7. Re:good and bad ...? by Anonymous Coward · · Score: 5, Insightful

    There certainly is a tradeoff: If a language gives too many options to do one thing, it becomes confusing. A programmer usually develops a certain coding style. She prefers certain constructs over others. When you read code, you have to adjust to the style of the programmer who wrote the code, and possibly recognize constructs which you're unfamiliar with because they're not part of your coding style. Take the proposed for-loop extension as an example. Every Java programmer instantly recognizes the head of an "iterator for-loop". It's an idiom. The proposal adds syntactical sugar to supposedly help identifying this very frequently encountered situation, but it does the exact opposite: There are now two ways of looping over an iterator, and you have to be familiar with both if you want to quickly understand other people's code. If you want a good real-world example of what too much syntactical sugar does to a language, take a look at some Perl programs.

  8. Re:good and bad ...? by Daleks · · Score: 4, Insightful

    Some of these things are certainly nice (typesafe enums...) - but wouldn't it be nice to try and keep the java language *simple*?

    Type-safe enums were added to eliminate previously verbose and obfuscated code. It simplifies the code without complicating the language.

    There are iterators for doing stuff like foreach-looping ... varargs? Why? It is an object-oriented language - take use of that polymorphism!

    What does polymorphism have to do with an enhanced the for-loop or variable arity functions? The enhanced for-loop ensures that collections are properly iterated across (no out of bounds exceptions). You honestly think that

    for (int i = 0; i < C.length; ++i) {/* ... */}

    is more complex than

    for (int i : C) {/* ... */}?

    Also look at what you can do with variable arity functions. Say you have a constructor for a collection class and you want to be able to initialize a variable number of default values. Well, now you can. Apple's Cocoa (Foundation) library uses this to allow easy construction of NSDictionary objects.


    id d = [NSDictionary dictionaryWithObjectsAndKeys:@"foo", @"bar", @"biz, @"baz"];


    The other way to do it would have been


    id d = [[NSMutableDictionary alloc] init];
    [d setObject:@"foo" forKey:@"bar"];
    [d setObject:@"biz" forKey:@"baz"];


    Aside from Cocoa's long parameter naming scheme, the first method is a shorter and a lot easier. It also uses fewer messages.

  9. Re:Simplicity lost by jonathan_ingram · · Score: 3, Insightful

    Next term try teaching them Python instead.

    Then, when they understand the concepts, you can introduce them to the syntactic nightmare that is Java.

  10. Teach the kids Scheme or Smalltalk. by BitwizeGHC · · Score: 4, Insightful

    Those two languages are far simpler, and let you really hammer the points about programming down without getting the kids confused about syntax rules.

    Smalltalk has, essentially, only one operation: the message send. Send object X a message Y, and get Z back as a result. Even simple things like addition are implemented this way. While not blazingly fast (except in certain specialized implementations), the message-send semantic is surprisingly efficient: many complex real-world systems have been constructed using Smalltalk.

    Scheme also enjoys the advantage of being small and simple, yet powerful. You don't need to know what the lambda calculus is to see how effective and intuitive Scheme's procedural semantics is. ("Lather, rinse, repeat." See? Tail recursion. It was there all along.)

    Either way, it's better to use a simple language to teach students how to formulate plans for doing things (i.e., algorithms), and then hit them with fanciful syntax later rather than drop them into a popular, but bewildering for newcomers, language (which I consider C++ and Java to be).

    --
    N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
  11. Re:I'll care when native compilers become the norm by KingRamsis · · Score: 2, Insightful

    no!
    because the JIT overhead is not re-occuring, it happens once.

  12. Sun deserves all that will happen by Fuzuli · · Score: 3, Insightful

    Ok, let's all try to see how Sun can be incredibly stupid.
    You have a company that has a strong position in the Enterprise, and you have a technology that is pretty much accepted. Meanwhile your opponent is busy with conquering the desktop since it can't provide solutions strong and stable enough for the enterprise. What in god's name did you think MS was going to do? Was Bill Gates supposed to turn the others in the room and say "hey this was fun, let's do it again!" after MS has owned the complete desktop ? OF COURSE they'll try to dominate the Enterprise too!! .NET was announced almost 3-3.5 years ago. Sun saw it coming and did nothing. Bitching about how MS products sucks is not the solution. You should have used your advantage and experience in the Enterprise instead of letting MS slowly steal it from you. If Sun could have cared for what the industry has been complaning about in their technology, and implemented the necessary changes, by the time .NET is out, it would be just a ripoff. But look what we have here now: Sun, is trying to catch up with MS in the field where it had for years. You have a huge user base, you have a mature technology, why do you wait for opponents to catch up ? Java is not dead yet, but it's not hard to see why it'll be dead at the end, when you look at what Sun is doing..

  13. Re:Java is passe by 73939133 · · Score: 4, Insightful

    Other API's are NOT standardized and are in full control of Microsoft [...] I think that mono will have some major problems in the future. Sure they can implement C# and CLR, but they virtually have to reengineer all other API's, because there are no formal specs available.

    How is that different from C++ and the Win32 APIs? The fact that Microsoft controls the Win32 APIs doesn't matter to me when programming in C++--I just write my code in Gtk+ or wxWindows. Likewise, the fact that Microsoft controls the .NET APIs doesn't matter to me when programming in C#--I can just use Gtk#.

    Furthermore, you don't need Sun-style central control over everything in order to get good cross-platform toolkits, as toolkits like Qt, FLTK, and wxWindows show. C# will have good cross platform support, either by successfully cloning .NET, or by binding to an existing cross-platform toolkit, or by creating a new cross-platform toolkit just for C#.

    You see, the fact that C# doesn't come with philosophical baggage like WORA and "100% purity" is an advantage as far as I'm concerned. What WORA and "100% purity" has brought us is lousy implementations of Java on Linux, and APIs that don't even let me access environment variables.

  14. Re:I'll care when native compilers become the norm by sperling · · Score: 2, Insightful

    Java isn't an interpreted language, in the traditional sense. Interpretation implies that the runtime environment interprets the source as it progresses, and e.g. that errors that would have been caught compiletime by others, are reported runtime.

    When it comes to performance, it's about time to kill the old idea that java performs so incredibly bad. Look at e.g. this article for a measurement of how well java performed a few years ago. I didn't at first glance find any articles doing similar comparisions using the more recent VMs, but as vendors put effort into still more optimizations, I'd not expect the results to be worse now.

    Another aspect of this that you might not have considered is how the JVM is at an advantage over static compilers, as it has the possibility to generate native code *runtime*, using real information on e.g. branching to generate native code which'll keep the CPU pipelines filled. A static compiler cannot do this to the same degree, so it is possible to construct scenarios where Java performs better than natively compiled binaries.

    --
    The next great MMORPG.
  15. Java Vs .net by tonywestonuk · · Score: 4, Insightful

    To be quite honest, I dont care at all if .net is better than Java. The point is that .net is controlled by Microsoft, and currently only runs (officially) on M$ products. Mono might be outlawed by Microsoft at any point. You are at their mercy.

    The ONLY reason that Sun hasn't relinquished control of Java, is that if they had done so, Microsoft would have been free to embrace/extend/ corner the market.... The same as what they did with Internet explorer.

    So, how many non-geeks use anything but, or even know of anything but IE?

    Businesses would standardise on MS java, and java on any other platform would become unuseable.. (just as there are web pages that are only useable in IE).

    By stating "I'm using C# over Java" you are selling you sole to the devil...You wait till microsoft start extending DRM into the specification, therby relegating projects like Mono to the sidewalk, at this point it will be M$ .net, or nothing. Do not think this will not happen.

    So, Its your choice. Choose to go with the, arguabily faster/easier to code offering by our (sarcasm) good friends at Redmond, or choose to fight Microsoft by writing code that will run on all platforms from mobile phones to IBM mainframes. Believe me when I say we will all be better off in the long run.

  16. Re:good and bad ...? by linux_student · · Score: 2, Insightful

    Too late! I just started to learn java about 5 months ago in school; whatever chance they had to make that language "easy"(a subjective matter of course) went out the window long ago. Nonetheless I am still learning and Java remains one of my favorite languages to date.

  17. Everyone's bashing java by Julian+Morrison · · Score: 4, Insightful

    ...for getting less simple, but it was never simple to begin with. Simple would be to use weak-vars-strong-values typing like python. Making everything an Object and using that plus typecasts to do generics is not "simple", it's a hack. It uglifies your code, makes it less efficient, and (ironically) breaks strong typing.

    Generics are also a hack, but at least they are an overt, clean one.

  18. Java is pragmatism over principals by ggruschow · · Score: 5, Insightful
    So many of the posters here are missing the best reasons to use Java today. Java is highly pragmatic. It's a good, broad set of tools that's widely understood and supported, and often improved.

    Java rarely wins in any particular niche. Relatively simple GUIs and COM objects are owned by VB (and Delphi). C++, C, and assembly rule in performance. Perl rules text processing. Python rules in ease of reading. ANSI C, Perl, Python may be more portable. Smalltalk, Eiffel, Lisp, Ruby, ML, Haskel, Forth, and a variety of others are a lot more true to a pure language concept. However, Java does an adequate job in most cases, and when you start crossing boundaries, it'll often be easier to do so in Java-land.

    Java isn't innovative. However, it's constantly being improved. Sure, things like JDBC, Collections, SWING, NIO (async I/O), generics, threads, and concurrent garbage collection were available in some form elsewhere previously. They're all packaged into nice, free, portable, well documented, easy to use parts of Java though, and I'm happy to have them.

    Java isn't as free as Emacs. However, it's mostly free as in beer, and it doesn't force it's freedom on you. It's certainly a whole lot freer than most things from Redmond. I admit, I don't care if a language is handled by a standards body, unless the company in question holds other monopolies it can abuse. I seriously don't think Sun is going to do anything so wacky as polluting the language to make COM (*cough* MS) or Object Pascal integration (*cough* Borland) easier.

    Java's support base and (free) developer tools are just plain great. I love Eclipse, and IDEA and recent JBuilders are pretty nice too. VS.NET is good stuff as well, but contenders like Python are sorely lacking in this arena.

    I still write plenty in other languages, but every year the percentage I write in Java goes up.. They keep filling holes (soft references, regexes, async I/O, .1s GC pauses) that were keeping me out of Java. I'm happy to see some more syntatic sugar in Java.. The things they're addressing will make a whole lot of code more readable.

  19. stop the FUD ! by Anonymous Coward · · Score: 2, Insightful

    Mono is alpha ! and is not, will not and never be any kind of a dotNet on a non MS platform.

    Bill stated this clearly : "we will not port the platform to a non MS platform". This includes opening the code source or whatever that could their endanger captive user resources.

    If you still think Java is a niche, is because since nearly 10 years you was sleepy ;-)

    Java is not the "magic key" for "IT magic kingdom", it is real, effective, efficient and fit your need.

    Java is real freedom. Because i can change my OS, the product i use, the business model i got without beeing linked to a provider.

    For does who still see Sun as the "big bad wolf", i never pay Sun a buck and i did so in a legal way.

    I run linux on clusers, with JBoss, a IBM VM on top of Dell machine (the only stuff i have to pay)! And the architecture i got could manage any kind of a load (as long as my ISP link will manage to pass it to me), because i can add whatever new machine i want (tnx to the multilevel clustering nature of the solution).

    It is real, effective, efficient and fit my need ;)

    What MS fears the most is Linux + Java. Because it is a more powerfull that they can even provide.

    If the Linux gurus where stoping the bashing against Java and looks at the marvelous project made from the opensource comunity they will understand that Java is realy an opportunity to strengthen Linux as an OS leader.

    -SLK

  20. Re:Simplicity lost by the+eric+conspiracy · · Score: 2, Insightful

    Any language that uses whitespace syntactically is TOTALLY unsuited for teaching.

  21. Re:The problem: Improving programmer productivity by bellings · · Score: 2, Insightful

    JavaScript is a scripting language. Microsoft's .NET framework includes bindings to one low level languages (C#), one mid level language (VisualBasic), and one scripting language (JavaScript). If you pick up Visual Studio, you get bindings for J# and C++, too. Plus, lots of people are looking forward to F#, a functional language.

    The point is that Sun really hasn't endorsed any alternative bindings to the Java platform. They certainly haven't endorsed any dynamically typed "scripting" languages similar to VisualBasic or JavaScript.

    Obviously, JavaScript is available for the Java Virtual Machine, as are a huge number of other languages. However, Sun has never really embraced those alternative languages. That's a real shame.

    And that's why the parent of the parent poster included Java, C#, and JavaScript in the same post.

    --
    Slashdot is jumping the shark. I'm just driving the boat.
  22. Re:I doubt that MS FUD will succeed. by nicodaemos · · Score: 2, Insightful

    The Java system is based on the cleaning of a partly object-orientated language: C++. I know C++ coders will hate me for this, but if you compare C++ to real object-orientated languages like Smalltalk or CLOS, you'll have to admit that it's the plain truth.

    C++ is fast and less OO, Smalltalk and CLOS are slow and more OO. Since both classes of languages exist, obviously each user has different requirements and choose their level of OO and performance accordingly.

    Secondly the Java interpreter scheme was extremely promising, too. However, SUN fuck this advantage totally up ... MS did recognize this potential much better with their .NET system providing a platform for a huge range of languages ranging from C++, C#, Java, VB to even Eiffel.

    What exactly is the failure of the Sun VM? It runs on different CPU's and OS's. It has a published VM language for which people can implement compilers. Oh your argument is that the system libraries are inadequate. In what way do you feel they are less in capability than .Net?

    And SUN failed unlike MS to provide decent interoperability here, because their Java VM was never really meant to run with other languages.

    The common definition of interoperability and MS Interoperability(tm) are slightly different. Essentially, the MS definition is a very small subset of the more common definition. As far as MS is concerned, Interoperability is the ability for MS programs and languages to speak with one another.

    So let me ask you, what is the real benefit of the CLR? Do you find yourself writing a lot of C++ in the morning and extending it with VB in the afternoon? No you say, it's to allow multiple programmers to work on the same monolithic application in their language of choice? Oh so the ui guys can code in VB and the backend people can write in C++ or C#. Mmmm ... I've seen many languages interoperate in monolithic applications such as C, Fortran, Tcl, Java so I'm not exactly sure what MS has added as new. And if we're talking about most applications which are distributed (ie. non-monolithic) nowadays, then the point of a CLR becomes even less clear.

    Mensa member, beware of the high IQ

    I don't often pick on people, but I think the combination of this signature with the post forces my hand. A more apt signature for this post would have been: MS shill, beware of the FUD

  23. Re:I'll care when native compilers become the norm by Kunta+Kinte · · Score: 2, Insightful
    If you are running a J2EE app as middleware for a huge ecomerce or CRM system, etc then sure recompile to native code,...

    I don't see any performance issues in my J2EE apps.

    Java is slow largely becuase of JVM startup and GUI framework. But J2EE Apps don't have to worry about either of these. The J2EE Server's JVM is started only on Application startup, which only happens when you need to restart your J2EE Server. And there's no GUI layer ( JSP for presentation ).

    Truth is in large server-side apps, I'd expect J2EE with JSP to kick the crap out of PHP, PERL and others.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
  24. Collections should be first-class entities by Admiral+Burrito · · Score: 3, Insightful
    Also look at what you can do with variable arity functions. Say you have a constructor for a collection class and you want to be able to initialize a variable number of default values.

    You can already declare arrays in-line. So if they were to define an appropriate constructor, you could do List l = new ArrayList(new Object[] { "foo", "bar", "baz" }).

    That is verbose of course. What they really should do is add collection manipulation stuff to the language, so you could go List l = ( "foo", "bar", "baz" ) and be done with it.

    I believe that that scripting languages get most of their advantages (more functionality with less code, easy to develop in, etc) because they have collections as first-class entities. It's not as if it would be polluting the language... How often do you write code that doesn't use some kind of aggregate data type? For the language to not recognize that is just silly.

  25. Re:C# Genericity ! Stop the FUD. by Hognoxious · · Score: 2, Insightful
    Well, it's personal preference. Some like sin(), others Math.sin().

    Personally, i think it's awesome.

    The Math object is the classic demonstration of where the object paradigm breaks down. Sin is a function. It just is. Shoehorning it into an arbitrary object that simply doesn't correspond to anything in the real world is pure dogma - OO for the sake of OO.
    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  26. Re:No subject. by DickBreath · · Score: 3, Insightful

    Of course you can handle pointers!! I'm tired of running into Java programmers who are scared of lower level code (read: C).

    I'm tired of running into C programmers who are scared of lower level code (read: Assembly).

    I'm tired of running into GUI users who are scared to use the command line.

    I'm tired of running into calculator users who are scared of using a slide rule.

    I'm tired of running into automatic transmission drivers who are scared of manual transmisions.

    I'm tired of running into people who use drive automobiles and are afraid to use a horse and buggy.

    In fact, I don't think scared is the issue here at all. The real issue is automation. Something that always makes people more productive, and requires greater machine resources. (See all above examples.) In fact, using your own argument against you, I would argue that anyone here, even a Basic programmer, can learn to program Assembly, use a command line, use a slide rule, etc. In fact many of us were Basic programmers. Many of us do or did these other skills. That fact that you can be "macho" and learn pointers is missing the real issue. Automation.

    In Java, you are trading machine performance for human performance. You simply eliminate the possibility of even having the all of the most common C/C++ bugs that plague so much modern software.

    CPU cost is going down. People cost is going up. This trend has been going on for a long time. (Have you noticed this trend in the past 20 years?)

    Back in the early 60's and 70's there were huge debates about whether "high level" languages (like the C you advocate) would ever be useful because the compiled code was so much less efficient than hand written code. (And yes, I know that argument in the late 70's that compilers would eventually write better code than by hand.) But the point remains, that even if this is or is not true, high level languages won.

    Think about why that is for a moment.

    In any sufficiently complex C/C++ system, you either end up implementing garbage collection, or end up with some complex disciplined memory management strategy, and still end up with object lifecycle bugs. In C/C++ you sometimes end up implementing your own miniature Lisp, even if you've never seen Lisp. But your own implementation of Lisp ends up poorly specified, and not throughly debugged.

    --

    I'll see your senator, and I'll raise you two judges.