Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: Is Java really worth it?

  1. #21
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,715

    Re: Is Java really worth it?

    You must not understand the concept of a virtual machine... It isn't compiling it as it runs it, or converting it to equivalent opcodes... If you think that it is going to "compile your code to the exact specs of your machine..." then you were lied to somewhere because thats not how the java VM works at all.

  2. #22
    Join Date
    Aug 2005
    Location
    Bristol, England
    Beans
    52
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Is Java really worth it?

    Quote Originally Posted by Wybiral View Post
    You must not understand the concept of a virtual machine... It isn't compiling it as it runs it, or converting it to equivalent opcodes... If you think that it is going to "compile your code to the exact specs of your machine..." then you were lied to somewhere because thats not how the java VM works at all.
    The Java JVM is a Just In Time compiler. "Compiling as it runs it" is exactly what it does (to within a few milliseconds at least). So I'm left either thinking Sun is lying to me (obviously you didn't read my link as it proves you wrong), or you are just trolling. Lets see, which shall I believe.....

    Let me link to the Java SE HotSpot VM (JVM) main page this time. http://java.sun.com/javase/technolog...spot/index.jsp

    In particular I'll quote this:
    It includes dynamic compilers that adaptively compile Java bytecodes into optimized machine instructions

    Sorry, I'll believe Sun on this one, especially since they're well on the way to GPLing Java now. GO LOOK AT THE CODE!

  3. #23
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,715

    Re: Is Java really worth it?

    Yes, but there is a difference between the java VM and the java JIT. Not all code can be ran through the JIT from what I've read, and especially not on every system. So then you have speed vs compatibility. Another thing to mention is the loading time... Java is always going to take longer than a precompiled language if it is using the JIT. Another point to bring up is that people do not always want to install the java runtime environment which is a factor when releasing a big project.

    You are right though, I was wrong, I was doing all of my research on the JVM and neglected the JIT. But, it still is not a sure-fire approach because not every system is compatible with the JIT, and none of them produce standartize executable machine code because they are essentially being compiled by different programs. Now, dynamically compiled java definitely reaches C++ worthy speeds, but at the cost of it's prized portability and a very slow loading time... And I have yet to see any statistics to show it going above C++ speed. Equal yes, but not above.

    (I do believe java was made on C, so even if it were faster than C... It would just be an example of how fast C is, lol)

    Thank you for pointing out the JIT, that did enlighten me as to why people would use java over C++

  4. #24
    Join Date
    Jun 2006
    Location
    Glasgow, Scotland
    Beans
    139

    Re: Is Java really worth it?

    What code can't be run from it and what commonly used system isn't supported by the Sun Hotspot JVM (the most common)? And how does "dynamically compiled java" lose its portability?

    The JIT compiler is a component of the JVM so not really as seperate as you think.

    This all sounds like a lot of F.U.D.

  5. #25
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Is Java really worth it?

    Quote Originally Posted by Verminox View Post
    Now, I wanted to give a try to programming applications with GUI. .... make windowed apps cross platform with C/C++

    Does the cross-platform thing make Java worth it or not? Or should I stick to C/C++ now that I am comfortable with it. Will it be a big switchover from C/C++ or is it similar?
    Learning new library and become expert in it is big time committment, bigger than learning new language. Java is very close to C++ and you will learn it fast - but it will take you months and years to become expert in java objects. They are different for no good reason - just incompatible for marketing reasons.

    To get better return of investment of your time I would suggest to learn different language: python. Dynamic typing and memory management will open new horizons to you, new levels of pruductivity, and you learn new tricks, like runtime introspection (if you care about it). With python, you would be able to create a prototype of your system in 10% of time it would take in C++. Of course it would be 50% slower than C version, but you can find bottlenecks and reimplement them in C, or rewrite whole thing in C - but you will have experience (and user feedback) from python version. Also, python will allow you to build non-critical parts of your infrastructure, like unit-test pipeline, developer suppert website etc much faster.

    Python supports wxWidgets, popular library that looks native in all environments.

  6. #26
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,715

    Re: Is Java really worth it?

    Actually pmasiar, I know we've had our share of python vs C conversations (if you will...) but I would give python a lot more credit than 50% slower... It is definitely better than that. Just not AS fast as C++ (I say C++ because C isn't really relevant, C++ has more in common with python). And I agree with pmasiar, python is a really good language to have under your belt, especially since you can embed it in your C++ programs for user scripting, create modules for python using C++, or just use python to orchestrate your C++ programs. It is very useful an easy to learn.

  7. #27
    Join Date
    Nov 2006
    Location
    Mumbai, India
    Beans
    186
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Is Java really worth it?

    Hmmm... I've never really thought of Python... not really heard much about it to tell you the truth.... don't even know what it can do actually.

    I'll try giving Python a try then.... something new will be fun to learn... and whatever I am doing is as a hobby only anyawy, not professionally.... so I can deviate to whatever is more suitable and more fun.

  8. #28
    Join Date
    Apr 2005
    Location
    Germany
    Beans
    215

    Re: Is Java really worth it?

    Quote Originally Posted by Wybiral View Post
    You are right though, I was wrong, I was doing all of my research on the JVM and neglected the JIT. But, it still is not a sure-fire approach because not every system is compatible with the JIT, and none of them produce standartize executable machine code because they are essentially being compiled by different programs. Now, dynamically compiled java definitely reaches C++ worthy speeds, but at the cost of it's prized portability and a very slow loading time... And I have yet to see any statistics to show it going above C++ speed. Equal yes, but not above.

    (I do believe java was made on C, so even if it were faster than C... It would just be an example of how fast C is, lol)
    puh, you indeed read a lot about java, the VM and JITing, but sadly you have only poorly understood it.

    points which come to my mind:
    * what does the language a compiler is written in got to do with the execution speed of the output?
    * JIT is not gjc
    * compile caches?
    Last edited by MadMan2k; December 18th, 2006 at 10:18 PM.
    Ubuntu is an ancient African word meaning ‘I can’t configure Debian’

  9. #29
    Join Date
    Jul 2006
    Beans
    Hidden!

    Re: Is Java really worth it?

    What kind of application does the the OP intend to create ? If it isn't any kind of real-time application (for which there are actually modified libraries, but that's beside the point) stop caring about machine code vs. byte code. I'm sure your users won't really notice if your application is idling a bit faster while they are tying or hovering with the mouse to find a button . It's much more likely that runtime the behavior will be affected by bad choice of data structures or algorithms with with quadratic or worse complexity.

    Java and C# are nice that you don't have to deal with the memory management. Unless you are an experienced C/C++ programmer you will probably run into memory leaks and weird pointer behavior and you gain very few (see above). Additionally it makes your applications more stable.

    I haven't worked with the new Java 1.6 but Swing ( the GUI toolkit ) in 1.5 was very tiresome to work with. Best get an IDE with a GUI builder like NetBeans which will yield good results in a short time.

    Just for some clarification, the just in time compiler compiles classes dynamically for the native architecture if they are accessed on a frequent basis. JIT compilation is also a lot faster from byte code as some of the intermediate steps which are required to compile from source are already being finished in byte code.

    Plus, Java is still one of the leading enterprise programming languages.

  10. #30
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Is Java really worth it?

    Quote Originally Posted by Verminox View Post
    Hmmm... I've never really thought of Python... not really heard much about it to tell you the truth.... don't even know what it can do actually.

    I'll try giving Python a try then.... something new will be fun to learn... and whatever I am doing is as a hobby only anywy, not professionally.... so I can deviate to whatever is more suitable and more fun.
    Python has all java features, except static typing (python uses dynamic typing). So when making collections, you get all objects in and out intact - without recasting. Python also has operation overloading and multiple inheritance (java lacks both).

    I also prefer python's dynamic exceptions compared with java's static ones - for pilot project, I handle only really annoying and/or easy to handle exceptions, so I can avoid 50% of the really nasty and boring error-handling code (for pilot).

    Overall, you see that python's fun factor is higher, line count is lower. Java is more 'enterprisey' bacause suits like java more: there is more java programmers, and they are more predictable. Genius python hacker can make in a week alone what java team struggled for half a year. You cannot build nice rigid enterprise with people like that.
    Last edited by pmasiar; December 19th, 2006 at 02:21 PM. Reason: typo: s/lover/lower/ :-)

Page 3 of 4 FirstFirst 1234 LastLast

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
  •