LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2011, 12:02 PM   #1
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Post What do you think of the Java programming language?


What are your views regarding the Java programming language? Things like:-
  • Performance
  • Oracle Takeover
  • Features
  • Comparisons to Other Porgramming Languages
  • Job Market
  • Cross-Platform Viability
  • Usage for Desktop Applications
  • Usage on Mobile Platforms (i.e. Android)
  • Usage on Websites (vs. alternatives)
  • Other General Thoughts

I've started a book on Java, and I have pretty much chosen it to be the first language I learn (though I have fumbled around in BASH quite a bit and a tiny bit of C++), so I would like to know what other programmers think, especially programmers using Linux.

Discuss.

Last edited by lupusarcanus; 03-02-2011 at 12:04 PM.
 
Old 03-02-2011, 01:12 PM   #2
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
Performance: HORRIBLE. Worst performance of any language I've ever supported, and I've supported a lot.
Comparisons to Other Programming Languages: Compare on what basis?
Job Market: Excellent, because...
Cross-Platform Viability: Pretty much its only reason for continued existence, it is now the integration language of choice, and integrating disparate systems is big business right now.
Usage for Desktop Applications: Oh, dear gods, no. If you're going to run on a desktop, compile and run native on the physical machine, not in a JVM.
 
Old 03-02-2011, 01:56 PM   #3
crosstalk
Member
 
Registered: Jul 2010
Distribution: Gentoo, Debian, Mint, Xubuntu
Posts: 150

Rep: Reputation: 35
Performance:
I don't know -- it depends on the VM. If you need high performance, however, you shouldn't be using Java. Real-time systems also shouldn't use it.

Also, it uses a lot of memory and takes a long time to start up.

Otherwise it's decent (until you do trig on x86...)

Oracle Takeover:
No opinion.

