Outdoors, Green Living, Homesteading, Sustainable living, Green Building

The Java Programming Language

WANTED! Comments. Not wanted! Compliments. If you want your comment to be accepted first you must not be a spammer that WordPress recognizes and second you need to comment specifically on some of the article’s specific material or facts.

The Survival Pod Cast
Off Grid Net

What do you think of when you think of programming languages? Software right? Software is a set of instructions which the computer executes in, hopefully, logical sequences. Programming languages define and provide those instructions.

The base software on any machine is the Machine’s own Language known as ML(Machine Language) or Assembly. I won’t go into details here except to say that this is very cryptic to say the least. Each machine has its unique instruction set. Registers and Ram store data. There are very basic binary math functions. Memory functions. Different types of memory addressing etc. On windows DOS DEBUG command can give you some examples of ML by displaying it from ram directly.

In the 1960’s programmers saw a need to come up with a more generic language which would make programs more portable across machines. They came up with a language called C. Yes. C was meant to be a cross hardware portable language so that you only had to make minor adjustments to the source code to get the same program to run on one machine or another. C is cryptic but not nearly as cryptic as machine language. C is one of what is called a Von Neumann language. I won’t go into details but other Von Neumann languages might be BASIC, Pascal etc. Statements, branching, loops, subroutines and functions is what I think of when I think of a Von Neumann language . I’m assuming the reader knows enough about programming that I don’t have to explain statements, branching, loops etc.

Software execution may appear to the user in different ways on different levels. Software does not have to interface with a user at all for example. It can run silently in the “background”. However the user may experience some good indirect benefit hopefully (other than malware, spyware and viruses). This type is called Daemon software. Can also be called TSR, Drivers or background processes.

The first software was most noticeable on what was called a text console. Text meaning alphabet and symbols were displayed in one color with a different background color. White, amber and green were the first text colors with black background. Text was arranged in perfectly spaced rows and columns. And then we had the printer whereby text was spaced in a very similar fashion with black text on white paper or green/white paper. The graphics screen was another mode where the screen was divided into rows and columns of pixels. Later we added color to the scene, first 4 colors, then 16, then 256, then 1000’s and then Millions and so on. So to get to the point software first interfaced with humans as “output”. And a program basically performed this sequence. “Input”, “Process”, “Output”. We called these programs “console applications” or “terminal applications”

As computers have developed or advanced over the years the types of manifestations of computer software have increased significantly. I doubt I can possibly cover all of them. I will talk about some of the types related to Java programming. From the Console we added a pointing device(mouse) and the Graphical user interface, along with multitasking. We call this kind of software GUI Applications or Desk Top Applications.

A very exciting new type of software has been the Web Application. Web sites, and web development. This is software which runs on the web server. The user experiences this software in the form of web pages and files sent to the web browser. And some software runs on the web page or in the web browser as well.

I have been progressing towards telling you about the C++ programming language. This is another Von Neumann language and it is an extension of the C language. This language most notably adds what is called OOP(Object oriented programming) to the C language. OOP most notably combines data and subroutines into a package called an object. It can be thought of as a way to group and reference data and logic which pertain to one another. Its literally a program within a program or software within software.

This finally brings us to the Java Programming language which was meant like C to be portable, unlike C it is meant to be 100% cross platform(machine) portable. This means you do not have to change the source code at all or recompile and Java will run on any machine. Though there is a catch. The machine must have what is called a Virtual Machine and in this case a Java Virtual Machine. A Java virtual machine executes a generic machine code called “bytecode”. By execute I mean it “interprets bytecode”. So Java is first compiled to bytecode. Java like C++ is also an OOP language. In Java however everything is an Object and all things begin with Objects. All things are built upon Objects.

For those of you who don’t know what compiled means I will explain a bit. The first languages other than assembly were not compiled. They were what is called “interpreted”. Meaning the program steps are read as text commands each and every time the program was run. This text is known as source code or scripts. Software can be made to run more efficiently if it is converted from this source or scripts into straight binary machine code. I’ve heard this referred to as “running the application on the metal”. I can’t possibly go into why this is more efficient except to say that it removes a lot of decision making and branching from the execution process. Is this excess execution speed necessary? Maybe and maybe not. Faster is always better right? Maybe its always better but its not always necessary.

