• Lucid Dreaming - Dream Views




    Page 3 of 3 FirstFirst 1 2 3
    Results 51 to 54 of 54
    1. #51
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by ninja9578 View Post
      I looked back at some java books, I guess I was wrong. I was confused because of the lack of explicit definitions. At least none of my professors ever used any. I can't recall ever seeing a -> in java, it was always foo.a. Am I correct there?
      Well, you are correct that Java does not have an arrow operator because the language doesn't use pointers. The dot operator in Java is really just a namespace operator. In regards to the issue of call by value versus call by reference, all non-primitive variables (i.e. not int, short, long, char, or byte) are references to objects in memory, so passing them to a method passes references to the same objects in memory, similar to appending an ampersand in a C++ function parameter. Any changes the method makes to the object will remain after the method is called.
      Last edited by dsr; 11-30-2007 at 03:30 AM.

    2. #52
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      That's what confused me. To me pointers mean by reference and copying it means by value. I guess I learned the terminology incorrectly. In C and C++ I always pass structs or objects larger than 64 bits via a pointer and then use it as such (with ->) within that method.


      Question to you java guys about Ynot's comment. Why do java programmers continue to use java's listeners and gui when it's so slow. I'm not biased about this, I use frostwire. Isn't there a java version of glut?

    3. #53
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Isn't GLUT pretty low-level? GUI toolkits need to be abstract enough to allow for decent productivity, which is often as if not more important than the performance of the GUI. Toolkits that come to mind are WxWidgets and Qt, although they aren't really intended for Java development.
      Quote Originally Posted by ninja9578 View Post
      Why do java programmers continue to use java's listeners and gui when it's so slow.
      I'm not sure it's that Swing is inherently slow just because it doesn't use the host OS's native widgets. I think it's more the overly complex design of Swing's API that leads to memory leaks and other system resource problems. The public domain Buoy seems to offer an excellent solution, and I might actually start programming in Java.

    4. #54
      Member Identity X's Avatar
      Join Date
      Mar 2004
      Gender
      Posts
      1,529
      Likes
      7
      Don't know about performance, but Sun didn't do themselves any favours by making the default Swing look-and-feel on Windows completely different to the rest of the OS, and, more importantly, ugly-as-f**k. It now takes one line of code to sort the ugly munt out, but still, yuck.

    Page 3 of 3 FirstFirst 1 2 3

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •