Re: Java is becoming the new Cobol
- From: LX-i <lxi0007@xxxxxxxxxxxx>
- Date: Wed, 02 Jan 2008 16:28:18 -0700
Richard wrote:
.....
"""If you're a Java developer, now's the time to invest in new
skills."""
The question then is: Is Java just another fad language in the range:
Algol, Pascal, Modula2, Ada, C++, that will be replaced by the next
fad languages Ruby, PHP, C# which will then be replaced by the
next ...
I don't think it's a fad language. However, I do see much Java being replaced on servers by C#. Looking at the two languages, C# is Java, take 2 - the syntax is *very* similar, but it leaves out some of the verbosity of Java. (heh - maybe it *is* the new COBOL!)
For example, if you wanted to access a property of an object which the property of another object which is the property of another object (whew!), in Java you have...
topObject.getSecondObject().getThirdObject().getProperty()
....whereas, in C#, it becomes...
topObject.SecondObject.ThirdObject.Property
(Plus, with the Visual Studio IDE, you only have to type like 5 or 6 characters to get that second line! :> )
Another aspect that I like is the way that properties are defined. In Java, it's almost COBOL-like in the way properties are defined (at least in our shop). We have the property items in the top, then the constructors, then the get and set methods after that. In C#, you declare the get and set method as part of the property.
I see C# and Java in one camp, and PHP and RoR in the other. I *really* like PHP's implementation of OO, although I'm sure it will mature more in version 6. They have a "magic" function __call($method, $arguments) that is called (if defined) if a method is requested of an object that does not exist. Using this, if you just need a simple getProperty() or setProperty() method, you don't have to define every single one of them!
Here's an example from a web site I've done...
public function __call($method, $arguments) {
$prefix = strtolower(substr($method, 0, 3));
$property = strtolower(substr($method, 3, 1)) . substr($method, 4);
if ((empty($prefix)) || (empty($property))) {
return;
}
if ($prefix == "get") {
if (isset($this->$property)) {
return $this->$property;
}
else {
return "";
}
}
if ($prefix == "set") {
$this->$property = $arguments[0];
}
}
Voila! :) (Of course, a limitation of the above is that it will blow up if you say setFoo("bar") and $foo is not actually a property. I'm sure I could put some error checking in for that, and probably will at some point.)
So, in answering your question, I don't see PHP and RoR as Java-killers. I see C# as a serious competitor, but I believe that until Mono matures more, the Unix/Linux installations will continue to go with Java. However, the advice given in that first quote is good. Innovate or die (figuratively speaking, of course).
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \/ _ o ~ Live from Albuquerque, NM! ~
~ _ /\ | ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business E-mail ~ daniel @ "Business Website" below ~
~ Business Website ~ http://www.djs-consulting.com ~
~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~
~ Personal E-mail ~ "Personal Blog" as e-mail address ~
~ Personal Blog ~ http://daniel.summershome.org ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ !O M--
V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e h---- r+++ z++++
"Who is more irrational? A man who believes in a God he doesn't see,
or a man who's offended by a God he doesn't believe in?" - Brad Stine
.
- References:
- Java is becoming the new Cobol
- From: Richard
- Java is becoming the new Cobol
- Prev by Date: Re: Java is becoming the new Cobol
- Next by Date: Re: Java is becoming the new Cobol
- Previous by thread: Re: Java is becoming the new Cobol
- Next by thread: Re: Java is becoming the new Cobol
- Index(es):
Relevant Pages
|