|
But here is where my programming endaveours eventually faded out. The two major reasons were Windows and work. While Turbo Pascal evolved it was rather tedious to write programs for Windows. And since Windows became more widely used and most DOS utilities already existed I simply lost interest. Although TurboVision (a 'toolkit' for Pascal to quickly develop a GUI. At first only commandline based but later it also extended to Windows) was nice it was also rather complex and tedious to use. Because my work didn't involve programming I considered it a waste of time. Ofcourse I did look into later developments, for example I had a taste of Powerbuilder, Delphi and Visual Basic. The only thing I liked about Delphi was that it involved Pascal, but that was it. VB was somewhat nice but rather limited for me since I began using OS/2 quite heavily during those days. On OS/2 I learned to appreciate REXX, but never dived into it as deep as I wanted. Funny thing is that during this period Sun started introducing Java, I even attended a few presentations, but for some reason never bothered to look deeper into it. I did appreciate the things I could do with it. At some time I even had "Lotus Notes" completely written in Java (if I recall correctly), and used it quite a lot.
When OS/2 started fading out I began using Linux more intensively and never got any deeper into programming besides writing (sometimes rather complex) shell scripts. During this time I messed about with Python, C, Perl but never got to like anything specific. Ofcourse the reason that I didn't know what to program and the fact it wasn't part of my work also played a large roll.
Things changed dramaticly when I started using Solaris 10 on my servers. It was a 'blast from the past' for me and I simply started all over. During these times of studying and reading I encountered many questions on Solaris forums regarding the combination of Java and Solaris. One of them "Would it make sense to learn Java if you're administrating Solaris?" caught my attention. Sure, Solaris leans on Java but then again, Unix as a whole also leaned on things like Perl. Out of curiosity I started skimming the Java website and picked up a few tutorials to read.
It was then when I was send out for work to install Solaris 10/x86 on a customer server. The box utilized SATA disks and I wasn't very familiar with that bit yet. The initial installation went like a charm, but right after I had setup the disks the installer crashed, end of story. "Exception occured in...". Say what? That looked a little familiar to me, and when paying more attention I managed to decipher that "java.awt*" had something to do with all this. I didn't know Java that well, but recalled having read something about 'awt' being responsible for Graphical based support. Not sure of all this I stayed on the commandline and used fdisk and format to manually lay out the HDs. All went well, so then I knew it wasn't the SATA causing problems. And so I decided to try the installation procedure again, but this time using the commandline. This approach worked like a charm; the moment the installation was done X still had some issues supporting the graphic card but installing the latest patches managed to fix that problem. It was then when I realized that Java might be more interesting for a Solaris system administrator than I expected at first. And so I decided to start a more in depth self-study.
If you know some basics about programming and already grasp the whole idea of Object Oriented Programming then Java is really quite simple, I guess the biggest issue is getting used to the syntax. However, what really sucked me in was the diversity it provided. While Java is an OO language it also allows you to write old fashioned linear software. Ofcourse this isn't very practical with an OO language, but it does give you a good solid basis to build on. For example... Most people will know the 'Hello world' kind of program, almost every language tutorial includes it. So, in Java it would look something like this:
|
public class helloworld { public static void main(String[] args) { System.out.println("Hello world!"); } } |
While this only covers the way you program there is another factor to consider: write once, run everywhere. Though this is a sentence used by Sun to describe one of Java's key features it is true in every aspect. Once you gained some basic understanding of Java it doesn't matter anymore where you wish to use it. Whether you wish to write applications for your computer, your website or even your mobile phone. As long as the target environment supports Java then you have a solid tool to enhance its features through your own ideas. So, for me the earlier "advertisement" would be much better described as learn once, use everywhere, and there is no denying that. Just look at my 'Software' page. I wrote a nice keystore convertor, and its usefull on Windows, Linux, *BSD and even OS/2.
Another major keypoint for me is Javadoc. What do programmers usually hate most? Right, writing documentation. However, sometimes you simply need to keep your code commented so that other programmmers can pick up on it and grasp what it does. So Sun basicly invented a way to maximize the documentation quality with a minimum of effort on the programmer. This is called Javadoc. For example, take a quick peek at the Java API documentation. Just click on a class in the lower left corner, doesn't matter which.
Now, if you scroll down in the main window you'll see that it gives you a summary on 'fields', 'constructors' and 'methods'. This is what I consider the beauty of Java. Because it is object orientated you could compare a 'method' with a small building block which makes up the object called a 'class'. Most methods are somewhat independent of their class. In other words: if you know what arguments they need and, if applicable, what values or objects they return then you know all there is to know about using such a method. And this is exactly what the API documentation is telling you. Remember the 'hello world' program above? What do you think "System.out.println" is? A command? Partly right.. It is basicly a "fully qualified method name". System is the name of the Java class I'm using, out is a field in that class which basicly represents a so called PrintStream. This is where its getting a little complex but a PrintStream is basicly another Java class. One of its methods is, you may have guessed already, println. Want proof? Find the "java.lang" package in the upper left window of the API documentation. After you clicked it you'll see the bottom left window change, it now shows you everything in this package. Scroll down until you find the 'System' class. Click on it and you'll see its description appear in the main window. Scroll down and you'll quickly encounter the 'Field summary' telling you about 'err', 'in' and 'out'. Click 'out' and you get a more verbose description. Notice how it mentions the println methods in the class PrintStream ? And you know what is so good about all this? It was all made using Javadoc.
If I were to document my earlier program using Javadoc it would have looked something like this:
|
/** * This class displays a "Hello world" message on the screen * * The main idea behind this class is to write up a small program as * a quick demo to display what Java and Javadoc can do for you. Its * being used on the catslair.org website. * * @author Lion-O * @see <a href="http://www.catslair.org/">The catslair.org * website</a> * @version 1.0 */ public class helloworld { /** * This is the main method of the program. * * A Java program needs some place to start, and this is it. The * JVM will automaticly start this routine after which we're off * using Java. * * @param args The optional command line parameters used to start * this program. */ public static void main(String[] args) { System.out.println("Hello world!"); } } |
Fortunatly it isn't really hard to learn Java since Sun provides you with everything you might need. A very good place to start is the Java website. To run Java you need a so called JRE; the Java Runtime Environment. But if you wish to develop Java programs you need the so called JDK; a Java Developers Kit. Since Java comes in many forms and ways it might become quite confusing and overwhelming at first but if you focus on the Standard Edition when you're just starting out you should be fine. Sun also has a website devoted to people who are new to Java. Still, now you got the tools but you still need some documentation to get you going. The two websites I used the most are Sun's own Java Tutorial and Bruce Eckel's book Thinking in Java. With those two you can really come a long way and whats even better: you're perfectly welcome to download those books and put them onto your own network. I think that the Java tutorial (together with the API docs) are probably one of the most referenced URL's on my IntraNet :-)
Java covers many things and topics, which isn't surprising if you look at the places where you can use it (from cellphones to PC's) and the available features it offers (from webforms, maybe protected through SSL, to software to control RFID devices). All these things can become quite confusing and because of that Audrey Crane has developed a way for beginners to get a broad overview of the things common in the world of Java. This is the so called Java Technology Concept Map. You really should give this one a try since it gives you a very good idea of the almost limitless options Java has to offer.