LinuxQuestions.org
Help answer threads with 0 replies.
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 01-26-2009, 05:26 AM   #16
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44

Quote:
Originally Posted by General Failure View Post
I dislike flash about as much as I dislike java for one reason: Try using one of them on a slow computer. That's just pain, and that's no good.
word!

in the company I work as dev, we also use Java for our online charting tools (financial market data streaming charts and all that stuff...)

All our java apps on a slow computer or non-multi core machine are a huge huge pita. I am still daily surprised that users actually use these things even though they're often hanging/crashing/loading ages etc...

However run it on a multi-core machine though, and the apps just fly pretty fast though.
 
Old 01-26-2009, 10:07 PM   #17
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
The most difficult Java restriction for me to deal with is the inability to easily link to lower-level code. Really, complex algorithms (for which you have the source code) have no business running on a virtual machine unless the code needs to be isolated from the OS. It really isn't meant for running that sort of code, although it seems that it's backing into that arena. One of the guys in my research group has an O(n^n) algorithm written in Java because he wants it to be portable without recompilation. Honestly, I don't think it's too much to ask to compile that sort of code for the machine you're running it on. It could have been written in C and C++, which would allow for low-level compiler optimizations and direct execution, then the Java front-end could have dealt with it via sockets, but as it is, I'm sure its execution uses 20 times the number of instructions a binary version would.

I'm trying to resist addressing the irony of how the "everything is an object unrestricted by lower-level implementation" paradigm is interrupted by the chosen solutions to problems such as multiple-inheritance and templatized code, and its restriction to implicit references.

For what it's worth, most of the people I know that use Java do so because they learned it in intro to programming classes and don't know how to use anything else, but they back into reasons for why Java is their choice language. Part of this is because Java has so much safety padding that programmers who started with it find languages like C and C++ to be ungraceful, dangerous, and bug-prone.
ta0kira

Last edited by ta0kira; 01-26-2009 at 10:21 PM.
 
Old 01-27-2009, 01:39 AM   #18
burschik
Member
 
Registered: Jul 2008
Posts: 159

Rep: Reputation: 31
Quote:
Originally Posted by ta0kira View Post
For what it's worth, most of the people I know that use Java do so because they learned it in intro to programming classes and don't know how to use anything else, but they back into reasons for why Java is their choice language. Part of this is because Java has so much safety padding that programmers who started with it find languages like C and C++ to be ungraceful, dangerous, and bug-prone.
ta0kira
For what it's worth, I have used at least a dozen different programming languages, and Java is the most recent one I learned. I use it because I find languages like C and C++ to be ungraceful, dangerous, and bug-prone.

Mostly bug-prone.

Last edited by burschik; 01-27-2009 at 01:40 AM. Reason: fix typo
 
Old 01-27-2009, 11:49 AM   #19
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
Quote:
Originally Posted by burschik View Post
For what it's worth, I have used at least a dozen different programming languages, and Java is the most recent one I learned. I use it because I find languages like C and C++ to be ungraceful, dangerous, and bug-prone.

Mostly bug-prone.
Well, it's true, they are. But C/C++ don't get in your way so you can do exactly what you want (therefore dangerous, but only as dangerous as you are), while java most certainly does get in your way (not as dangerous, but less useful and less efficient, etc).

I think java equals a lowering of the bar for programmers. Many like it because they feel a sense of safety, that whatever they program, no matter how sloppily, will still run and not crash the machine ... only the VM. What a sad state programming would come to if java took over, IMO. Python, on the other hand, is more useful than java, it acts more like a glue (using various utilities programmed in C) or accessory (such as programming game logic, not the whole game). Or why not OCaml ? It's probably the most advanced one around, it's efficient, you can test code in the interpreter, compile byte-code, or fully compile to binary.

The only thing left that java might be useful for is learning programming, but I think it's bad at that too, it forces OOP on you. Python is a much better choice here.

So, pretty much java is only useful for java applets in browsers, but even there it crashes plenty and takes FF with it.

Well go ahead and flame me, I'm obviously a fool.
 
