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 09-28-2006, 06:54 PM   #46
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244

Quote:
Originally Posted by jlliagre
Look closer, there are no pointers in java.
Close. They are just not explicit to the programmer.
 
Old 09-29-2006, 01:38 AM   #47
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
That's indeed a way of describing what object refrences are, but the point is hiding these "pointers" to the programmers prevent them to do the common C/C++ pointer mistakes.

How does Java "abuse pointers" ?
 
Old 09-29-2006, 01:52 AM   #48
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by halfpower
Java seems to be a popular language. I can't seem to figure out what it is being used for.
To hog CPU and use up lots of RAM. Make systems people grumpy
and generally discontent. Java is taking the new paradigm: "if you can't
program well throw more hardware at it" to extremes.


Cheers,
Tink
 
Old 09-29-2006, 03:23 AM   #49
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Disappointing unbalanced opinion from a moderator ...
 
Old 09-29-2006, 07:03 AM   #50
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
Java consume more RAM than C++, but a Java application is not necessarily a memory hog... To be continued
 
Old 09-29-2006, 07:21 AM   #51
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
so I wonder what Java is doing in phones and pdas if its so much slower and memoryhungry? Or do they compile the code to a binary?


I have done som programing in ericssons AXE telephone switch and that was done in pascal.

And I can see that a Java program got less bugs than c and c++. No pointers etc. I do prefer c since the gcc works fantastic and its free and open. And all the source code on the net is a huge help. I always had problems with JVM but that was years ago I used java.

The good thing is that we have a choice not like buying a laptop and you almost always get windows. Like standard oil.
 
Old 09-29-2006, 09:51 AM   #52
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Quote:
Originally Posted by kalleanka
so I wonder what Java is doing in phones and pdas if its so much slower and memoryhungry? Or do they compile the code to a binary?
Nope. It still runs inside a Virtual Machine. If you download J2ME, you can develop your applications (aka MIDlets) on your desktop (Sun's kit comes with a phone emulator), compile and transfer your application to your phone (a .jad file). The ME API is very small, but is very good and even has a Game API ^_^;;

Here is an example of how the phone emulator looks like:
http://www.devx.com/assets/articlefigs/11368.gif

You can also test your midlet in different phone types (with different screens sizes and colors) before deploying it. There is also a few emulators written with the J2ME, as the vNes:

http://www.vampent.com/vnes.htm

Java rocks ^_^;;

Last edited by Mega Man X; 09-29-2006 at 09:57 AM.
 
Old 09-29-2006, 02:03 PM   #53
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by jlliagre
Disappointing unbalanced opinion from a moderator ...
I guess you're entitled to that view just like I am to
mine. The fact that I mod here doesn't mean that I'm
not entitled to a) have an opinion and b) utter it.
And I'll stick with mine. I haven't seen a slim and
performant (non-trivial) java application yet.

And what the big ones do on our servers can best be
described as "sad". Talking about Jboss and other things;
but even reasonably simple Java apps die on us if we don't
set the upper memory limit to 512MB (I guess I could have
done 10 testruns with different (smaller) values [256MB
wasn't big enough], but I didn't want to wait 3 hours for it
to run to completion each time), where the same functionality,
implemented in C, would have done the same thing 4-5 times
faster in 200k. Of course, the development will obviously take
somewhat longer.

And I guess even Perl & Python would have been a better
choice for the task above.


Cheers,
Tink
 
Old 09-29-2006, 03:30 PM   #54
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Perl... ok... I am a Java fan, no doubt about it. I do, however, am very aware of its strengths and weakness. Perl is the very worst language ever made. While I see places where Java won't fit, I can really say that Perl does not fit anywhere. It's ugly, it is hard to maintain and does not work well when more then one programmer has to do the job (which is how most real applications are created anyway) because the code gets messy really quick. If Java is not the answer for everything, Perl certainly is never the answer for anything...
 
Old 09-29-2006, 03:46 PM   #55
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Quote:
C isent portable.
You misunderstand what that means. Portablity doesent have anything to do with a program working on other operating systems. But rather working on other kinds of archtecture.
(i know i probably spelled that wrong)
 
Old 09-29-2006, 10:08 PM   #56
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by tinkster
The fact that I mod here doesn't mean that I'm
not entitled to a) have an opinion and b) utter it.
And I'll stick with mine.
That's certainly your right, but my disappointment wasn't that much about your opinion which of course I respect and understand.
It was more that instead of replying to the open poster, your were just adding a somewhat sterile rant to the list.

The OP is asking "what is java being used for. Is it used outside web development?"

Answering "Java is crap" isn't IMHO helping him. A large number of professional programmers working for big companies are doing it on (generally successful) Java projects, and almost never on web development if that is limited to java applets.

This is a fact that shouldn't be hidden to the OP, regardless of what one's opinion is about java.

Quote:
I haven't seen a slim and performant (non-trivial) java application yet.
Art of Illusion is I believe an example of a reasonably slim, performant and non trivial java application (3D modelling and rendering).

