Main.SideBar (edit)
|
Main /
ACompleteDiversionA complete diversion (in theory there is no difference between theory and practice) In the previous section we looked a basic program. But how do we get this work? Like the recipe for making tea given in the previous section it is easy to discuss the theory but to make tea we need a kettle (or some other means of heating water), a water supply, a supply of tea bags and milk … The practicalities of doing a job are very often much more complicated than the instructions would suggest. Like making tea, there are a large number of ways in which we can write the code for our program, save it to a file, compile the file and then run it. The code can be written in any text editor (such as notepad, vi, emacs) and saved to a file - Note that word-processing applications such as Microsoft Word are not ideal because they do not normally store files as simple text (ascii) format, and may insert special formatting characters which the compiler won’t like. The compiler and runtime environment for Java is provided for free by Sun (http://java.sun.com) so we could down load this and, having written our program, run it through the compiler and execute the result. Again this doesn’t sound too bad but the actual practice is a bit trickier, especially if you are new to this. Over the years (computer programming languages have been around for about 50 years) programmers have realised that they needed some power tools to make the job easier, rather than using a collection of hand tools. The main tool used for programming is given the rather grandiose name Integrated Development Environment or IDE for short. IDEs normally provide an editor for writing the code, a compiler for compiling the code (or in the case of Java, have the Sun Java compiler built in) and have a debugger – which allows us to see how the code actually executes. Fortunately for us, a number of very good Java IDEs are freely available. For this tutorial I am going to use the Eclipse IDE and as a way of getting started I suggest EasyEclipse? (http://www.easyeclipse.org – confusingly there are a number of different “flavours” of eclipse – they are basically the same but have different sets of features packaged with them). Other free IDEs are Sun NetBeans? and Oracle JDeveloper (google for them if interested). So download and install your IDE of choice. |