Old 01-27-2009, 02:58 PM   #20
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Thumbs down

Quote:
Originally Posted by H_TeXMeX_H View Post

So, pretty much java is only useful for java applets in browsers, but even there it crashes plenty and takes FF with it.

Well go ahead and flame me, I'm obviously a fool.
At first, I believed you were just an ignorant hater. All of your posts are about hate: Hate Ubuntu, hate Java... hate this, hate that. You are without a doubt searching the forums after Java and Ubuntu or Microsoft just to annoy people.

The explanation for your childish attitudes is only one: You are a troll.

And the solution is simple guys: add H_TeXMeX_H to your ignore list. I am doing so. No point in reading his posts.
 
Old 01-28-2009, 05:04 AM   #21
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
If I hade a for example a bank I would try to get all programs in java so the bank could change platform if needed.
 
Old 01-28-2009, 05:08 AM   #22
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
Error messages?

Sorry.

Last edited by kalleanka; 01-28-2009 at 05:11 AM. Reason: wrong thred
 
Old 01-28-2009, 09:15 PM   #23
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by Mega Man X View Post
And the solution is simple guys: add H_TeXMeX_H to your ignore list. I am doing so. No point in reading his posts.
Don't be so dramatic. H_TeXMeX_H rationalized his (her?) opinion, and just because it's strong (and against something specifically addressed by the thread) doesn't invalidate it; previous posts shouldn't come into the picture. If you look at the post, nothing says "I hate Java", and even if H' sought out Java posts to tell others of his concerns, there really isn't anything wrong with that. Although I see gray areas in everything, not everyone else does. And really, calling for an anti-H_TeXMeX_H rally doesn't make you sound any better than you accuse him of being (for one, because your post had no constructive input.) Childish bickering just pisses everyone off.
ta0kira
 
Old 01-29-2009, 01:32 AM   #24
burschik
Member
 
Registered: Jul 2008
Posts: 159

Rep: Reputation: 31
Quote:
Originally Posted by H_TeXMeX_H View Post
Well, it's true, they are. But C/C++ don't get in your way so you can do exactly what you want (therefore dangerous, but only as dangerous as you are), while java most certainly does get in your way (not as dangerous, but less useful and less efficient, etc).
Nor does Java get in my way, since I don't want to mess around with manual memory allocations and strings that are nothing but char arrays. For system programming, C may well be the better choice. But for application programming? Not.

Quote:
I think java equals a lowering of the bar for programmers.
Why would lowering the bar be bad? If you want to make it difficult, why not use assembly or befunge instead of C?

Quote:
Many like it because they feel a sense of safety, that whatever they program, no matter how sloppily, will still run and not crash the machine ... only the VM. What a sad state programming would come to if java took over, IMO.
That's much like arguing against writing, because writing stuff down will make your memory atrophy. Programmers do not magically become better programmers because they have to do their own memory allocations.

Quote:
Python, on the other hand, is more useful than java, it acts more like a glue (using various utilities programmed in C) or accessory (such as programming game logic, not the whole game). Or why not OCaml ? It's probably the most advanced one around, it's efficient, you can test code in the interpreter, compile byte-code, or fully compile to binary.
And let's not forget Lisp.

Quote:
The only thing left that java might be useful for is learning programming, but I think it's bad at that too, it forces OOP on you. Python is a much better choice here.
And Lisp is an even better language for learning programming.

Quote:
So, pretty much java is only useful for java applets in browsers, but even there it crashes plenty and takes FF with it.

Well go ahead and flame me, I'm obviously a fool.
I agree.
 
Old 01-29-2009, 11:36 AM   #25
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
Quote:
Originally Posted by burschik View Post
Nor does Java get in my way, since I don't want to mess around with manual memory allocations and strings that are nothing but char arrays. For system programming, C may well be the better choice. But for application programming? Not.

Why would lowering the bar be bad? If you want to make it difficult, why not use assembly or befunge instead of C?

That's much like arguing against writing, because writing stuff down will make your memory atrophy. Programmers do not magically become better programmers because they have to do their own memory allocations.

