• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

C++ and Java compilers

-D-Cypher

Weaksauce
Joined
Oct 7, 2004
Messages
95
Can someone tell me where to find free C++ and Java compilers/builders. (Whatever I can type up programs and test for errors).

Actually, only one of each is necessary. Please give me your best recommendations.

Also, what is the difference between Java, and Javascript?

Also, if I was to pick a language to learn, would C++ or Java be more beneficial.
 
well, Java is normally compiled using Suns java compiler, which outputs byte code for the Java virtual machine. Its included with the Java SDK. Now for C++, I personally use gcc's g++. There is also a windows version of it that is part of the mingw package, which you can get with Dev-C++. Now, microsoft does give out there compiler and libraries free, just download the free tool set, avalible on there visual c++ site.
oh, and also gcc does have a java compiler, but it doesn't ouput the byte code, but actual binaries, specific to your system. I don't know if they have every thing from the entire java library yet, and I think it would be behind Sun's current version. not only that, but it is no longer portable.

Also, what OS are you using, and are you just getting into programming?
 
Programmers notepad?? i'm not sure if it's a compilier.. but it supposrt a shit laod of languages including C++ and Java..

I've also used Dev C++ from bloodshed.. that's another free one..

i can only code in C++ and assembly.. from what i've heard about java, is that it's slower, meaning it chews more clock cycles.. once you compile java stuff you can run it on linux or windows.. and don't have to recompile for another OS.. someting like that

I've also heard that java kind of cleans house more for you.. like in C++ you have to keep track of some memory when you do stuff like pointers.. where as java takes care of it for you..

not 100 on it.. but that's it....
 
RancidWAnnaRIot said:
Programmers notepad?? i'm not sure if it's a compilier.. but it supposrt a shit laod of languages including C++ and Java..
Well, that would be an editor, but a good one from what I hear
RancidWAnnaRIot said:
i can only code in C++ and assembly.. from what i've heard about java, is that it's slower, meaning it chews more clock cycles.. once you compile java stuff you can run it on linux or windows.. and don't have to recompile for another OS.. someting like that
yea, the main reason Java is slower is the virtual machine is translating bytecode into native instructions.
RancidWAnnaRIot said:
I've also heard that java kind of cleans house more for you.. like in C++ you have to keep track of some memory when you do stuff like pointers.. where as java takes care of it for you..

not 100 on it.. but that's it....
Yea, its called garbage collection. Baiscly every time you use a class in Java, it allocates the memory for you, so does C++ via the new operator. The difference comes in to when you stop using the object. In java, when ever an object is nolonger referenced in any way, the virtual machine will go ahead and deallocate the memory for you. This is different from C++, and most of the other languages where they are compiled natively to the system ( like Ada has the same problem) if you ever remove the pointer to your object, without deleting the object first, the memory stays allocated, but you have no way to deallocate it any more. This what is normally refered too as a memory leak.

I should add that microsofts .net framework added some extra features that adds the automatic garbage collection feature, but it is not standard to the language, so it is specific to microsoft.
 
I am running windows.

I am a freshman in college. In highschool, I took 2 years of C++, and I year of Java. I know that may sound like I should know what I am talking about, but we really only wrote programs modeled after the teacher. I want to learn to write some on my own again.

In C++ I used Borland Turbo C++, and for Java I used Codewarrior.

I have a question, if I wrote a simple program, how would I be able to get it to an exe file, so I don't have to compile it in the compiler every time I run it.

Yeah, I remember my teacher saying that Java cleans up for you. I was kinda thinking about writing games...simple games, and wondering whether java or c++ was better.
 
Well, if you need the speed in the game, C++ can be better for you. As for getting an executable from borland, I suspect when you tell it to build it, it makes one. look in the directory of your project, and I suspect it will be in there some were.
 
netbeans is a free IDE (Integrated Devlopment Enviorment) that has become pretty popular for making java programs. You could go with either one. So no, you don't have it all wrong.
 
Cool, and sorry about this, but could someone link me to the files that the guy above was talking about. He was saying I could go on microsofts website and download the libraries and other stuff.

I'm really a beginner, I don't even know what this stuff is for, I'm just following directions.
 
For Java, you only need the JDK. Netbeans IDE is for writing Java apps, but Eclipse is better IMO (see below).

The two choices you can make are Java 1.4.2 and Java 1.5. Java 1.5 is the newest and introduces features such as autoboxing of primitives and Java generics (supposed to be like C++ templates, but they're not at that level), and typesafe enumerations. I think I remember reading that Java 1.5 breaks something present in 1.4.2, something about type safety, but I forget, so don't take my word for it.

The advantage of Java is that it runs through a Java Virtual Machine, so you can pretty much write once, run anywhere. GCJ and IBM's Jikes can compile the Java code to a native binary, but I think GCJ still has some ways to go (example: The Eclipse IDE has been compiled in GCJ, but the source code had to modified just a little, so it'd seem that GCJ can't just compile every piece of source). I'm not sure about IBM, but they always seem to be a generation ahead in terms of Java, and Jikes is supposed to be a faster compiler.

As for C++, I like VC++ 2003's C++ compiler from Microsoft and GCC's c++ compiler (3.3.x branch, haven't tried the 3.4 branch). You can get the VC++ compiler from Microsoft for free, and there's a Windows port of GCC (see www.mingw.org).

Now for editors...

I generally code in SciTE or Vim. For Java, Eclipse is a pretty good editor, it's free to download from www.eclipse.org. For C++ you could always look at Dev-C++; I haven't used it myself, but it's there.

For a personal take, I use C/C++ more than Java, since I program on the low-level/systems side, where speed matters, and I'm more used to C/C++ since I've used them for a longer time. Most professional/commercial games are C/C++ these days, but I have heard of hobby games written in Java and such. The only times I've really utilized Java are in my higher level CS Software Engineering classes.

As for Java and Javascript. They are completely different languages. Javascript is a language for the web and has no relationship to Java - Netscape called Javascript Javascript to ride the wave of buzz and hyper surrounding Java in the early 90s. Java can be used for full applications, Javascript can not.
 
thanks alot bro,

now i have a question, when i create a new project, i select windows application

then a new project forms with a main.cpp file in it. Do I just leave that there and then start writing to another file (my program), what does the main.cpp do?
 
The main.cpp is the stub file the program makes for your project and where it expects you to start the program (with the main routine and such).
 
well, not really. the basic stuff for the winmain method is in there, but your going to need to add alot to it, and so on. I might suggest just doing console projects untill you really need to get into making windows programs. Thats me though, and most of my programming I do on Linux, not Windows. You might be able to find some more programming specific sites with tutorials to refresh you on the basics, and maybe some that have windows tutorials.
 
Thanks guys, I really appreciate this.

HardOCP really does have the best forum members on the net.
 
Just fyi, Eclipse cannot be used with Java 1.5 (or 5.0....whatever you want to call it). If you plan on using Eclipse for the java programming, then you will have to download the 1.4.2 SDK instead. They don't plan on having a stable version for 1.5 until March 2005 IIRC.

Being that you are a beginner, NetBeans is a good IDE to work with, and for your purposes, is just fine. Eclipse is somewhat better, but because it doesn't play well with 1.5 (completely) quite yet, I would advice against it. There are just too many good things that came out with 1.5 that is just stupid not to use (auto-(un)boxing, generics, etc.). I would just try to get some simple programs going with NetBeans, and if you have any problems, it may be good to check out the forums at java.sun.com to see if there are others that have similar problems, etc.
 
Back
Top