Quote:
And what the big ones do on our servers can best be
described as "sad". Talking about Jboss and other things;
but even reasonably simple Java apps die on us if we don't
set the upper memory limit to 512MB (I guess I could have
done 10 testruns with different (smaller) values [256MB
wasn't big enough], but I didn't want to wait 3 hours for it
to run to completion each time), where the same functionality,
implemented in C, would have done the same thing 4-5 times
faster in 200k. Of course, the development will obviously take
somewhat longer.
I certainly admit a JVM has a bigger footprint that C, however 200KB vs 256MB+ means 100+ times more memory requirement.

My first reaction would be to investigate the web-app for a memory leak and the web-app container for its tuning, not to blame the language.

Quote:
And I guess even Perl & Python would have been a better
choice for the task above.
Java is not meant to replace every programming language in every situation, so that might indeed have been the case for your specific requirements.

I have very few experience with Python. From what I've seen, it looks like a good looking scripting language which complements java with its Jython implementation.

On the other hand, my experience about Perl is that many programs written in this language can just be dropped and rewritten when their authors leave the company. Java reusability and maintability is hugely better.
 
Old 09-30-2006, 08:51 AM   #57
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Java & Perl

Quote:
Originally Posted by Mega Man X
I am a Java fan, no doubt about it. I do, however, am very aware of its strengths and weakness. Perl is the very worst language ever made. While I see places where Java won't fit, I can really say that Perl does not fit anywhere. It's ugly, it is hard to maintain and does not work well when more then one programmer has to do the job (which is how most real applications are created anyway) because the code gets messy really quick. If Java is not the answer for everything, Perl certainly is never the answer for anything...
To my mind, it seems like Perl and Java are almost diametrically opposed to one another. But one interesting thing is that they both have huge user communities that will defend their language to the death, and I'm sure there's more than enough Perl hackers who will say similar things about Java.

The funny thing (if you find that sort of ironic thing funny) is that none of these arguments are correct; languages are rarely judged on technical capability alone. (Not to mention that there is no single set of technical metrics for language aptitude.)

In parting (and this isn't personal, Mega Man X, cuz I think you're a pretty good fellow ), note how many FreeBSD ports require Perl. On my primary machine, with 306 total packages, 126 of them depend on Perl. Obviously, some developers find it suitable for their projects.
 
Old 09-30-2006, 04:14 PM   #58
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Lol this post is outa control anyway guess ill thow in my worth. Jave ehhh its ok i dont see no wrong in it. Some of the apps I see around using it seam to work on even an old 600mhz machine with 300megs of ram. witch should be fine. everyone complaines about memory usage and loading time but what my bigest beef with any programming langueses is the size of the executable when compiled. In that sence I like C over C++, im not sure why C++ makes bigger apps when compiled. but then again assembly makes very small executalbes compared to C. Ive seen a operating system that fits on a floppy with a web browser a GUI interface and a asembly compiler along with some other stuff like a file browser and calculator. all in 1.4m to get this in C you would need much more space and in C++ even more. Java not sure tho cause again you need the JVM and you need the stuff to make the JVM to work so its a trade off i guess. I stick with C learn it and mabye learn python or Java. Perl im gonna stay away from ive herd too many nitemares from that language. and the microsoft stuff i just ignore :P anyway java has a place just like C++ does cause honestly its about eaze of use over system hardware and memory. They are cheep compred to the cost of a programmers time today.
 
Old 10-02-2006, 04:49 PM   #59
mon75
LQ Newbie
 
Registered: Sep 2006
Location: Windsor, Ont, CDN
Distribution: ubuntu
Posts: 14

Rep: Reputation: 0
I just had to get in on this little debate

C is a programmer's old testament to be feared in many ways. From what I can gather around the net every self-respecting programmer knows it. C++ is the new testament, it pretties up and sugar coats C. Together they are god's there is nowhere you can go whithout running into them.
Java is like the king james version of the programming bible there are many versions of said bible but who knows how long they'll be around for.
 
Old 10-02-2006, 08:27 PM   #60
Pauli
Member
 
Registered: Feb 2004
Location: Montreal
Distribution: Gentoo/Debian
Posts: 365

Rep: Reputation: 30
There's one reason I prefer to do java with people than c.

For the simple reason that I have met very few c programmers who use nice variable names. Who don't use fscking ternary operators to make the if on one line to look pretty. Who don't name things obscure and useless crap. Who don't screw around with 50000 loops just to make their program 2 lines shorter.

Pretty code is all good, but not at the expense of readability.
 
  


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
Firefox refuses to load Java jnlp files - plugin and java ok Melsync Linux - Software 1 06-25-2006 04:09 PM
Synaptic Package Manager shows 'java-common' and 'java-gcj-compat' as Installed. swiadek Ubuntu 3 02-12-2006 11:54 AM
JAVA JRE installation to view java applet through browser dipenchaudhary Linux - Software 1 01-23-2006 09:20 AM

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

All times are GMT -5. The time now is 09:34 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