And let's not forget Lisp.

And Lisp is an even better language for learning programming.

I agree.
Lowering the bar is bad because it promotes lazy programming, and I'm not saying that you should use C or assembly. C is typically used for systems programming, and if you want OOP and other nice features, I would say use C++, as it's still efficient, portable, etc. Or, there are plenty of other languages, like OCaml, sure Lisp if you can stand it.

Well, I guess this is just something I do, but I actually don't write stuff down when I can, because indeed my memory needs exercise.

Ok, so let me put it this way:

I'm not saying that programming should not be made easier thought the advent of more features than C. Instead, I'm saying that a language should not:

1) do too much for you such that you no longer know what is going on or what it's doing behind the scenes

2) detach you so much from the computer architecture that you neglect any kind of efficiency standards

3) detach you so much from the memory usage concerns that you feel you have unlimited memory at your disposal

As mentioned before java is a PITA on older machines ... because it is not considered to be an efficient language in terms of resource consumption. At least using languages like C/C++ forces you to care about how you use system resources. There are also many libraries available that will help you with these tasks, but still maintain efficiency. I can't say that java will ever be anywhere near as efficient at C, but it will probably grow in popularity because most machines have plenty of resources available ... or if they don't it'll force you to upgrade. I suppose that's why they're doing it. They're pushing java so people will upgrade their machines (maybe I'm just paranoid).

P.S. Don't worry about Mega Man X, we just don't get along, we are too different (to put it in a politically correct way).
 
Old 01-29-2009, 03:25 PM   #26
kidicarus
Member
 
Registered: Aug 2003
Distribution: Debian Sid
Posts: 93

Rep: Reputation: 15
The ISO/ANSI C++ Standard has expanded the C++ library by adding the string class. So, instead of using a character array to hold a string you can use a type string variable (or object). This works very similar to the Sring class in java. Plus, as in Java, you can convert from char arrays and Strings. If anything the C/C++ style is easier to work with, not to mention the syntax is much shorter, easier to read.

Also, far more applications are developed in C/C++ than in Java.

As for learning, what's nice about C++ is that at least you can use traditional "procedural programming" to begin, which can help ease your way into the OOP paradigm. Even the beginning programs in Java are more complicated:

public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}

vs.

#include <iostream>
int main()
{
std::cout << "Hello.\n";
} // return 0; not needed.

In the Java code, you need to understand access modifiers, strings, objects, static methods, the Java liberary, plus interpreters, classpaths, etc. in order to get the code to compile.

In C++ you need to know how it handles input and output, a bit about the preprocessor and namespaces.

The only trolling in here is the "Java developer" spreading FUD and misinformation.
 
Old 01-29-2009, 03:59 PM   #27
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by kidicarus View Post
Even the beginning programs in Java are more complicated:
Once the overhead to being a program plus doing console output is as trivial as either of those, there is no meaning to the comparison. The fact that there were two layers of wrapping boilerplate instead of one is insignificant. It doesn't scale up to twice as many in real programs. It doesn't really increase at all as you scale the project up.

Quote:
In the Java code, you need to understand access modifiers, strings, objects, static methods, the Java liberary, plus interpreters, classpaths, etc. in order to get the code to compile.
What's an "access modifier". It's been a while since I last wrote Java code and I forget a lot, but I don't think I needed to understand all that even when I did write Java code. Using and understanding can be very different. There are things in Java you get away with just using. Before you try to make that a negative for Java, there is FAR more of that in C++.

Quote:
In C++ you need to know how it handles input and output, a bit about the preprocessor and namespaces
What about templates !??

What does that << in your example actually mean? In your simplest program you just used one of the most complex features of C++ that most professional C++ programmers barely begin to understand.

As it happens, you don't need to understand
Code:
std::cout <<
You can write a lot of C++ code just using things like that without understanding them. I happen to work on C++ coding where I need to REALLY understand some of the details including what is going on in that operator<<() you used. But most C++ programmers don't.
 
