Slashdot Mirror


Interview With James Gosling

Def Mango Raygun writes "There is an interview with James Gosling of Sun. He talks about some language features and why they happened. It's short, but informative"

75 of 216 comments (clear)

  1. more information by flynt · · Score: 5, Informative

    James has a homepage here, for your perusal. There are some really interesting things on it, like the fact he is Canadian and likes pies in Bill Gate's face to name a few.

  2. length by billnapier · · Score: 5, Funny
    It's short, but informative.
    Unlike the text of this submission, which is only one of those.
  3. Huh? by swagr · · Score: 5, Funny

    So the JDC interviewed James Gosling. Surely he [has] contributed to the JDC and has a log in, thus making him a part of the JDC collective...

    Next week on Slashdot: Taco interviews himself.

    --

    -... --- .-. . -.. ..--..
    1. Re:Huh? by tswinzig · · Score: 5, Funny

      So the JDC interviewed James Gosling. Surely he [has] contributed to the JDC and has a log in, thus making him a part of the JDC collective...

      Next week on Slashdot: Taco interviews himself.


      The difference is this interview is interesting, and James Gosling knows how to spell.

      --

      "And like that ... he's gone."
  4. Where will Java be in five years? by totallygeek · · Score: 2, Interesting
    Java has a long way to go in my opinion. I am in banking and see development wheels turn slowly. We have been begging for code to become more web-based or at least more centralized, and instead, our host systems more and more push data to the desktop, which is running some PC application.


    I myself code just about everything in a server-sided web application. I can extend this to the desktop using Java, but to date have not seen a need. I know it takes more time this way than to fire up Visual Basic and create an application that way, but I don't run Windows, and my programs work on just about any system.


    As for the imbedded market, Java has the capabilities, but I don't know if developers are going to embrace it much with licensing issues, code changes between releases, and the increasing number of non-Java tools that effectively get the job done.


    Five years? Java will be with us, and there will be more of it out there. That might really be its peak usage before it falls like RPG, COBOL and other great languages that revolutionized computer program development.

    1. Re:Where will Java be in five years? by TWR · · Score: 5, Insightful
      Um, you are aware of a little think called J2EE, right? Java on the server is pretty much where the action is: servlets, JSPs, EJBs, JDBC, JMS.

      What are you using for web development?

      -jon

      --

      Remember Amalek.

  5. Re:Decimal arithmetic by Steveftoth · · Score: 3, Informative

    Use the BigDecimal class. It's standard and handles any size floating point numbers. Not quite as good as the Cobol version, but you can always write your own class if you are that picky.

    Sorry, Java is more based on C then on Cobol.

  6. Short, informative, and funny! by foobar104 · · Score: 5, Funny

    This interview is worth reading if only to get a laugh out of the way Sun's marketroids obviously sanitized it. In at attempt to make the text of the interview (which is just a transcript of a spoken exchange, after all) comply with Sun's trademark guidelines, they ended up with sentences like this:

    So, personally, you could delete [the] JDBC [API] from [the] J2SE [platform] and it would not affect any code that I've ever written.

    And this:

    That would make [the] Java [programming language] much more flexible.

    And this:

    Is it possible to submit the Java [technology] bytecode specification to a standards body like ECMA [and the like]?

    Sheesh. This interview was brought to you by the letters "[" and "]".

    1. Re:Short, informative, and funny! by md17 · · Score: 2, Interesting

      Your post is funny but this is a real issue. The company I work for wantJAVA had to change all their content to be In accordance with Sun's Trademark Policy. So now our site is covered with "[TM]". We also can't even use the name wantJAVA anymore.

      From our Espresso Pricing page:

      J2EE[TM] 1.3.1

      JMS[TM], CMP[TM], JNDI[TM]

      JMX[TM] Based

      JCA[TM], JTA[TM]/JTS[TM]

      I guess they need to protect their trademarks.

    2. Re:Short, informative, and funny! by gwernol · · Score: 2

      In at attempt to make the text of the interview (which is just a transcript of a spoken exchange, after all) comply with Sun's trademark guidelines, they ended up with sentences like this:

      That would make [the] Java [programming language] much more flexible.


      Actually I didn't read this as marketing speak at all. I thought they were making real technical distinctions. As Gosling pointed out in the interview, there are important technical differences between Java the language and Java the set of frameworks.

      In the quote above, for example, the speaker was talking about only the language, not the frameworks. The added words disambiguated the question so that its technical meaning was clear for those who don't yet understand the different things that the term "Java" alone can mean.

      --
      Sailing over the event horizon
    3. Re:Short, informative, and funny! by pnatural · · Score: 3, Funny

      there are important technical differences between Java the language and Java the set of frameworks

      which is why they're all called Java (TM).

    4. Re:Short, informative, and funny! by foobar104 · · Score: 2

      IANAL, but I have done a lot of datasheets and other marketing materials for my company. I believe the use of "TM" or the registered trademark symbol ("circle-R") is optional. You can also acknowledge trademark ownership with small print: "J2EE, JMS, CMP, JNDI, ETC, ASAP are trademarks of Sun Microsystems" or something like that.

      That's how we do it, anyway.

  7. Java as ECMA standard? by revscat · · Score: 5, Interesting

    From the article:

    JDC: Is it possible to submit the Java [technology] bytecode specification to a standards body like ECMA [and the like]?

    JG: Well, we actually tried to do that; to submit it to ECMA. And that exploded and turned into a rather bizarre episode. And actually, after that exploded, ECMA did an internal investigation and published a report, which is very interesting reading.

    Does anyone know what he's talking about? I saw this interview a while ago and have looked around in vain for the report he mentions. This would certainly be interesting, especially if, as I somehow suspect, Microsoft did something to prevent Java from becoming a standard.

    1. Re:Java as ECMA standard? by sheldon · · Score: 2

      I was curious about the same thing. I've done a number of searches on google and can't find anything. Found references on Sun's website to them announcing and then pulling out of the process, but no report.

    2. Re:Java as ECMA standard? by Tony-A · · Score: 3, Insightful

      Them as lives by the crystal ball shall learn to eat ground glass.
      Nevertheless, I'll hazard a guess.
      There is the old joke about a camel being a horse designed by a committe. Java is Sun's "baby" and if left to the vagaries of the standards body, somebody, sometime, somehow would manage to sabotage the integrity of the design. It's gotta be real easy to change Java to be more "programmer friendly", a la Virul Basic, and lose the integrity in the process.

    3. Re:Java as ECMA standard? by JamesOfTheDesert · · Score: 2
      ... somehow would manage to sabotage the integrity of the design.

      That's has to be the funniest thing I've heard all week.

      Java has some very nice featues, but design integrity is not one of them. It's supposedly an OO langanguage, but not everything is an object. Nor can you extend many basic types (such as String or Integer). You are often forced into a declarative programming style where an OO-style would be more natural (e.g., try getting the absolute value of an Integer). You can't iterate over collections without explicitly creating a superfluous, temporary Iterator object. There are numerous inconsistencies among class methods named 'add' and 'put'.

      Anyway, the bloated Java class collection couldn't do much worse under ECMA than the JCP.

      --

      Java is the blue pill
      Choose the red pill
    4. Re:Java as ECMA standard? by The+Mayor · · Score: 2

      You've got some good examples of inconsistencies. It would be nice if basic data types were objects. It would be nice if Integer and String weren't final. The iterator thing is nice, although it sounds to me like you've just read a C# book (really, a privately allocated local object isn't that awful, at least with modern garbage collectors). And the inconsistent naming of class methods is due to sloppy programming, although it would be nice if they enforced the get/set naming convention as a rule.

      However, you can't get an absolute value of an Integer? Ever try Math.abs(Integer)? It takes the absolute value of an integer. Perhaps you wanted it back as an object? Well, since int is not an object, you can always wrap it inside another Integer. Like "new Integer(Math.abs(Integer))". In both clases, replace "Integer" with your Integer object. This may not have the syntactic sugar as some languages, but its exactly what goes on under the covers if ints are not objects. Seems pretty straightforward to me.

      Of course, if Java had real generics, you could add these methods to the generic number class. Then the math functions wouldn't have to be in a separate class. But that's a different story. (yes, generics likely will be flawed when released, too, due to some design details concerning the JVM).

      --
      --Be human.
    5. Re:Java as ECMA standard? by Stu+Charlton · · Score: 2

      I would suggest there's a big difference between design integrity and purity. Java has a certain philosophy of what languages should be, where certain tradeoffs should be made, and it sticks to it. There's a significant amount of cognitive predictability in the language, it doesn't include "trap doors" to change the meaning or intent of well-known constructs such as operators, primitive (naturally "value") types, and reference/object types. One may complain that primitive types should be transparently viewed as reference types (the "autoboxing" argument), and that's a valid concern, probably to be addressed by Java 1.5.

      --
      -Stu
    6. Re:Java as ECMA standard? by JamesOfTheDesert · · Score: 2
      An Anonymous Coward bleats, "You, sir, are a fucking idiot."

      That made my day. Now I *know* I'm on the right track.

      --

      Java is the blue pill
      Choose the red pill
  8. Related information by sisukapalli1 · · Score: 4, Informative

    The interview was very short and I did not find much information. Here are some related links:

    http://www.computerworld.com/storyba/0,4125,NAV4 7_ STO69691,00.html -- on .NET and J2EE

    Gosling on netbeans -- (03/2002)
    http://www.netbeans.org/articles/interv iews/james_ gosling.html

    An old interview from 2000 -- more on java http://www.devx.com/judgingjava/articles/gosling/d efault.asp

    Another from 1999 --
    http://www-106.ibm.com/developerworks/features/g os ling/

    S

  9. [The] editing [job] by Anonymous Coward · · Score: 5, Funny

    I think [that] the [person who acted in the capacity of the] editor [of this article] who keeps [repeatedly] butting in [to the questions and answers] for no [descernable] reason [or benefit] should just shut [the f*ck] up.

  10. What Java really needs... by pyrrho · · Score: 2, Interesting

    Well, I like java, but it's still special purpose to me. It excels in ecommerce and dynamic web stuff. It may someday excel at distributed systems since it will be easy to move code around various devices on a network.

    It's not a general purpose platform or language, imho, however. But there is one thing that would make it that way... hardware VMs... which would be JavaMs, of course, since they wouldn't be virtual.

    Where are the processors that run the java code on the chip directly?

    --

    -pyrrho

    1. Re:What Java really needs... by Moonshadow · · Score: 2
      Well, I like java, but it's still special purpose to me. It excels in ecommerce and dynamic web stuff. It may someday excel at distributed systems since it will be easy to move code around various devices on a network.

      I dunno. I can do the same without having to recompile every time I make a change.

      And it's open source :)

    2. Re:What Java really needs... by bentini · · Score: 2
      Why could that possibly matter?
      Do you care if you have a Transmeta or Intel chip to run x86 ops, aside from sheer performance?
      Or put this way, so what if it's dynamically translated?

      Secondly, picojava (?) chips do this. You can buy the core from Sun, and put them on your own chips. So, they actually do exist, but because they're all stack-based and in other ways fairly odd, you could probably do better with a dynamic translator than a silicon implementation, especially once you factor in volume.
      -Dan

  11. If you want good realtime with java... by MiddleHitter · · Score: 2, Informative
    jdk's realtime isn't all that great, and is easily run awry. For great realtime java, check out NewMonics.
    It runs on linux too!

    I may be a little biased though...

    --
    I don't fear computers, I fear the lack of them. -I. Asimov
  12. Java features by ilyag · · Score: 4, Insightful

    I can't say I found a lot of information in the article... Still, here are some questions about the design of the language:

    1) Why are classes like Integer so weird? It is such a pain to, for example, increment them... Change of this would conflict with absence of operator overloading, true (I don't like that too much either, but at least can imagine why it's (not) there). However, why not make them magical like String's "+"?

    2) Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...

    3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?

    This wasn't intended to be troll, even if it looks and feels like one. ;)

    --
    I like '...' (and (nested) parens)...

    1. Re:Java features by GuyZero · · Score: 3, Insightful

      3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?

      Well, this is really a classloader limitation... there's no restriction to loading classes from a databse, across the network, from your back pocket, etc, as long as you've got an appropriate classloader.

      Besides, there are those things called JAR files... have you used Java much?

    2. Re:Java features by ZeroConcept · · Score: 3, Informative

      1) Integer and String classes are inmutable, their value cannot be changed.

      2) I Agree with this, but some people argue that you should use the return value or create your own mutable wrapper of int.

      3) Try using Inner classes. I like the idea of the filename matching the classname as it makes it easier to browse trough code and reduces source control conflicts.

    3. Re:Java features by SimonK · · Score: 4, Informative

      Why are classes like Integer so weird?

      Because they're an afterthought. Java was originally designed without the primitive equivalent reference types and they were tacked on later to solve some problems which emerged. Basically, the problem was that there was no type that included both Object and the primitive types, which made reflection and collections hard to deal with.

      The original decision not to make the primitives objects is one of the Great Mysteries of All Time. Sun say its for "efficiency reasons", but Java's antecedent languages (Smalltalk, Lisp, etc) solved the same problem using type tags, so primtives look like objects even though they are implemented differently, and indeed the best VMs actually do this internally for other reasons.

      Essentially, its a mistake, IMHO.

      Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...

      Java's basically an OO language. You can use it in non-OO ways, but you tend to run into problems like this. Basically, if you want to return more than one value from a method, you should probably group them together in their own class. If you want to use the return value to return an error code, you should learn about exception.

      I program in Java every day, and the inability to return multiple values is not a problem for me in practice.

      One (public) class per file.

      .class files act as header files as well as binaries. In order to preserve the sanity of programmers, the compiler builds any unbuilt sources. To do that it has to find them. Hence the "file must have the name of the public class" rule.

    4. Re:Java features by zenyu · · Score: 3

      1) Why are classes like Integer so weird? It is such a pain to, for example, increment them... Change of this would conflict with absence of operator overloading, true (I don't like that too much either, but at least can imagine why it's (not) there). However, why not make them magical like String's "+"?

      I'm pretty sure you can't change the value of an Integer, just like String. This is for efficiency. I'm sorta of two minds about not including operator overloading in the language, I love it in C++, but it can be good to have code that novices can read.

      2) Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...

      Create your own container class. But passing int's by reference doesn't sound very object oriented, perhaps a change in style would be more appropriate. I have never run into the problem myself. I sometimes do it in C++, but I consider it a bad habit...

      3) One (public) class per file. This especially bugs me with small interfaces. Such a waste of screen space and disk space (each file takes up 4k on the file system)... Why not allow to put a hierarchy of interfaces (and, preferably, classes) in one file?
      I couldn't disagree with you more. Having a file per public class makes browsing other people's code much easier. It's a habit I have adopted in C++. grep is a wonderful thing, but it can break the flow when you're reading code in an editor. Wasting 4k on the file system isn't much of a problem, even on embedded systems. If it really really bothers you use a compressed file system or make you're inodes smaller, remember class files are minute compared to compiled code so you end up using much less space overall.

      Why Bill Joy still doesn't like templates puzzles me the most. I'm sure it could be done elegantly in Java.

    5. Re:Java features by acroyear · · Score: 2
      > 2) Several times I got caught on the fact that there is no way to pass an int by reference. And I don't like Integer (see aboive)...

      Create your own container class. But passing int's by reference doesn't sound very object oriented, perhaps a change in style would be more appropriate. I have never run into the problem myself. I sometimes do it in C++, but I consider it a bad habit...

      Agreed, its a bad habit. Its a case of a function/method doing two or more things at once, improperly designed. If you need a return value to determine success, switch to a function that returns the changed/new value and fire an exception when failure happens. And just get used to catching exceptions.

      try {
      i = nextIntFromDatabase(i);
      } catch (SomeDatabaseException e) {
      ...
      }

      --
      "But remember, most lynch mobs aren't this nice." (H.Simpson)
      -- Joe
    6. Re:Java features by Wraithlyn · · Score: 2

      I just hate when I have to fill, say, a JTable with a million numbers... and I have to use a million OBJECTS instead of primitives because that's how TableModel works.

      Suppose I could write my own primitive model/view framework... but that kinda kills the point of using a feature rich language in the first place :)

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    7. Re:Java features by Wraithlyn · · Score: 2

      Of course I write my own TableModels (or more specifically, AbstractTableModel). DefaultTableModel is crap. You still have to use Objects though, which was my point. If your TableModel has a million unique ints, you need a million Integer objects... no way around it.

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    8. Re:Java features by PhotoGuy · · Score: 2
      One (public) class per file. This especially bugs me with small interfaces.
      But requiring the one public class to match up with the filename makes tracking down the source for a class *so* much easier. You know it has to be in that file. If you could throw a bunch of public classes in one source file, you'd lose this advantage.
      Such a waste of screen space and disk space (each file takes up 4k on the file system)...
      Ummmm, what decade are you living in? A 120G drive, which would hold about 31 million of those 4K source files. Each million source files costs you about 15c. You must be one hell of a prolific programmer! :-)

      Ohhhh, wait a minute, you're probably buying your disk drives from Sun, where it's $1400 for a 36G drive. I guess at 18x the price, that would make a difference :-)
      --
      Love many, trust a few, do harm to none.
  13. Questions left unanswered... by Bonker · · Score: 5, Funny

    1. Why is Java so damn slow?

    2. Why do so many Java developers get so upset when you point out how damn slow Java really is?

    3. Why is it so much fun to pick on Java developers when there really are slower languages out there?

    4. If you could make Java fast, would you voluntarily leave it slow just so we could give Java developers apoplexy by mentioning how fast even PHP is for certain tasks?

    --
    The next Slashdot story will be ready soon, but subscribers can beat the rush and slashdot the links early!
    1. Re:Questions left unanswered... by TheAwfulTruth · · Score: 2

      VBA? Did you mean VBS? And besides, compairing scripting languages to (at least partially) compiled languages isn't really fair. Even VB is much much faster than Java. It really is the slowest compiled languages I've ever seen or used.

      --
      Contrary to popular belief, coding is not all free blow-jobs and beer. Those things cost MONEY!
    2. Re:Questions left unanswered... by The+Mayor · · Score: 2

      1) Java isn't slow. v1.3 and earlier of the JDK didn't implement video copies to utilize hardware acceleration (their line was "correct running first, optimization second). v1.4 fixes this. Scrolling is fine under JDK1.4. In fact, performance is pretty zippy under v1.4.

      2) Because Java is still the fastest OO language for server-side programming. Perl & PHP are faster but not object oriented. Servlets and JSPs are fast in large part due to extensive object pooling (although they've got some architectural flaws. tag libraries are my answer--all the performance of JSPs & Servlets with true separation of Model & View). And, besides, for loops that get executed frequently, HotSpot doesn't do a bad job with runtime optimization (and it's a *lot* easier than writing apache modules, the only way you'll get superior performance under Apache with C++).

      3) FUD? See #1, 2?

      4) See #1, 2.

      Look, people don't choose Java because it's the tightest language available. They do it because it's the best tool for the job. I don't know about you, but I get paid for proper design, not for optimization. I can get orders of magnitude performance improvements through proper design. This more than makes up for the loss in performance of a JIT interpreter.

      I write code faster in Java than in other languages (no, haven't tried C#...it does look like a nice language, though). They have fewer bugs. I get products to market quicker. It's slow? Then buy a new computer. Today, $500 will buy a computer nice enough to run Java comfortably.

      Java isn't the right answer for every job. However, for rapid application development and server side coding, it's a pretty damn good choice. It's slow? Yes, v1.0-v1.3 were slow with client code. Yes, v1.4 is slower with client code than C++, although it's close enough that I don't care. Java is a good language for getting things done, though. It's not pure OO. It's not perfect. But is is good at what it does. Choose the right tool for the right job.

      --
      --Be human.
  14. Java code generation by descubes · · Score: 3, Informative

    JDC: I'd like to see more tools that enhance developer productivity, we have Unified Modeling Language (UML) modeling tools, and wizards to help us generate code. Can we tie these together better?

    Another way to enhance productivity is to manipulate the Java source code itself (rather than generate code from the outside.) A good example of tool doing just that is Moka. In short, Moka is a Java-to-Java translator which allows you to extend Java in many interesting ways. For instance, there is a plug-in that allows you to remove any method or class whose name begins with 'debug'. There are other examples on the web page. I believe it's easy to use, and it makes up for various shortcomings of the language itself.

    --
    -- Did you try Tao3D? http://tao3d.sourceforge.net
  15. JavaWorld story by lseltzer · · Score: 5, Informative
    Sun's announcement that they were withdrawing from the ECMA process was in December '99.

    The March 2000 JavaWorld has an interview with ECMA officials that, as Gosling says, makes for interesting reading:

    • ECMA responded by chastising Sun for causing an "enormous waste of experts' time and companies' money." In an interview today, a top ECMA official said Sun's criticisms of the group are merely a smokescreen for its real motives for ending the relationship.
    • "They just don't want to give up control" of Java, said Jan van den Beld, secretary-general of ECMA. "It is 100 percent my opinion that Sun is publicly saying they want to make Java a standard, but privately not making it happen."

  16. Preemptive "faster than C" counter-troll by Ars-Fartsica · · Score: 3, Insightful

    For all of the posters who are going to respond with "Java can possibly be faster than C"...well, a color television could also possibly spontaneously appear at the event horizon of a black hole, but that doesn't mean that this actually ever happens.

    1. Re:Preemptive "faster than C" counter-troll by macpeep · · Score: 2

      A non-programmer friend asked me a while back how you can "figure out" prime numbers with a computer program. So.. In order to show him the basic idea, I "pair programmed" a simple example that just started counting from 1 and up and then for each number, looped from 2 and up to half the original number to do a modulo on them. I implemented it in Java first.. The next day, a guy at work asked me why I had done it in Java.. So.. I copy-pasted the 20-or-so line code to C and compiled it. Standard compiler flags for both Java and C.. And I ran it.. and timed searching the first 100000 prime numbers. Java was about 10% faster and I wasn't even surprised.. Why? Cause this is exactly the kind of situation where Java can be faster than C. It's very easy to do a similar test yourself. Doesn't even have to be prime numbers. Just do whatever kind of random math you want and see for yourself. With the HotSpot virtual machine, things like this get optimized like crazy by the virtual machine. If you would compile it with all speed optimization flags, inlining methods etc.. I don't know - I'm guessing C would be a bit faster, but it would still be very close.. But don't take my word for it - try for yourself.

  17. Answers... by TWR · · Score: 3, Informative
    1. Java is slow just to piss off people who worry that any scroll speed short of "the Flash on Steroids" is too slow. People who do real work and don't just run benchmarks all day don't notice.

    2. They're not upset; that's the sound of Java developers rolling around in the large piles of money they make writing software that people actually use.

    3. Because it's easier to nitpick the best product than it is to find all of the memory leaks and bad pointer refs in the C++ code written by l33t hax0rs.

    4. Yes; if you can amuse your inferiors at no cost to yourself, why not bring some joy into their sad lives?

    -jon

    --

    Remember Amalek.

  18. Re:OT: Visual COBOL Lives! by fanatic · · Score: 2

    You used punch cards only 15 years ago? (I'm assuming you didn't mean way "over 15 years ago".) I was in the last CS class I know of that used them at UIUC (doing FORTRAN on an IBM 360, I think) before they went TSO 27+ years ago, and I just assumed that was the last place anywhere to use that (at least in the first or second world). Bad assumption?

    --
    "that's not encryption - it's a new perl script that I'm working on..." - from some Matrix parody
  19. My Favorite Java Quote... by pnatural · · Score: 3, Funny
    I should post this anon because I'm sure I'll be marked down by the moderators/java coders with no sense of humor, but it's only karma. Here goes:
    If code were music, Java would be country.
    Anyone know where I could get that on a teeshirt?
  20. Don't see any cost or license information there by HiThere · · Score: 2

    It may be on the site somewhere, but I sure didn't find any cost or license information at your site. Not a promissing start from my viewpoint.

    Also, it wasn't clear whether or not it was entirely aimed at embedded systems, or whether it supported some kind of Swing-equivalent library. Or, perhaps Swing was what you were supposed to use. But would it work? You mention that you have your own JVM, but you don't say anything about "binary compatible" etc., and even awt contains a lot of compiled code.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  21. Does anyone understand... by Glock27 · · Score: 4, Insightful
    the dynamic that has made Java grow exponentially in 'real' software development, and become the dominant teaching language versus the constant bashing it receives here on Slashdot and among OSS people?

    Java is actually very good, and yes, very fast. I fail to understand why anyone would prefer Microsoft's poor imitation. Java is still growing very fast and getting better all the time.

    Ignore it at your peril. Or better yet, just laugh at it...that is until you're in the unemployment line because you don't know it.

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
    1. Re:Does anyone understand... by pohl · · Score: 2, Insightful

      I don't understand it, but I'm not going to let that stop me from responding. It seems to me that OSS and Java are natural allies. It's the only language that I know of that would allow me to be a debian user in the middle of a business that loves nothing more than the phrase "we're a windows shop". I can develop on linux, use the operating system that I love, and deliver on anything that we need to. While there are some OSS languages out there that provide the the WORA property, they're lacking in various things like the bytecode delivery model, the security model, the J2EE model for scaling up applications. Plus the weight of a diverse and active industry helps to sell it to management. Maybe those who bash it feel that they are safely out of the woods with respect to Microsoft's control of the industry, but I for one don't feel safe yet.

      --

      The "cue the foo posts in 3, 2, 1..." posts will commence with no subsequent foo posts in 3, 2, 1...

    2. Re:Does anyone understand... by alext · · Score: 2

      Ignore it at your peril.

      But how many people appreciate that Linux is in peril?

      Right now, cross-platform code isn't a major issue because

      a) embedded or non-x86 Linux isn't that big yet
      b) people are used to compiling source

      but neither of these assumptions will be true in ~4 years. Linux will need a VM, but only Dotnet/Mono and Java will be available, and with the ridiculous hype that Mono is getting, MS could well be in drivers seat. Not a pleasant prospect...

    3. Re:Does anyone understand... by dvdeug · · Score: 2

      Why do you think that we need a VM for cross-platform code? Debian compiled almost everything that's going to be released with Woody on 11 different architectures. Even if this is a problem, the solution has more alternatives than Mono or JVM; for one, it would be simple to toss a PowerPC, or Alpha or MMIX or whatever emulator into the kernel, and run Linux binaries compiled for that architecture.

    4. Re:Does anyone understand... by alext · · Score: 2

      Because Debian is the exception, not the rule.

      When I get some little music toy app for my PDA, you can bet it's not going to be pre-compiled for all existing platforms. 11 is the starting point, it's going to get a lot more diverse from now.

      I really don't think kernel emulators are in the running here - PDAs are constrained enough as it is without the overhead of x86 emulators. Nokia and other phone makers are setting the trend for small devices and compiled binaries are not part of the picture.

    5. Re:Does anyone understand... by dvdeug · · Score: 2

      When I get some little music toy app for my PDA, you can bet it's not going to be pre-compiled for all existing platforms

      Your PDA may run Linux, but I seriously doubt it runs a full GNU/Linux distribution. You're going to be running a completely different set of apps.

      11 is the starting point, it's going to get a lot more diverse from now.

      Why? It's ported to pretty much every chip in production that can run it.

      PDAs are constrained enough as it is without the overhead of x86 emulators.

      But somehow they can deal with a JVM emulator, eh?
      (Note I never mentioned x86; there are many chips Linux runs on it would be much nicer to emulate.)

      Nokia and other phone makers are setting the trend for small devices and compiled binaries are not part of the picture.

      Then GNU/Linux is out of the picture for them. Linux may work, but it's not going to look like any Linux you use, nor is going to run the same programs.

    6. Re:Does anyone understand... by alext · · Score: 2

      >. You're going to be running a completely different set of apps.

      >>11 is the starting point, it's going to get a lot more diverse from now.

      > Why? It's ported to pretty much every chip in production that can run it.

      Nonsense. First you talk about porting apps, then about porting the OS. It doesn't matter how widely the OS is ported, it's the apps that will be separately distributed that count.

      Yes, I can confirm that PDAs and phones are already running JVMs. I can also confirm that no PDA or phone anywhere is running a CPU emulator.

      I won't bother attempting to convince you that PDAs will be running the same programs as mainstream Linux as you can find that out for yourself with a quick search in Slashdot.

      Don't bother coming back with more airy-fairy arm-waving - I'm not interested in vacuous assertions and I'm pretty sure no one else is.

    7. Re:Does anyone understand... by Stu+Charlton · · Score: 2

      Look at J2EE and you'll see most of the "innovations" in ASP.NET are really just bringing it up to par with the base line J2EE implementations out there. Clustered session management is old hat. User & server controls have been out in Java since 1999 with JSP tag libraries. Ever try writing a custom control in .NET? See you in 2004. It's not easy, compared to tag libs.

      As for drag 'n drop, I'd really like you to build a production website with drag 'n drop. Really. Graphic designers everywhere are hanging up their BBEdits forever as we speak.

      --
      -Stu
  22. Re:Does Java use Pointers? by Anonymous Coward · · Score: 3, Informative

    for(int *p=0;;*(p++)=0);

    The equivilent code in java would be:
    Integer a = NULL;
    int b = a.toInt();

    Java uses references, not pointers. The difference is twofold: one, if you attempt to dereference a null pointer in java using the code above, you get a well-handled exception which either launches an error routine defined by the programmer or causes the program to terminate politely (as opposed to the messy crash you will get if you pull this in C++). Secondly you cannot do math with references-- with a reference, you can point it to something another reference already points to, or you can point it to a new object, or you can point it to NULL. With a pointer, you can just point it to any old thing anywhere in memory, or even just iterate over memory like the code at the top of this post does, and when you read the any-old-thing in question you'll just get garbage-- but your program will *think* it's reading a valid value, and operate on the garbage as if it was something important. Sometimes this results in catastrophe.

    The downside to java's way of doing things is it's a bit simplistic-- you cannot have references to ints, floats, or other "base types" unless you put them inside a "wrapper object". This simplifies coding and reading but is a bit limiting at times.

    Note, for the record, in C++, the term "null pointer" generally refers to any pointer that points to garbage-- in practice it doesn't always refer to NULL, which is memory address 0. Perhaps you should read some of the other documents on the "everything2" site i link above-- it has lots of good definitions of things. Hopefully that helps a little :)

    super ugly ultraman

  23. What the heck is autoboxing? by trenton · · Score: 2
    I consider myself a pretty good Java guy. I also keep up on the theory of programming languages. Gostling mentions "autoboxing," something I've never heard of. Anyone know what that is?

    (Yes, I can use Google, but that didn't seem to be much use. Oh, but did find this googlewhack while trying to get info.

    --
    Too big to fail? Does that make me to small to succeed?
    1. Re:What the heck is autoboxing? by Wraithlyn · · Score: 2

      I don't know for sure, but if I had to make an educated guess, I'd say he's talking about dynamic primitive-to-object conversion, as needed, or possibly vice versa (or both).

      This is similar to how Javascript handles strings... Javascript has both a string literal type and a String object type.

      var lit = "my string literal";
      var obj = new String( "my string object" );

      Now the cool thing is, lit isn't an object, but you can still call methods on it from the String class, like lit.substring(4) and stuff, just like you could with obj. This is because Javascript automatically creates a temporary object for the literal (ie, autoboxing?)

      Once again, let me state I don't know for sure what the term actually means, I've never heard it either. But from the name itself and the context of the discussion, that's what I'd guess he's talking about.

      Anyone have more of a clue than us?

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    2. Re:What the heck is autoboxing? by Steveftoth · · Score: 4, Informative

      Autoboxing is a process where primitives are automagically converted to Objects (and back). It's a language change so that you would have to write new code to use it. Basically you could say....
      int i = 2,j=1;
      Integer result = Math.max( i,j);
      and it would magically convert the result of the Math.max to an integer. Or if the Math.max took Integers instead of ints, it would create Integers for you.
      The details need to be worked out because as of right now, an Integer is unmodifiable and things like
      i == result
      would be problematic. Since == tests equality, but it only works with objects if they are actually the same reference. You can't do
      i.equals( result )
      Also, what if you do
      int i= 2;
      Integer j=i, k=j;
      ++j;
      If you are using object semantics, then k should probably be changed to reflect the new value of j, since j and k both point to the same object. It comes down to, should the value of j change? or the value of the object that it represents?

    3. Re:What the heck is autoboxing? by Steveftoth · · Score: 3, Insightful

      Not really, because you have problems like what gosling said with identity, so you say
      int i = 1;
      Integer I = 1;
      does i == I?

      casting a float to an int ( and back ) is completly different as when you cast a float to an int, the number will probably change.
      3.999999 -> int -> 3
      should it goto 4? probably, it should be rounded.
      but autoboxing is supposed to keep the value of the original type.

      Regardless I'm not too sure how this will help performance much.
      The feature that I want to see added to java is that I want to be able for the java vm to create objects on the stack. Then if they get assigned to a member pointer, get promoted to the heap. This way you could keep objects on the stack where they could be easily collected when the function that created them ends scope.

    4. Re:What the heck is autoboxing? by Aapje · · Score: 2

      The feature that I want to see added to java is that I want to be able for the java vm to create objects on the stack. Then if they get assigned to a member pointer, get promoted to the heap. This way you could keep objects on the stack where they could be easily collected when the function that created them ends scope.

      That's already part of Hotspot:

      "A generational collector takes advantage of the fact that in most programs the vast majority of objects (often >95%) are very short-lived (i.e. are used as temporary data structures). By segregating newly created objects into an object "nursery", a generational collector can accomplish several things. First, because new objects are allocated contiguously in stack-like fashion in the object nursery, allocation becomes extremely fast, since it involves merely updating a single pointer and performing a single check for nursery overflow. Secondly, by the time the nursery overflows, most of the objects in the nursery are already "dead", allowing the garbage collector to simply move the few surviving objects elsewhere, and avoid doing any reclamation work for dead objects in the nursery."

      Here's an in-depth explanation with pictures.

      --

      The Drowned and the Saved - Primo Levi
    5. Re:What the heck is autoboxing? by Steveftoth · · Score: 2

      Not really, this is not the same thing as what I'm talking about. Well, it could be depending on how they implement it. They still have to do some sort of mark and sweep algorithim, which is not fast.

      I'm saying that they change the class file format. Such that all methods have their parameters marked. So you have a method
      myMethod ( Rectangle r );
      now the coder does nothing, but during compile time , the rectangle r is tracked, and determined if r is only used locally, if the code keeps a reference to it, or passes the reference to a function that then keeps a reference to it.

      If the reference is never actually stored ( the reference is only used locally) then the object is marked as possiable for stack creation.

      In your code, if you create an object, it is by default created on the stack, unless it is determined by the compiler that the reference to the object is stored somewhere in your code.

      The object would be destroyed when it goes out of scope.

      This would speed up and reduce memory consumption of the VM IMO. Firstly , it would get rid of the huge penality for temporary object creation in loops. Usually this can be avoided by clever programming, but not always. Secondly, you can get rid of the static 'rendering objects' that many Swing components use. Rectangles being probably the biggest offender of this policy. Many times you just need a simple data structure in a loop ( for rendering to the screen) and you don't want to call a function to create it everytime. Or what about in a http server, you end up creating the same object over and over, the penality for this could be reduced.

      AFAIK, lisp does this already so this is not voodoo science we are talking about. What sucks about this approach is that changes to the JVM bytecode are required. Since object cannot be create on the stack.

    6. Re:What the heck is autoboxing? by Steveftoth · · Score: 2

      One more afternote, the whole idea here is to NOT do a GC. The eden area is a great idea and should not go away, actually I really like it. I'm trying to attack the problem from the other side, instead of making the GC smarter. Make it so that the GC never even sees these temporary objects.

    7. Re:What the heck is autoboxing? by Aapje · · Score: 2

      They still have to do some sort of mark and sweep algorithim, which is not fast.

      A 'complete' mark and sweep is not fast (one that doesn't miss anything). Eden uses a fast, but incomplete algorithm. That destroys all the easy temporary objects (and moves the rest to long term storage which gets the full GC). I don't see why your approach would be so much faster.

      --

      The Drowned and the Saved - Primo Levi
    8. Re:What the heck is autoboxing? by Steveftoth · · Score: 2

      This would be faster because work would have to be done at compile time to figure out if the object should be created on the stack or the heap by the VM. Basically trading ease of compile for runtime performance, which in my opinion is always a win.

      I don't care how fast you say this 'eden GC' is, there is no way it's faster then this solution, cleaning the stack is so fast. The live section of the stack has a MUCH higher chance to be in the cache, while eden starts out being megabytes large. So no matter what you are going to have page faults with eden. With the stack approach, objects simply go out of scope, no thinking on the vm is required to determine if an object is no longer live. Just like with a primitive.

      The only problem with this solution is that you have to have a way for objects to be promoted from the stack to the heap in the case of classes that change after you compile a class that depends in it.

      The whole reason for this argument is that time and time again, people want speed, and if speed can be added through VM changes only, and maybe a recompile, then why not do it?

  24. Re: What are you using for web development? by Synn · · Score: 2

    PHP

  25. What Java Is and Isn't by Synn · · Score: 3, Interesting

    The thing is, Java's strength is it's very weakness. Java is a platform neutral by design, so it's rather clunky when compared to a platform specific language. You won't ever see a game written in Java, not because Java is slow, but because you can't use Direct X with it(or whatever platform specific lib you want).

    I think Java is going to own the embedded market. A cell phone company can create Java software and it can happily switch around the cell phone hardware as much as they want and still use the same single piece of software.

    Palm Pilots are still popular for this same reason. There are tons of Palm apps that run on them and the new Pilots are software compatible with the older ones.

    .NET appears to be different than Java in that it makes no attempt at being platform neutral, rather it tries to be language nuetral. Python.NET, VB.NET, C++.NET all compile down to the same CLR. And a VB.NET developer can use Python.NET libraries.

    I think this will dominate the application market.

    1. Re:What Java Is and Isn't by gss · · Score: 2

      The thing is, Java's strength is it's very weakness. Java is a platform neutral by design, so it's rather clunky when compared to a platform specific language. You won't ever see a game written in Java, not because Java is slow, but because you can't use Direct X with it(or whatever platform specific lib you want).

      I beg to differ

  26. Re:Decimal arithmetic by alext · · Score: 2

    Java does not have a built-in arbitrary precision rational type

    Nor does COBOL. Perhaps you're thinking of Scheme?

    Anyway, COBOL users that have a clue (e.g. the UK Revenue Service) use 128 bit integers for monetary amounts - decimals are, er, pointless.

  27. Re:my thoughts by alext · · Score: 2

    Have you noticed that the syntax of Java is rather familiar (C++), and the semantics are not very new either (Simula 67)?

    Whereas the VM is remarkably innovative - bytecode verifier, security domains, JIT compilers, advanced GCs.

    Care to rethink those thoughts?

  28. Re:better codes by bnenning · · Score: 2
    String s = (String)arl.get(i);


    Which is fine until you get handed a linked list instead, and your algorithm goes from N to N^2. I like to write iterators like this:


    for(Iterator i=list.iterator(); i.hasNext(); ) {
    SomeClass obj = (SomeClass)i.next();
    // do something clever
    }


    So there is a temporary iterator object, but it's only in the scope of the for loop so it doesn't really bother me. I'm actually more annoyed with the cast, hopefully the generics in 1.5 will take care of that.

    --
    How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
  29. ARM and others do this already by theolein · · Score: 2, Informative

    ARM's jazelle core and others (do a google search or go to SUN's website) do this and supposedly it is already being implemented by mobile phone makers.

  30. Java, Microsoft and James by theolein · · Score: 4, Interesting

    Every interview I read on James Gossling, I read "how people are doing all sorts of exiting things on the desktop with it" and some other stuff such as how it is getting into "the embedded space". (what is embedded space? Did an astronaut get some vacum in abottle and bring it back with him?).

    At the same time I read how SUN marvelousy manages to fuck things up with respect to their favourite language on the client side. Granted, it is huge on the e-commerce side of things, but things like JSP are too complex for simple backend applications that are far more easily handled in PHP or ASP. The mobile market seems to like it and it might become big there too, given that ARM and others are making processor core that handle bytecode natively, but that's not yet a given.
    What stresses me is that, from the beginning, SUN mishandled Java and played into MS' hands for a number of reasons:
    1.When it first came out it became very popular very quickly because of it's ability to provide pixelated aliased dancing Dukes and and sound to web pages. However Sun never bothered to push the point and try to improve performance and load times. People got very tired of seeing pixelated images floating across the screen that took minutes in some cases to load on early modems. They just sat there on their butts and ignored the fact that AWT was hideous, ungainly, and in no way worked very well across platforms (I mean on the Mac or Unix for example) and lacked important controls.
    2.One of the things that played into MS' hands was the above and the fact that SUN made Java native interaction very difficult or at least non-trivial to implement, so that people who would have otherwise been able to make GUI controls and interface in C/C++ were put off having to slog through JNI. Along came MS with their JRI (or whatever it was called) which enabled all the hordes of MS developers to easily call MFC and other Win32 stuff directly from the classes. It was an easy picking and whose fault was it. It was or should have been obvious that MS would try to scupper anything that anyone else did (Custom ActiveX never became very popular but it did serve the purpose of making more FUD enter the arena) and the need for easy native access was defintely there. I know that it might have neccesitated changes in the security model but SUN didn't listen or was too confident or just too plain stupid when you look at the ugliness of their desktop for example.
    3.Eventually they did listen and came up with Swing, which was so slow on machines of the time (ever run the Swing demo stuff on a 223MHz x86?) that it put off many companies and developers, who just carried on using VB because it was a no contest in terms of GUI response. And this although Swing looked very good.

    Why did SUN ignore all the compaints? Why did they make native access so difficult? Why didn't they just improve AWT? Why didn't they try to look at it from a consumer point of view, which is what all those people watching the moronic applets of time were. Applets have all but dissapeared on the web and 99% of interactive shit is done with Flash today. Why didn't they try a trick from the MS book and try to implement things like the JVM starting up on boot or browser launch to make Applets start faster? Why did SUN make such a huge fuss of MS ignoring Java in XP when they couldn't even be bothered to make a marketing push for, IMO, some pretty neat stuff like WebStart?(who actually uses this?)

    MS may be an abuse monopoly but SUN has it's head in the clouds up with the bosses of big banks etc and seems too dumb to try to see things from a consumer point of view.

    (Sorry for the rant. I think they need it.)

  31. SMALL CORRECTION by macpeep · · Score: 2

    "Copy-pasted" and then obviously modified it so that it would compile in C - such as not making a class out of the whole app, not passing a String[] to main(), not having main be "static" etc. :) Nothing essential such as the actual algorithm and math code was touched, however.

  32. Hey Taco by Compuser · · Score: 2

    What about /. interview of Gosling? Surely people
    here have Java related issues and questions...

  33. Re:"messy crash" by big_hairy_mama · · Score: 2

    With C, C++, all using Signal does possibly what kind of things that the operating system is about to kill you for, and gives you the chance to exit will your head still on your shoulders, before the operating system goes ahead and decapitates your program.

    You are obviously a retard. You can try { ... } catch(NullPoinerException npe) { ... } and recover completely from dereferenceing a null pointer. Furthermore, you can recover and remain in the same block of code, whereas handling a signal requires registering a different function. And if you want, you can catch(Throwable t){} and recover from *anything* if you so wish.

    I'd call that well handled... or maybe you were being sarcastic?

  34. Java and good design by theolein · · Score: 2, Informative

    minatrix.com

    Go there and take a look at least. It's a java gamin g site on the basis of applets. Register (horror!) and take a look at the games. There are two 3D games last time I looked and a host of single and multiplayer tetris, galaxis and backgammon knockoffs etc.

    This site is very interesting for a number of reasons:

    1.It is immensely popular. When you play a game a window of all the other users online at the time pops up, and it blew me over to be honest.
    2.The games look extremely good visually, are based on simple premises that make them adictive and are playable even on slower hardware.
    3.It works best in Explorer's MS JVM of all things. JDK1.2 Browsers are not supported well and don't even work in some cases. This raises the question as to where they will go now that MS has dropped having it's own JVM in XP?

    sumea

    Go here and see what you can do with a well written ava 3D engine that needs no hardware acceleration. Take note of the site design. It makes an impression on consumers.