ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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.
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.
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.
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 ^_^;;
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:
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.
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...
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)
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.