| The java programming language is becoming | | | | still complex with things like pointers, |
| more and more popular each day. It is the | | | | memory leak and multiple |
| language without which one cannot even hope | | | | |
| to a land a job these | | | | inheritence. The pointer |
| | | | |
| days. But has somebody even wondered how | | | | concept was taken from C and it was very |
| this language came about? There are many | | | | messy! The pointer is special type of |
| stories about, many books have been written. | | | | variable |
| Here is my version (not approved by Sun | | | | |
| Microsystems).The java programming language | | | | that points to other variables. Since there |
| originated in Indonesia. It was meant to be | | | | was no guidelines as to how to use |
| used | | | | |
| | | | these pointers, it was very easy loose track |
| by the tourists that visit that country each | | | | of them. In a typical two thousand lines |
| year. Why would tourists want to use | | | | program, one would frequently end up with |
| computer? Well, these are no ordinary | | | | hundredes of pointers pointing |
| tourists. They are rich tourists. Have | | | | |
| | | | to thousands, some of them are pointers and |
| they not been rich, they would not travel | | | | some just plain variables. Needless |
| half way around the world to visit this | | | | |
| | | | to say this made a large program extremely |
| place. Most people would be content to see | | | | difficult to read and when the |
| just what is available near by. For | | | | |
| | | | programmer left for another company, they |
| example, if you are a texan living in | | | | would have no other choice than |
| Dallas, you will visit the stockyards or may | | | | |
| be the | | | | to just throw away his program! It was |
| | | | sometimes necessary to do this even |
| trinity river park. If you live in New | | | | |
| Orleans area, you would see st. mary's | | | | when the programmer was around and very much |
| | | | alive. This is because the pointers he |
| bayou. Once in your lifetime, one will | | | | created inside his program had taken a life |
| probably visit Hawaii or Niagara. But | | | | of their own and defy |
| | | | |
| going to Indonesia and its islands, Bali, | | | | every attempt to predict how the program |
| Java, etc is not for the ordinary | | | | should behave. |
| | | | |
| people. Anyway, coming back to the question | | | | Memory management was also another weak |
| why these tourists need to use | | | | point of C and C++. The programmer was |
| | | | |
| computer programs. They go there not just to | | | | responsible for cleaning up the memory their |
| have fun and also get some work | | | | program would allocate and use. |
| | | | |
| done in a fun atmosphere as these people are | | | | Failure to do so will result in a crash of |
| very important people.From the very start | | | | the whole computer.Multiple inheritence, |
| java was supposed to be computer independent. | | | | though sparingly used, was |
| That means if | | | | |
| | | | another feature of C++ which made a |
| you write a program in java in one computer, | | | | programmer's life miserable. It, however, |
| it should run in all computers. | | | | |
| | | | had its use, especially in job interviews. |
| This was necessary because tourists bring | | | | This one question, they thought, |
| all kinds of computers with them. | | | | |
| | | | helped them separate the wheat from the |
| Some bring | | | | chaff.But C++ still had some nice and simple |
| | | | features, like inheritence, encapsulation, |
| Windows machine, some Apple mackintosh. Some | | | | etc. They are something one can describe in |
| of the affluent ones bring | | | | plain english, |
| | | | |
| Sun server workstations or even a super | | | | something one can explain to a layman. So |
| computer.Before starting to create java they | | | | the creator of java decided to take |
| also sought to see if there have similar | | | | |
| | | | the good features of inherience, |
| stuff done already. Even though they could | | | | encapsulation, and polymorphism from C++, |
| find none, they found they can use | | | | |
| | | | while discarding the bad features such as |
| lots of feature from some existing laguages. | | | | multiple inherience, pointers etc. |
| One such language they found was C++. C++ was | | | | |
| an advancement over the language called C. In | | | | The memory management was |
| fact, ideas of | | | | |
| | | | improved in java where the programmer will |
| C++ was already hidden in C. In that | | | | not be held responsible for memory |
| language, one can increment a variable, | | | | management. They |
| | | | |
| say i, by applying the ++ operator e.g. i++. | | | | can clean up after themselves if they want |
| This would increase the value of | | | | to get extra credit, but they do not |
| | | | |
| the variable i by one. If i had a value of | | | | need to. Needless to say all these was great |
| 5, it would make it 6, etc. | | | | news to the tourists in Indonesia!Java |
| | | | introduced lot of clarity in notations too. |
| What a vision!Anyway, coming back to C++, it | | | | For example, in C++ they |
| made an important advancement over C by | | | | |
| introducing the idea of a class. To | | | | would say class doctor:person to mean |
| understand class, one has to undestand | | | | doctor is derived from person. |
| | | | |
| structure which was already used in C. The | | | | It is obviously very cryptic. The same |
| structure is a group of variables. | | | | situation can be expressed |
| | | | |
| For example, you have a name, an address, | | | | in java as class doctor extends person , |
| age etc. for any person. In stead of | | | | which is much easier to understand. But there |
| | | | are few awkward stuff in java too especially |
| using them separately, in C one can group | | | | when someone |
| them together and call it a person. | | | | |
| | | | says class bum extends person (my last bum |
| The creator of C++ said there is no need to | | | | joke)!Java made an important contribution in |
| expose these variables (name, address, etc) | | | | the graphical user interface (GUI) area. |
| to the outside world. They said these details | | | | |
| should be hidden | | | | C++ was really lacking in expertise here. |
| | | | They visual C++, but worked only on |
| from the outside world. They called this | | | | |
| concept encapsulation.Another important | | | | windows environment. But it did not work in |
| | | | UNIX systems or mackintoshes. Just |
| contribution of C++ was the concept of | | | | |
| inheritence. This concept can be best | | | | like other features of java, this was also |
| | | | supposed to be platform independent. |
| explained by example. Let's go back to the | | | | |
| example of the person. A person is | | | | This was further necessary because one can |
| | | | put some little GUI on a web page which can |
| very general concept. There can be many | | | | be views over the internet. And one cannot |
| different kinds of persons, e.g doctors, | | | | control what kind of computers other will |
| | | | have.After a while, it was necessary to call |
| lawyers, teachers, or just a bum! But each | | | | programs from one computer to another |
| of these people have a name, an address, age | | | | |
| etc. Even a bum has all these. The creator of | | | | computer. To do this, they created J2EE. I |
| C++ thought one can | | | | am not sure how they came |
| | | | |
| define a base class call person and other | | | | up with the name J2EE. The 'J' of J2EE, of |
| classes can be derived from it. In | | | | course, means "Java", and I can be |
| | | | |
| plain english, this would mean, a doctor is | | | | reasonably sure '2' stands for 'To'. But I |
| special kind of person, lawyer is | | | | do not know what the 'EE' part is all |
| | | | |
| another special kind of person. Now the | | | | about, probably some kind of extension. |
| common attributes of all these kinds of | | | | |
| people can be put in | | | | Or at this point they ran out of names to |
| | | | think of. So they decided to |
| the person class and special attributes can | | | | |
| be put in the derived classes, e.g. | | | | have one of those just another vague |
| | | | acronyms.If you would like, you can also |
| hospital for the doctor, court for the | | | | visit my home page. |
| lawyer, and nothing for the bum.But C++ was | | | | |