Features:
I like how it has enough libraries to do almost anything (that isn't low-level hardware... which shouldn't be dealt with in Java anyway), and has them standardized (unlike C/C++ (I'm not referring to libc here, but all the other libraries as well)).

Cross-Platform Viability:
Many end-user applications would benefit greatly for this. This is by far Java's strongest point.

Usage for Desktop Applications:
Very useful, except for memory usage and startup time. However, due to the startup time, I prefer to use native applications.

Usage on Websites (vs. alternatives):
What alternatives are there that are widely used (i.e. might be found on someone's computer)?

Other General Thoughts:
I find Java is obsessively object-oriented, to the point that it hinders code development. It is also really easy to end up with spaghetti-and-meatballs code, unless you are very careful to plan your code out well.

On the other hand, my C/C++ and other code improved after using Java due to the time I have to spend designing the various roles of my classes.

It is useful for something that should be cross-platform. In particular, I've used it as a graphical frontend to an embedded (or server, if you wish) application with success.

Good luck learning to program.
 
Old 03-02-2011, 02:04 PM   #4
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022

Original Poster
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by SL00b View Post
Performance: HORRIBLE. Worst performance of any language I've ever supported, and I've supported a lot.
Hmm... does your opinion change at all after reading this?

Quote:
Originally Posted by SL00b View Post
Comparisons to Other Programming Languages: Compare on what basis?
Quote:
Originally Posted by lupusarcanus View Post
  • Performance
  • Features
  • Job Market
  • Cross-Platform Viability
  • Usage for Desktop Applications
Quote:
Originally Posted by SL00b View Post
Usage for Desktop Applications: Oh, dear gods, no. If you're going to run on a desktop, compile and run native on the physical machine, not in a JVM.
What language would you recommend for cross-platform desktop applications?
 
Old 03-02-2011, 02:25 PM   #5
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022

Original Poster
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by crosstalk View Post
Performance:
I don't know -- it depends on the VM. If you need high performance, however, you shouldn't be using Java. Real-time systems also shouldn't use it.

Also, it uses a lot of memory and takes a long time to start up.

Otherwise it's decent (until you do trig on x86...)
How widely do the virtual machines differ? Don't most Windows and Linux users use the standard VM from the Java website?

Quote:
Originally Posted by crosstalk View Post
Features:
I like how it has enough libraries to do almost anything (that isn't low-level hardware... which shouldn't be dealt with in Java anyway), and has them standardized (unlike C/C++ (I'm not referring to libc here, but all the other libraries as well)).
Why? To what extent are you talking about when you use the term 'low-level'?

It seems Java has done well taking advantage of the extra features on the Android platform, for instance the accelerometer, GPS, touch screen, mic/speakers et cetera.

Quote:
Originally Posted by crosstalk View Post
Features:
I like how it has enough libraries to do almost anything (that isn't low-level hardware... which shouldn't be dealt with in Java anyway), and has them standardized (unlike C/C++ (I'm not referring to libc here, but all the other libraries as well)).
This is a significant deterrent for me. (with regard to C/C++)

Quote:
Originally Posted by crosstalk View Post
Usage for Desktop Applications:
Very useful, except for memory usage and startup time. However, due to the startup time, I prefer to use native applications.
Do you think it is fast enough to run demanding applications speedily? Frequently? Efficiently? On a wide range of hardware?

Quote:
Originally Posted by crosstalk View Post
Usage on Websites (vs. alternatives):
What alternatives are there that are widely used (i.e. might be found on someone's computer)?
Flash, potentially Silverlight.

Quote:
Originally Posted by crosstalk View Post
Other General Thoughts:
I find Java is obsessively object-oriented, to the point that it hinders code development. It is also really easy to end up with spaghetti-and-meatballs code, unless you are very careful to plan your code out well.
Could you expand on this? I'm not sure what you mean.

Quote:
Originally Posted by crosstalk View Post
Good luck learning to program.
Thanks.

I haven't gotten too far into yet; but I do know arrays, loops, variables, conditional tests, and most of the basic syntax.

Last edited by lupusarcanus; 03-02-2011 at 02:31 PM.
 
Old 03-02-2011, 03:43 PM   #6
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by lupusarcanus View Post
Hmm... does your opinion change at all after reading this?
No, not really. I see a lot of comparisons between Java and C, but it's helpful to understand that I've never supported C, and Java still comes up short against it in some of those benchmarks, so that's hardly convincing. I also noted no mention of a JVM's voracious appetite for memory consumption, which can have a significant effect on overall system performance. And your source completely ignores one important and unavoidable fact... a JVM represents an abstraction layer between program calls and machine code, and anytime you add a middle man, you increase CPU overhead. Furthermore, the overall idea of the article is that Java is approaching or perhaps surpassing C performance, but that was in 2003. Let's see the follow-up numbers.

It'd probably help to understand that I'm coming at it from a systems angle instead of a programmer or user angle, so I'm the guy who is suffering during all that JIT compilation. Once the system has been up and running, some users have exercised it, it's been through a couple of garbage collection cycles, and the cache and the modules have been tuned by the JVM, it might perform well, but it's fairly painful getting up to that point.

Quote:
Originally Posted by lupusarcanus View Post
What language would you recommend for cross-platform desktop applications?
Um... anything else.

The benefits of Java code are more likely to be realized in a high-traffic server environment, and the main penalties (long startup/shutdown, high memory overhead) are unlikely to be acceptable to a desktop user when compared to a pre-compiled equivalent in pretty much any other language.
 
Old 03-02-2011, 05:04 PM   #7
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
I've completed a few small projects in Java, including a game I wrote for college credits. I'm far from being an expert though, so I don't know how much I can add to what's already been said. Here goes anyway.
  • Performance: Not bad for what it is, but could always wish for faster.
  • Oracle Takeover: No opinion.
  • Features: It had everything I needed for high level programming, and I barely scratched the surface of what exists. I liked how well documented the language and classes are, with everything I could possibly want available on the web site and downloadable reference.
  • Comparisons to Other Porgramming Languages: Java will never replace C, assembly, Python, or even C++. All those languages have their place. Lately all my projects are in Bash, but if I were working on something large and ambitious I'd certainly consider Java or C.
  • Job Market: I'm not really the one to ask, but certainly the more languages you can learn the better your prospects.
  • Cross-Platform Viability: Java is a great choice. For example my own Java programs ran on both Kubuntu and Windows with little or no changes.
  • Usage for Desktop Applications: Java is certainly capable of producing useful and worthwhile desktop applications. I've used a few, and would not shy away from writing my own. To be honest though one really should consider native programming, especially when performance is a priority.
  • Usage on Mobile Platforms (i.e. Android): No opinion.
  • Usage on Websites (vs. alternatives): I've seen a lot more growth on the web in Flash and Javascript than anything else. Sometimes I think it would be better if Java saw more use in web based applications. It is certainly as capable as Flash in that regard.
  • Other General Thoughts: Java is probably the best language for learning OO programming. It is the only OO language I've ever successfully completed a meaningful project in. I'd recommend it over C++ for that reason alone. (Not bashing C++, but I've never completed anything I started with it.)

Last edited by Telengard; 03-02-2011 at 05:11 PM. Reason: remove useless quote
 
Old 03-02-2011, 05:57 PM   #8
crosstalk
Member
 
Registered: Jul 2010
Distribution: Gentoo, Debian, Mint, Xubuntu
Posts: 150

Rep: Reputation: 35
Quote:
Originally Posted by lupusarcanus View Post
How widely do the virtual machines differ? Don't most Windows and Linux users use the standard VM from the Java website?
That is probably true -- and that virtual machine has great performance (it is about the best you can get out of something that isn't natively compiled). Others, like embedded virtual machines, don't do JIT compilation or optimization -- they just run it, at a much slower speed (if you only care about desktop, then Java is pretty fast).

Quote:
Why? To what extent are you talking about when you use the term 'low-level'?

It seems Java has done well taking advantage of the extra features on the Android platform, for instance the accelerometer, GPS, touch screen, mic/speakers et cetera.
But I don't suspect that those devices were interfaced with directly in Java -- a native library had to have been built (even if the support is in the kernel, exposed as a device file) before the Java interface could be created.

Quote:
Do you think it is fast enough to run demanding applications speedily? Frequently? Efficiently? On a wide range of hardware?
Java is not designed for high performance computing. Its performance is lower than that of C++. This improves if the process is run for a long time (such as on a server), with a JIT virtual machine (and can eventually exceed that of a poorly-).

The startup, as has been mentioned before, is extremely slow, however.

Quote:
Flash, potentially Silverlight.
I have never used the Flash development environment, but, as a client-side user of Flash, I find that it is of very poor quality. I can't comment on Silverlight. Java is the best I know of for this type of interactive web software development.

Quote:
Could you expand on this? I'm not sure what you mean.
I'm used to being able to start on a project, and after a little bit of thinking, write the code and have it turn out well. However, Java forces you to separate out objects for many things, which, if they are all closely linked, I would otherwise not have split up. For my first Java project, I had:
Main.java
plot.java
RecvThread.java--depended on RoboImg, plot (both supplied by Main after initialization)
robogui.java--depended on SendThread, RecvThread (both supplied by Main after initialization)
RoboImg.java
SendThread.java
UDPRecv.java--relied on an indicator on robogui, which it got by going through Main.

It just ended up being a mess (in code).

Also, the high level of object orientation causes otherwise single-line code to involve the creation of a dedicated object, such as a BufferedReader or BufferedWriter.
 
Old 03-03-2011, 06:37 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
* Performance - bad
* Oracle Takeover - bad
* Features - it has many features as you probably already know
* Comparisons to Other Programming Languages - bad
http://shootout.alioth.debian.org/u3...xint&lang2=gcc
* Job Market - hard to say, because I don't know of many professional apps written in java, and employers often look for C/C++ or others.
* Cross-Platform Viability - like crosstalk says, one of java's few strong points, except for the fact that just a little while ago it didn't run properly on 64-bit.
* Usage for Desktop Applications - rare, and quality is not on par with other programs. The only good desktop app written in java is probably Vuze/Azureus, and maybe minecraft.
* Usage on Mobile Platforms (i.e. Android) - I dunno.
* Usage on Websites (vs. alternatives) - It's actually quite rare, even tho you can do a lot with it. Like Telengard mentions, flash and JS have overtaken java since long.
* Other General Thoughts - There is no real reason for java to exist, and there is no reason for it to be like C. If you want to use it as a first language, go ahead, but I don't see any reason for it. It's not as easy as it should be, nor as useful as it could be ... it's mostly useless.
 
Old 03-03-2011, 08:32 AM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by H_TeXMeX_H View Post
The only good desktop app written in java is probably Vuze/Azureus, and maybe minecraft.
I'd add Eclipse, Netbeans, Limewire, Frostwire and HJSplit.

Also:

Quote:
Usage on Websites (vs. alternatives)
Dead if we're talking about applets written in Sun Java. An emerging and very cool technology if we're talking about Google Web Toolkit.

Last edited by dugan; 03-03-2011 at 08:53 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I learn to start Game Programming In Java (Or any language) AustinMarton Programming 5 06-10-2008 07:00 AM
Editor for Java programming language. ICO Linux - Software 11 02-03-2004 07:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration