• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

what is java good for?

Semidevil

Diamond Member
Being a beginner programmer, I have no idea what java is good for. Can someone explain to me the usefulness of java, and what it can do.

So far, if I want to run a program, I would need to write the code, and go to Dos, and do the javac <program name>, and java <program name>, in order to run it. Other than that, I would need to make sure that I have java installed.

So basicaly, the programs that I write are mainly for me, and if I want to let someone else try it, I would need to make sure their java enviornment is set.

So what is java good for? Lets say I write a program that I"m really proud of, and I want to share with friends. Is their a way to make my program into an *.exe file or something, so *anybody* would be able to use it?

Also, The school gave me Visual.net 2002....can that program do anything??
 
First off, almost everyone has a java VM installed. If you knew what you were doing, you'd realize you can build .jar files that will launch jsut by double clicking on them, and without opening up a DOS prompt 😉. You also only have to run javac (the Java Compiler) once. After your application is compiled, you can run it as many times as you want.

I don't know of any way to compile java bytecode to a windows .exe, but that hardly lets *anybody* run it. Java jar files work on windows, Mac OS, Linux, and Solaris. Windows .exe files work on windows.... that's it.

Why would you want to use java? Well, making GUI's in java is extremely easy. It takes about an hour to understand it. Java is cross platform. You can make a java program, compile it once, and run it on multiple operating systems.

Visual Studio.net does a lot. Most of which I don't know, but it inclues all of Microsoft's compilers and development environments.

Here's a .jar file I wrote if you want to see how they work.
 
There is an ability to wrap a java program into a service so that it is started automatically everytime a machine is started. Last time I tried to do it (a couple of years ago), the code I found on the net to do this was \buggy and unstable. You can probably find better stuff now though.

Although all of what notfred said is true, I think the bread and butter of java is its servlet and jsp engine. It is very easy to write complex webpages with full RDBMS interaction with this model. Combine that with JDBC and you can write an internet application that connects to almost any database. One of my applications has been run against Oracle, SQL Server, Informix and AS400/DB2 with little or no changes to the code.

The final real strength java brings to the table is a combination of its Javadocs and the amount of industry support it has. Just this past week, I was able to write an application that does fairly complex stuff in IBM's Content Manager using just the IBM API, the javadocs and the provided samples. Without the Javadocs, I would have had to open up the java files (most likely the class files) and had to do random searches to try and find the desired methods. It would have taken me much longer than a week. Out of interest, IBM provided a C++ API and an EJB API in addition to the straight java one.

Also out of interest, I have never used Java's portability strength. I find that an application is typically developed for a platform and will always run there. However, it is nice to be able to develop the same way regardless of the underlying platform. I have done development on Windows, Solaris and Red Hat linux. I don't remember having to do any differently for any of the platforms (at least related to Java).
 
most seasoned programmers dont like jave, although i never coded in it. there are some compilers for MAC OS that let you do really easy GUI's in C++. i think the big disadvantage to java is teh lack of structure and bugginess, but that is a guess, of course basic seems to be returning via VB and VB.net, you can make nice GUIs there too
 
Java is cross platform. You can make a java program, compile it once, and run it on multiple operating systems.

This is Java's greatest advantage, but it is also it's greatest disadvantage. In an effort to give Java programs the same look and feel on all operating systems, there are few OS-specific optimizations for GUI components in Java. This means that a Java GUI app should look the same on Windows as it does on a UNIX box, but it also means that a Java app will not run as fast as native GUI code (written in, say, C++).

Java is also a managed language, leaving a lot of the "dirty work" of C++ programming (pointers, memory management, etc.) up to the JVM so the programmer doesn't need to worry about it. Many programmers dislike this lack of control (for the same reason they dislike VB) because it limits the amount of code optimization you can do.

That said, Java is easy learn, has some great tutorials and documentation freely available, is cross-platform and is a great introduction to object-oriented programming.
 
Besides what everyone else has said (which is all true) java is great to learn on because its a toned-down C++ basically. It is very easy to jump to C++ after working with Java (I did it). That being said, you can package java files into .exes using programs you can google for.
 
Originally posted by: AEB
most seasoned programmers dont like jave, although i never coded in it. there are some compilers for MAC OS that let you do really easy GUI's in C++. i think the big disadvantage to java is teh lack of structure and bugginess, but that is a guess, of course basic seems to be returning via VB and VB.net, you can make nice GUIs there too
You have my vote for worst programming-related post of 2003.
 
Java was used more, before Macromedia Flash became as big as it is now, it's pretty much used for applets, or programs that need ta run inside IE.
 
Originally posted by: manly
Originally posted by: AEB
most seasoned programmers dont like jave, although i never coded in it. there are some compilers for MAC OS that let you do really easy GUI's in C++. i think the big disadvantage to java is teh lack of structure and bugginess, but that is a guess, of course basic seems to be returning via VB and VB.net, you can make nice GUIs there too
You have my vote for worst programming-related post of 2003.

I concur.
 
Originally posted by: Descartes
Originally posted by: manly
Originally posted by: AEB
most seasoned programmers dont like jave, although i never coded in it. there are some compilers for MAC OS that let you do really easy GUI's in C++. i think the big disadvantage to java is teh lack of structure and bugginess, but that is a guess, of course basic seems to be returning via VB and VB.net, you can make nice GUIs there too
You have my vote for worst programming-related post of 2003.

I concur.