Java therefore can be thought of as being a hybrid between interpreted and compiled languages. By the way compilers have been written for many interpreted languages. And in fact there is an attempt to write a Java Interpreter. Java can also be completely compiled to the native platform but this defeats the purpose of Java and system independence. I guess the advantage of the interpreted langauge is that you don’t have this compilation step. An advantage of fully compiled to the metal software is that it doesn’t need the interpreter to be installed to run. So what we see here is pro’s and con’s for each type of software execution. Java must be compiled and it must have an interpreter. So we loose both of those typical advantages. However we gain the advantage of 100% Cross Platform portability. Yes I can write a Java program and without change it will run on a Macintosh, a IBM PC or clone. It will run on different operating systems without change as well, OS X, Linux, Unix, Windows etc. It will run without change on any machine and operating system which has had a Java Virtual Machine created specifically for that machine and operating system. It should run on cell phones for example but thats another story. Like I say, Pro’s and Con’s.

Since Java is a generic Machine it is what is known as a “Platform” for software. An operating system for example is a Platform. Hardware set is a platform. Another word for this I would think would be foundation. One good note is that Java is not the only language which is being developed for the Java Virtual Machine. Scala is another and there are more. This means that the JVM will be getting plenty of support as time goes by. Hopefully changes to the JVM will always be favorable for Java.

Computer languages can be thought of as being more or less popular. I’ve heard some languages being said to be “dead” or “alive”. Long live Java! Things are changing fast in computer programming. Java has its competition. J++ was one such and is in fact dead because of a Sun and Microsoft lawsuit. J++ became what is now C# (C-Sharp). J++ and C# is very similar to Java but not identical in many ways. The saga continues. Java has been purchased from Oracle, the database folks. However Java’s continued development and growth is managed by the Java community (those that use and love it). So there is plenty of hope for Java. Also many books and a huge source(code) base have been developed. Java will continue to be used for many years to come. Will it loose popularity? Yes and it will regain popularity as well. A new hope for Java is the VPS(Virtual Private Server) which promises to make Java web services more affordable. VPS means you can install any operating system on a virtual server and any web services you like. Like GPL Host , my setup here, you may therefore have Debian linux installed and Tomcat 5.5 web server. You are therefore paying a competitive price for the virtual server not for expensive “Java” web services.

What types of software is Java good for? Ah you want my opinion? Sure, I’ll list a few types and next to it show poor, fair, good, great and excellent.

TSR hardware drivers(impossible)
console applications(poor) with a 3rd party api JCurses (fair)
GUI applications(good to great)
Games general(poor to great) depends on the type of game
Games 3D(poor) except for using what is called OpenGL or JOGL addon’s in which case via the use of these 3rd party graphics api’s or libraries great 3d graphics can be achieved
Client software(great to excellent)
Web Applications(good to great) depending on who you ask. Java works as well as it ever did but may not be like the newest fads. We are talking here about Java Server Pages, Serlvets, Java Server Faces.
Applets[mini applications](poor as of lately) Webstart applications are favored now over applets.
Web Start[mini applications](great)
Networking apps(excellent)
Database (good to great)

Next I will list some uses for Java the same way.

Educational software.(sure)
Scientific software.(for many types)
Accounting software.(why not?)
Introductory Programming (excellent, the best)

So in conclusion I say that Java is a great programming language to use and learn. And Java software is very valuable software. Loosing some popularity? Yes. But dead? No by no means dead. Some say, “Use the right tool for the right job.” I say, “Use the tool you enjoy using. Use the tool that you know how to use well.” Much in the computer world and programming is fad. Java has been a fad. But more than a fad as well. Much in the computer world is experimental. The more things change the more they remain the same right? Reinvention of the wheel is all around us. The basics of programming remain the same. “Statements”, “Iteration”, “Decisions”, “Subroutine”. “Input”,”Process”,”Output”. But things are added over time such as GUI, Networking, Mobile, Virtual Machine. Hardware is improved or added on to for backward compatibility sake. What you learn when using and learning Java will be a foundation for more to come in the future. Even a foundation for learning other programming languages and technologies. I hope I have convinced you to at least learn a little more about Java, to experiment with Java and to test and try it out. Maybe even from a Java application end users viewpoint aye?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.