Old 01-29-2009, 08:38 PM   #28
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Speaking objectively, every language has its limitations, but subjectively, some of the apparent weaknesses of C++ and C are what I like (e.g. ability to shoot yourself in the foot.) The difference with Java is that in order to be portable it has to sever possible connections to binary-linked objects such as shared libraries written in C, C++, lisp, etc. That means original-source transparency isn't possible, at least making it difficult to interact with existing utilities and libraries accessible by other languages. Java is designed to be portable, but over the last decade it seems that Sun has started to acknowledge that its paradigm is too idealized to be useful for as wide a range of application as C and C++ are used with. I don't know the background of why anyone feels that Java should replace C or C++, but you can't escape the fact that C and C++ both have ISO committees and Java doesn't; Java is controlled by a single corporation.

I'm about to take on a massive data-mining project, which I intend to write in a binary-compilable language (I'm open to suggestions, so long as it can be compiled as a binary,) but I'll probably make it a server program and have a user interface with Java so that different OSes can connect to it. I don't have to think twice about programming it in one or more binary-compiled (and linked) languages, but I'd be stupid to try to 1) expect the non-programmer users to access its functionality from the command line, 2) try to create a Windows/Mac/Linux front-end in something that isn't standard on most somewhat-modern computers.
ta0kira

PS Until a Java compiler, JVM, and JRE can be written in Java, it will never push out languages like C and C++.
 
Old 01-30-2009, 01:26 AM   #29
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by kidicarus View Post
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}

vs.

#include <iostream>
int main()
{
std::cout << "Hello.\n";
} // return 0; not needed.

In the Java code, you need to understand access modifiers, strings, objects, static methods, the Java liberary, plus interpreters, classpaths, etc. in order to get the code to compile.


In C++ you need to know how it handles input and output, a bit about the preprocessor and namespaces.
Nope, as jonsfire already mentioned, you also have to know templates, classes, operators, inheritance and STL. It's not as easy as you think. Your example uses all of those - std::cout, for example, is an instance of class derived from template. If you are a newbie and will try to find out how this example works, you will sink in unknown/complex C++ technologies. (Honestly, do you understand how std::basic_string works? Tearing even this class apart will take quite some time). From this point of view Java example will be simpler than C++ example, and C example will be simpler than Java example.

Quote:
Originally Posted by kidicarus View Post
The only trolling in here is the "Java developer" spreading FUD and misinformation.
Don't spread misinformation yourself. You just forgot good portion of very complex C++ features trying to tell how good C++ is.
 
Old 01-30-2009, 02:06 AM   #30
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Quote:
1) do too much for you such that you no longer know what is going on or what it's doing behind the scenes

2) detach you so much from the computer architecture that you neglect any kind of efficiency standards

3) detach you so much from the memory usage concerns that you feel you have unlimited memory at your disposal
And then again:

Quote:
Pop quiz: Which language boasts faster raw allocation performance, the Java language, or C/C++? The answer may surprise you -- allocation in modern JVMs is far faster than the best performing malloc implementations.
Quote:
You don't have to search through too many blogs or Slashdot postings to find confidently worded statements like "Garbage collection will never be as efficient as direct memory management." And, in a way, those statements are right -- dynamic memory management is not as fast -- it's often considerably faster. The malloc/free approach deals with blocks of memory one at a time, whereas the garbage collection approach tends to deal with memory management in large batches, yielding more opportunities for optimization (at the cost of some loss in predictability).
source: IBM. If I have to choose between IBM and you, I won't have to think very long.
full article: http://www.ibm.com/developerworks/ja...-jtp09275.html
 
  


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
Java plugin installed correctly for Firefox but not able to view any java applet tvn Linux - Software 10 04-15-2010 02:13 AM
Ubuntu 7.10 64bit - how to set java path to/redirect java to libjvm.so ? Thane Ubuntu 1 03-25-2008 05:52 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM
Firefox refuses to load Java jnlp files - plugin and java ok Melsync Linux - Software 1 06-25-2006 04:09 PM

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

All times are GMT -5. The time now is 07:17 AM.

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