Yep. Just wondering, AEB, how do you know about java's lack of structure and bugginess if you have never coded in it? What have you read or heard to make that suggestion? No offence intended.
 
The professor that started teh CS depertment at UAF ( the accredited CS university which i attend) said he didnt care for it, if my post seemed to strong i write that way to keep it concise i meant no offense to anyone who programs in JAva, i in no way meant to knock it, before i tried it. And although i do hold his opinion highly, i would try it first before makeing my own descision, i was just trying to relay opinions of others for information purposes. I am not a code expert and did not mean to come off as one. by ty for the votes do i win something?
 
Originally posted by: AEB
most seasoned programmers dont like jave, although i never coded in it. there are some compilers for MAC OS that let you do really easy GUI's in C++. i think the big disadvantage to java is teh lack of structure and bugginess, but that is a guess, of course basic seems to be returning via VB and VB.net, you can make nice GUIs there too

Actually java doesn't lack structure at all. The language itself is quite elegant. Most of the implementations out there just suck....

The 2 biggest things java compiler developers could do to enhance the language:

1) Do away with garbage collection. By default, destructors should be run in a deterministic fashion, meaning as soon as the reference count hits zero, the object should be gone. My understanding is that the primary reason for choosing garbage collection instead is to catch disjointed sets of objects that are no longer used, where the reference count of 2 objects is left at 1 because they still hold a reference to each other, but neither one is really still in use.

Sure, this is a potential source for a memory leak. Its also bad programming practice to have circular dependencies like that. If a programmer is using those circular dependencies, they sure as hell should know it, and should manage the removal of one objects dependence on the other so they can go away themselves. By having a garbage collector eliminate them, there is a chance it can pick the wrong order and one object will try to access the other and blow up during its destruction.

Also, since you never know when garbage collection is going to kick in, you never know when the CPU will get pegged from it and performance will crawl for a bit.

2) At least have the option of compiling to .EXE instead of to .class/.jar for performance and/or for the option of making API (DLL) calls. The option to compile to .exe does exist in some environments such as Symantec Java Cafe, but it should be a lot more widespread/better implemented.
 
ive only done C++ is java Object Oriented like C++ is? and ty for teh cookie jet... i wasnt trying to be a know it all honest
 
Originally posted by: AEB
ive only done C++ is java Object Oriented like C++ is? and ty for teh cookie jet... i wasnt trying to be a know it all honest

I know, your opinion differed from mine and I wondered where you got it from. It's cool! 😎 I don't have a strong opinion about java anyway, even though it is the language I've programmed the most with.
 
Originally posted by: wetcat007
Java was used more, before Macromedia Flash became as big as it is now, it's pretty much used for applets, or programs that need ta run inside IE.
This made my day. 🙂 Unfortunately, the big wigs don't go for Flash technology because they don't know what it's capable of just yet. I think Macromedia should've named it something else.

But anyway, it's just as true... all you need is a tiny plugin and the same created SWF runs across all platforms. Development/code time - Flash wins hands down.
 
Originally posted by: BingBongWongFooey
Erm, I don't think the major market for java is browser applets, it's things like jboss
Judging from the replies in this thread, unfortunately a lot of users still haven't forgotten the hype of Java applets when they first appeared in Netscape Navigator 2.0.

The hype of client-side Java never really materialized, but the platform was very successfully retargeted for server-side development, where it arguably leads among commercial players. Garet Jax alluded to this in mentioning JSP/servlets, which is undoubtedly one of the stronger, focused APIs in J2EE.

IMO, Java's pervasive portability (not just basic source or binary, but really at standard API interfaces) is a big win for server-side development. Countless shops develop on commodity Intel PCs (Windows or Linux) and deploy onto heterogenous servers, for example Solaris boxes.
 
I am still researching about it, but there is a certain edition of Java called J2ME (Java 2 Micro Edition) that is used for cell phones and PDAs. I don't know how much it is being used, but I am interested enough to learn about it while still learning the standard edition (J2SE).
 
java is so much of an object oriented programming language, that it's not even funny.

java is fairly useless, imo, in practical matters. the main goal of java is portability, but the VMs that exist are so screwed up, that the cost of performance is too great. packaging to exe pretty much limits it to x86 applications, which makes portability non-existent. there are few programs that require the need for portability. and for those that do, they already exist on those platforms. <i am half asleep, this paragraph may not make sense>

anyway, basically, java is no real replacement for c++ in the real world.
 
Originally posted by: Mday
java is so much of an object oriented programming language, that it's not even funny.

java is fairly useless, imo, in practical matters. the main goal of java is portability, but the VMs that exist are so screwed up, that the cost of performance is too great. packaging to exe pretty much limits it to x86 applications, which makes portability non-existent. there are few programs that require the need for portability. and for those that do, they already exist on those platforms. <i am half asleep, this paragraph may not make sense>

anyway, basically, java is no real replacement for c++ in the real world.

Perhaps you should tell the unfathomable number of enterprises that implemented their business software in Java?

People stopped the "why Java?" many, many years ago when people started building high-quality, scalable, productive systems. Java is not necessarily a platform that end-users see as valuable, but it's almost certain that at least part of the infrastructure, or the infrastructure of business you patronize, were built on Java.

So many good ideas came from the Java world it's beyond laughable to question its value.
 
well anyway back to the origional post, i think the most importatn thing when programming is to learn the concepts, also the good and bad programming practices, because syntax is something you can learn or look up. ideas are the most valuable IMO
 
Back
Top