Difference with Java and C++ in terms of compilation
Dear all,
I am aware that java is a platform independant language since it uses the Java virtual machine to interpret the bytecode from the class files (created after the first compilation).
However, i'm curious to know what makes c/c++ different from java in terms of platform independancy, like 'why c or c++ programs cannot run on any platform like java' for example.
I read on a website its because the C and c++ compilers must be specific to the type of CPU.
I was wondering if anybody can please clarify this or tell me anyother explanation.
Thanks.
regards.
Raheal
C/C++ compilers create native code that runs directly on the hardware. The java compiler creates bytecode that runs on the VM. The VM transforms it to native code. There are different VMs for different systems, but only one compiler.
Platform independence is a marketing term. With this Sun refers to the Java language in combination with a JVM based runtime system and that this JVM is widely available on many platforms.
In principle a compiler for any language could output bytecode and render that language as "platform independent" as Java. And a compiler could take a Java source and output native code just as say a C or a C++ compiler.
So technically Java is just a programming language like any other. It can be compiled to native code and run on a hardware processor, or it can be compiled to an intermediate code and run on a software interpreter, as can any language. What sets Java apart is that it's the only language which actually has an interpreter available on many platforms in practice.
Compiling Java code using a Java compiler is straightforward. We simply write the source code in the Java language, use a Java compiler to compile the source into Java bytecode, and execute the results on any hardware/OS platform that has a JVM installed. Java's reliance on the JVM for its signature "write once, run anywhere" portability is its downside; not only must a JVM be available for any platform on which you want to run your Java apps, but there must be significant system resources (memory and disk space) to support that JVM. As a result, many developers continue to rely on less flexible but more targeted languages such as C/C++.
Compiling source in C/C++ is similar to doing so in Java. Once the code is written, we run it through a compiler and linker targeted to a specific hardware/OS platform. The resulting application will be executable only on the targeted platform, but will not require that a JVM be installed (though it may require some supporting shared libraries, depending on language used). All but the most simple applications developed using this method must be tailored individually to each hardware/OS platform on which you want them to run.
> less flexible but more
> targeted languages such as C/C++.
This is a misunderstanding. You're making the runtime system part of the language which it isn't.
Although maybe most Java programs are run by a JVM interpreter they don't have to. They can be statically compiled and run directly by a native processor. And the other way around. A C++ program doesn't have to be statically compiled. It can be compiled to some intermediate code and run by an interpreter. There are examples of both.
A C++ program> doesn't have to be statically compiled. It can be> compiled to some intermediate code and run by an> interpreter. There are examples of both.can you post a few of these?♠
> can you post a few of these?Visual C++ .NET could be an example (together with the other .NET languages).For more examples of language interpreters please feel free to use Google.
> > can you post a few of these?
>
> Visual C++ .NET could be an example (together with
> the other .NET languages).
How many different platforms could code in that language be run on?
I mean today, not theoretically.
Message was edited by:
paulcw
> > > can you post a few of these?
> >
> > Visual C++ .NET could be an example (together with
> > the other .NET languages).
>
> How many different platforms could code in that
> language be run on?
>
> I mean today, not theoretically.
>
> Message was edited by:
> paulcw
bingo!!!!
> > can you post a few of these?> > Visual C++ .NET could be an example (together with> the other .NET languages).None of them can be compiled once and run anywhere!!! next.....
> > > can you post a few of these?
> >
> > Visual C++ .NET could be an example (together with
> > the other .NET languages).
>
> None of them can be compiled once and run anywhere!!!
> next.....
If you read my posts you'll notice that this wasn't my point.
But okay. How do you define anywhere? Do you suggest that every platform that has a C compiler also has a JVM?
> > > can you post a few of these?
> >
> > Visual C++ .NET could be an example (together with
> > the other .NET languages).
>
> How many different platforms could code in that
> language be run on?
>
> I mean today, not theoretically.
I don't know really. Why do you ask? I've never claimed to know. I've said that programming languages and runtime systems are separate issues.
> I don't know really. Why do you ask? I've never
> claimed to know. I've said that programming languages
> and runtime systems are separate issues.
I think the problem is that you're talking about the way things theoretically could work, and everyone else is talking about the way they currently work in the real world. Two different discussions about the same topic, one academic, and one practical.
> > None of them can be compiled once and run anywhere!!!
> > next.....
>
> If you read my posts you'll notice that this wasn't
> my point.
Yeah, you had an acknowledgement that the Java environment actually has more widely available virtual machines, at the end of one of your posts, after you had dismissed the idea of platform independence.
> But okay. How do you define anywhere? Do you suggest
> that every platform that has a C compiler also has a
> JVM?
Obviously "anywhere" isn't absolutely true. It doesn't include the pocket calculator that I got in 1983, or the difference engine that some people built in a computer museum from Babbage's plans, or for that matter the ADM-3A terminal in bubble wrap in my living room.
But on a practical level, Java bytecode can be run on most desktop and server computers I'm likely to need to use currently, and a slightly different version of it can run on many mobile phones.
Visual C++ .NET can run on Windows boxes, and perhaps some Linux boxes running Mon, depending on whether the code in question used some of the proprietary libraries.
> > I don't know really. Why do you ask? I've never
> > claimed to know. I've said that programming languages
> > and runtime systems are separate issues.
>
> I think the problem is that you're talking about the
> way things theoretically could work, and everyone
> else is talking about the way they currently work in
> the real world. Two different discussions about the
> same topic, one academic, and one practical.
No I'm talking about how things work practically and theoretically. Otherwise you cannot fully understand a term such as "platform independence". At a job interview for example you would come through as ignorant.
> perhaps some Linux boxes running MonDo you mean [url= http://www.mono-project.com/Main_Page]Mono[/url]?I believe Mono runs on more that Linux: also Solaris, Max OS X, etc...
> > > I don't know really. Why do you ask? I've never
> > > claimed to know. I've said that programming
> languages
> > > and runtime systems are separate issues.
> >
> > I think the problem is that you're talking about
> the
> > way things theoretically could work, and everyone
> > else is talking about the way they currently work
> in
> > the real world. Two different discussions about
> the
> > same topic, one academic, and one practical.
>
> No I'm talking about how things work practically and
> theoretically. Otherwise you cannot fully understand
How things work practically is sometimes diferent or a subset of whats possible theoretically. Practiaclly Visual C++, and all that list you mentioned are nto platform independant. Theoretically they might be... but not yet.
> a term such as "platform independence". At a job
Java can be compiled any where and run on a whole lot of different platforms, windows, HP Unix, Solaris, Linux and the list goes on and on. The beauty is that you dont have to compile again. As I mentioned earlier, compile once and run anywhere. What other languages in the list you mentioned has this capability as of today.
> interview for example you would come through as
> ignorant.
> > > None of them can be compiled once and run anywhere!!!
> > > next.....
> >
> > If you read my posts you'll notice that this wasn't
> > my point.
>
> Yeah, you had an acknowledgement that the Java
> environment actually has more widely available
> virtual machines, at the end of one of your posts,
> after you had dismissed the idea of platform
> independence.
I haven't dismissed it. I'm saying that "platform independence" is a marketing term invented by Sun to promote its Java technology. Technically it's based on a ubiquitous interpreter.
> > But okay. How do you define anywhere? Do you suggest
> > that every platform that has a C compiler also has a
> > JVM?
>
> Obviously "anywhere" isn't absolutely true.
No it's a vision based on language interpretation rather than static compilation. Still nothing prevents Java from being statically compiled and nothing prevents other languages from being interpreted.
> > perhaps some Linux boxes running Mon
>
> Do you mean
> [url=http://www.mono-project.com/Main_Page]Mono[/url]?
>
> I believe Mono runs on more that Linux: also Solaris,
> Max OS X, etc...
Yeah I mean Mono. My keyboard sucks and I didn't proofread what I wrote enough.
I get the impression, from what I've read, that Mono is well-supported on Linux, and less well-supported on other platforms; and that only the libraries that Microsoft submitted for ECMA standards are being supported in Mono at all (and that a non-trivial amount of .Net development uses non-ECMA-submitted libraries.
So it's a stretch to posit Visual C++ .Net as an equally platform-independant alternative to Java.
> I haven't dismissed it. I'm saying that "platform
> independence" is a marketing term invented by Sun to
> promote its Java technology. Technically it's based
> on a ubiquitous interpreter.
But calling it a marketing term is dismissive. Even if it were invented by the marketing dept at Sun and by marketing alone (and I'm not convinced that's true yet), it has a meaning that's relatively well-recognized outside of pure marketing. Contrast that with something like "Contains pure natural goodness", which is absolute marketing.
Relatively speaking Java is more platform independent than other systems. That's because of the ubiquity of the JVM, yes, but that doesn't mean the advantage is not practically there. And besides the ubiquity of the JVM is partially the result of the language and bytecode being designed for a system in which the bytecode is run by an interpreter, so to suggest that it's unconnected to the language is wrong.
> No it's a vision based on language interpretation
> rather than static compilation. Still nothing
> prevents Java from being statically compiled and
> nothing prevents other languages from being
> interpreted.
Nothing prevents it, but various factors make it less feasible. There are Windows emulators, but Windows emulation has not turned Windows into a practical substitute for Java. Hell, there are PDP-11 emulators out there, but I haven't heard of anyone using PDP-11 assembly language as a sort of Java equivalent, in the way that Java is used because of the efficacy of being able to run bytecode on ubiquitous interpreters.
> > I haven't dismissed it. I'm saying that "platform
> > independence" is a marketing term invented by Sun to
> > promote its Java technology. Technically it's based
> > on a ubiquitous interpreter.
>
> But calling it a marketing term is dismissive.
If you feel it's dismissive it's your problem. Platform independence is a marketing term invented by Sun to promote Java. It denotes the vision that some day a JVM will be available on every platform so that a Java program can run anywhere without recompilation..
> Relatively speaking Java is more platform independent
> than other systems. That's because of the ubiquity
> of the JVM, yes, but that doesn't mean the advantage
> is not practically there. And besides the ubiquity
> of the JVM is partially the result of the language
> and bytecode being designed for a system in which the
> bytecode is run by an interpreter, so to suggest that
> it's unconnected to the language is wrong.
I don't understand what you mean by the above. Are you saying that if Java couldn't be compiled to bytecode then the JVM wouldn't be as ubiquitous as it is? Sounds pretty obvious to me. Java and the JVM is a packaged deal.
> > No it's a vision based on language interpretation
> > rather than static compilation. Still nothing
> > prevents Java from being statically compiled and
> > nothing prevents other languages from being
> > interpreted.
>
> Nothing prevents it, but various factors make it less
> feasible. There are Windows emulators, but Windows
> emulation has not turned Windows into a practical
> substitute for Java. Hell, there are PDP-11
> emulators out there, but I haven't heard of anyone
> using PDP-11 assembly language as a sort of Java
> equivalent, in the way that Java is used because of
> the efficacy of being able to run bytecode on
> ubiquitous interpreters.
I don't understand your point and why you're reaching 30 years back in time for the PDP11. What are the factors that prevent Java from being statically compiled and what are the factors that prevent other languages from being interpreted? There aren't any such factors because this is already happening today.
There are a least two sucessful Java static compilers, one open source and one commersial. You have other languages than Java running on the JVM. All .NET languages are compiled to an intermediate code called CLI (a bytecode equivalent) and interpreted by VES (a JVM equivalent).
The Java & JVM combination is very sucessful. The Sun vision of "platform independence" has come true beyond expectation. I fully acknowledge that. On the other hand there's nothing divine about it. It's still possible to discuss in wordly terms what all this means teachnically and how Java & JVM relates to other technologies.
> > > I haven't dismissed it. I'm saying that "platform
> > > independence" is a marketing term invented by Sun to
> > > promote its Java technology. Technically it's based
> > > on a ubiquitous interpreter.
> >
> > But calling it a marketing term is dismissive.
>
> If you feel it's dismissive it's your problem.
It's not my problem, but it is what you're doing. You're suggesting that it has no technical meaning.
> Platform independence is a marketing term invented by
> Sun to promote Java.
By the way do you have any evidence that the term was created wholly by Sun's marketing department? And that it was never used before that? And that people don't use it today apart from marketing?
> > Relatively speaking Java is more platform independent
> > than other systems. That's because of the ubiquity
> > of the JVM, yes, but that doesn't mean the advantage
> > is not practically there. And besides the ubiquity
> > of the JVM is partially the result of the language
> > and bytecode being designed for a system in which the
> > bytecode is run by an interpreter, so to suggest that
> > it's unconnected to the language is wrong.
>
> I don't understand what you mean by the above.
If you don't understand basic logic then that's your problem.
Hey, do you see how annoying it is when someone says something like that?
> Are
> you saying that if Java couldn't be compiled to
> bytecode then the JVM wouldn't be as ubiquitous as it
> is? Sounds pretty obvious to me. Java and the JVM is
> a packaged deal.
Yes! And, furthermore, that that means that Java and its creators get some credit for Java's being so ubiquitious. It's not just a coincidence, or the result of Sun's marketing department's hype.
> > > No it's a vision based on language interpretation
> > > rather than static compilation. Still nothing
> > > prevents Java from being statically compiled and
> > > nothing prevents other languages from being
> > > interpreted.
> >
> > Nothing prevents it, but various factors make it less
> > feasible. There are Windows emulators, but Windows
> > emulation has not turned Windows into a practical
> > substitute for Java. Hell, there are PDP-11
> > emulators out there, but I haven't heard of anyone
> > using PDP-11 assembly language as a sort of Java
> > equivalent, in the way that Java is used because of
> > the efficacy of being able to run bytecode on
> > ubiquitous interpreters.
>
> I don't understand your point
I was responding in particular to the "nothing prevents other languages from being interpreted" part. You're suggesting that Java has nothing over any other language, because anything can be interpreted in an emulator. It's true that anything can (theoretically) be run in an emulator, but that doesn't make Java equal to all other languages in terms of the ease of executing its object code on VMs on a variety of different platforms.
> and why you're reaching
> 30 years back in time for the PDP11.
Why not? It's a valid example.
> What are the
> factors the prevents Java from being statically
> compiled and what are the factors that prevents other
> languages from being interpreted?
I already said that nothing prevents either of those. I said that in the part you quoted.
> There aren't any
> such factors because this is already happening
> today.
Yes. There are emulators for other systems -- as I said. That doesn't make them equal to Java in terms of the relative ease of actually doing so both for the emulator writers and the end users.
> There are a least two sucessful Java static
> compilers, one open source and one commersial. You
> have other languages than Java running on the JVM.
Which has nothing to do with the discussion.
> All .NET languages are compiled to CLI (a bytecode
> equivalent) and interpreted by VES (a JVM
> equivalent).
Yes, and VES isn't as widely available across platforms.
> The Java & JVM combination is very sucessful. The Sun
> vision of "platform independence" has come true
> beyond expectation. I fully acknowledge that. On the
> other hand there's nothing divine about it.
Nobody said it's divine. Whenever you're about to lose an argument you accuse the other party of saying something like that.
> It's
> still possible to discuss in wordly terms what all
> this means teachnically and how Java & JVM relates to
> other technologies.
Yes. But part of that is recognizing that there are in fact differences in degree. The theoretical ability to emulate the execution environment of the object code of any language is different from the practical ability to actually do so. And Java's ability to do so is not just the result of marketing hype.
> > It's
> > still possible to discuss in wordly terms what all
> > this means teachnically and how Java & JVM relates to
> > other technologies.
>
> Yes. But part of that is recognizing that there are
> in fact differences in degree. The theoretical
> ability to emulate the execution environment of the
> object code of any language is different from the
> practical ability to actually do so. And Java's
> ability to do so is not just the result of marketing
> hype.
You're defending a position that's not being questioned. Can you get that?
If I say any language has the capability of being statically compiled to native code and run by hardware, or compiled to an intermediate code and interpreted by a program than it's a fact. I do this not to subtract from the virtues of Java but to explain the technical underpinnings of the term "platform independent" and how it relates to other technologies.
What do you want? Do I have to praise Java in every other sentence to be able to talk about programming languages and runtime systems?
> Platform independence is a marketing term invented by
> Sun to promote Java.
You've said that many times as if it were self-evident, but you've never provided any support for it. You have a habit of doing that, and it really runs your credibility into the ground.
Even if that statement is true as it stands, it's incomplete. Java does have a real, practical platform independence that is much more fully realized than other potential claimants to that term. This means that statements like, "Java is platform-independent; C++ is not," although needing some explanation and clarification, are still a meaningful and reasonably accurate first approximation that go well beyond mere marketing.
jverda at 2007-7-21 17:34:48 >

> If you feel it's dismissive it's your problem.
> Platform independence is a marketing term invented by
> Sun to promote Java. It denotes the vision that some
> day a JVM will be available on every platform so that
> a Java program can run anywhere without
> recompilation..
Maybe to you. To every intelligen developer I've ever talked to about it, it denotes that a Java program can run without recompilation on any platform for which there's a JRE of the proper version, and that the platforms for which that is true encompass very significant chunk of today's computing.
jverda at 2007-7-21 17:34:48 >

> You've said that many times as if it were
> self-evident, but you've never provided any support
> for it. You have a habit of doing that, and it really
> runs your credibility into the ground.
I have the feeling this is another one of those times where she doesn't really have a firm idea, so she's just taking some position and acting as if it's gospel just to "try it out". She seems to "enjoy" that method of "learning", as she's alluded to in the past.
~
> You're defending a position that's not being
> questioned. Can you get that?
No, I'm clarifying a fact that you seem to enjoy muddying the waters around.
> What do you want? Do I have to praise Java in every
> other sentence to be able to talk about programming
> languages and runtime systems?
Not at all. But when you say something that I think may be incomplete, then don't be surprised when I complete it. And furthermore don't be offended when my completion seems to step on your dogma.
i will add a little bit. i know this for a fact Java is really hard and takes alot of coding when it comes to read data from a file omg. i can write the same thing in c++ in like 20 min and in java took me like almost a day not in wrting a code but exception handling and then formatting problem still having problem. But overall i will still rate Java as a good language because of the builtin classes they have in the api . Very kool .
> i will add a little bit. i know this for a fact Java
> is really hard and takes alot of coding when it comes
> to read data from a file omg. i can write the same
> thing in c++ in like 20 min and in java took me like
> almost a day not in wrting a code but exception
> handling and then formatting problem still having
> problem.
Huh? I can write a class that reads data from a file in well under 20 minutes.
ok. here is my code for C++ which i wrote in 20 min. and just see for yourself the difference between java code and C++. setw in c++ take care of all the whitespaces and to read file just look in c++ how easy it is rather than in java storing in array and then printing it out seperate and then do doubleparsedouble.
c++
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
const float Code1_percent = 0.1f;//(That is, 10%)
const float Code2_percent = 0.12f; //(That is, 12%)
const float Code3_percent = 0.15f; //(That is, 15%)
void getData(char N[15],int &Q,int &PC, float &P);
float computeItemProfit(int Q, int PC, float P);
void main()
{
charItemName[15];
intQuantity,ProfitCode;
float Price,ItemProfit,TotalProfit=0;
//Print column titles
cout<<setw(15)><<"Item Name"
<<setw(10)><<"Quantity"
<<setw(10)><<"Price"
<<setw(10)><<"Code"
<<setw(10)><<"Profit"<<endl><<endl;
cout.setf(ios::fixed);
cout.precision(2);
for(int i=0; i<6; i++)
{
getData(ItemName,Quantity,ProfitCode,Price);
ItemProfit=computeItemProfit(Quantity,ProfitCode,Price);
TotalProfit = TotalProfit + ItemProfit;
cout<<setw(15)><<ItemName
<<setw(10)><<Quantity
<<setw(10)><<Price
<<setw(10)><<ProfitCode
<<setw(10)><<ItemProfit<<endl;
}
cout><<"\n\n\t\t\t\t"<<"Total Profit is $"<<TotalProfit><<endl<<endl;
}
void getData(char N[15],int &Q,int &PC, float &P)
{
static ifstream read("saloo1.dat");
read>>ws;
read.getline(N,15);
read>>Q>>P>>PC;
}
float computeItemProfit(int Q, int PC, float P)
{
if(PC == 1)
return Code1_percent * P * Q;
else
if(PC == 2)
return Code2_percent * P * Q;
else
if(PC == 3)
return Code3_percent * P * Q;
else
return 0;
}
and i have written the same code in java
import java.io.*;
import java.util.Scanner;
import java.io.BufferedReader;
class ProfitTester
{
public double computeProfit(double quantity, double price, int code)
{
if(code==1)
return 0.10 * quantity * price;
else if(code==2)
return 0.12 * quantity * price;
else if(code==3)
return 0.15 * quantity * price;
else
return -1;
}
}
class ProfitCalculator
{
public static void main(String[] args) throws IOException
{
int profitcode;
double quantity;
double price, itemprofit, totalprofit=0;
ProfitTester test = new ProfitTester();
try
{
FileReader fr = new FileReader ("saloo1.txt");
BufferedReader inFile = new BufferedReader(fr);
String f = inFile.readLine();
System.out.println("Item \tquantity \t price \t code \t Profit ");
while(f!=null)
{
String[] str = f.split(" + ");
itemprofit = test.computeProfit(Double.parseDouble(str[1].trim()),
Double.parseDouble(str[2].trim()),Integer.parseInt(str[3].trim()));
totalprofit += itemprofit;
// System.out.println(str[0]);
System.out.println( str[0].trim().format() + " \t " + str[1].trim() + " \t " + str[2].trim() + " \t"
+ str[3].trim() + " \t " +itemprofit);
f=inFile.readLine();
}
System.out.println("The total profit is " + totalprofit);
}
catch(NullPointerException e){
e.printStackTrace();
}
}
}
see for yourself the difference. jved has been helpful and now give me more url to just do some formatting . a big page .
See it for yourself and compare it oh yea someone told me use trim method to get rid of white spaces and i did it and then still my output in java is not formatted then jverd told me look into formatting oh yea that whole page might take me atleast 3 hours to sneak what i want. i am not accussing of anything though i am stil impressed by the beauty of java and specially APi but there are always some flaws in every language.
This took me 12 minutes:
public class Cat {
public static void main(String[] args) throws Exception {
Scanner stdInScanner = new Scanner(System.in);
for (String fileName : args) {
boolean done = false;
while (!done) {
Scanner fileScanner = null;
try {
fileScanner = new Scanner (new File (fileName));
while (fileScanner.hasNextLine()) {
System.out.println(fileScanner.nextLine());
}
done = true;
}
catch (IOException exc) {
System.out.print("Could not read "+ fileName + ". Try again? ");
done = stdInScanner.nextLine().equalsIgnoreCase("n");
}
finally {
if (fileScanner != null) {
fileScanner.close();
}
}
}
}
}
}
Now, maybe you mean that figuring out the exception handling was hard. Well, it's probably a different way of approaching things than you're used to, but I imagine you also probably had to *GASP* spend some time learning C++ too before you were able to whip out a file reading program in 20 minutes.
From [url http://drneil.blogspot.com/2007/01/value-of-my-knowledge-is-knowing-where.html]here[/url], just because it's where I found it the quickest. (It's quite popular, and available all over the web.)
It reminds me of the old story about a railroad expert being summoned because a brand-new diesel locomotive would not start, no matter what the engineer did. After a short time studying the situation, the expert gave the locomotive a light tap with a hammer. It started right up. When the railroad received the expert's bill for $1,000, they asked him to itemize it. The reply came:
Hitting the locomotive with hammer: $10
Knowing where to hit it: $990
jverda at 2007-7-21 17:34:54 >

So, what's your point? That there are some things that are easier to do in C++? Sure, I guess there are. And some things are easier in Java, too.Also, note that "less code" doesn't mean "simpler language."
jverda at 2007-7-21 17:34:54 >

yes jverd you are rite. i hope i can explain it to you but o well i was just giving my opinion after comparing c++ code and java code. yes you are rite it takes alot of knowledge and time so may be in the future i will do good. Thanks
> yes jverd you are rite. i hope i can explain it to
> you but o well i was just giving my opinion after
> comparing c++ code and java code. yes you are rite it
> takes alot of knowledge and time so may be in the
> future i will do good. Thanks
You're free to express your opinion, of course, just as I'm free to disagree with it. Although, I don't think I totally understood what opinion you were trying to express.
:-)
jverda at 2007-7-21 17:34:54 >

> ok. here is my code for C++ which i wrote in 20 min
It would take me days to write that code in C++, but I could write code to read lines of text from a file in Java in just a few minutes.
But that doesn't mean that Java is easier to write than C++. It just means that I'm good at Java and don't know C++ at all.
> > Platform independence is a marketing term invented by
> > Sun to promote Java.
>
> You've said that many times as if it were
> self-evident, but you've never provided any support
> for it. You have a habit of doing that, and it really
> runs your credibility into the ground.
See my reply #49.
> Even if that statement is true as it stands, it's
> incomplete. Java does have a real, practical platform
> independence that is much more fully realized than
> other potential claimants to that term. This means
> that statements like, "Java is platform-independent;
> C++ is not," although needing some explanation and
> clarification, are still a meaningful and reasonably
> accurate first approximation that go well beyond mere
> marketing.
Sure and this is because Sun has so sucessfully established "platform independence" as a term for the cross-platform features of a language, and as something of course Java has in spades.
Each time you state "X is not as platform independent as Java" someone at Sun laughts at you because you're dancing to their music without even realizing it.
> > If you feel it's dismissive it's your problem.
> > Platform independence is a marketing term invented by
> > Sun to promote Java. It denotes the vision that some
> > day a JVM will be available on every platform so that
> > a Java program can run anywhere without
> > recompilation..
>
> Maybe to you. To every intelligen developer I've ever
> talked to about it, it denotes that a Java program
> can run without recompilation on any platform for
> which there's a JRE of the proper version, and that
> the platforms for which that is true encompass very
> significant chunk of today's computing.
Yes, for that Sun managed to establish the term "platform independence" and make it a yardstick against which other languages have to measure themselves. It's no mean feat of a marketing department.
If you don't realize you've bought into a marketing stunt you're maybe not as intelligent as you think. Now go and write something once and run it anywhere. -:)
>
> So it's a stretch to posit Visual C++ .Net as an
> equally platform-independant alternative to Java.
Certainly several years ago Perl surpassed Java for platform support probably by at least an order of magnitude. Many of the libraries would run on most of the OSes as well.
Java might have closed that gap but how close that was would depend on how one decided to count java support on a mobile phone (not only by what defines a distinct platform but whether a significantly stripped done version is still java.)
> Nothing prevents it, but various factors make it less
> feasible. There are Windows emulators, but Windows
> emulation has not turned Windows into a practical
> substitute for Java. Hell, there are PDP-11
> emulators out there, but I haven't heard of anyone
> using PDP-11 assembly language as a sort of Java
> equivalent, in the way that Java is used because of
> the efficacy of being able to run bytecode on
> ubiquitous interpreters.
Conversely are you suggesting that there are commercial apps that are targetting every possible java platform?
Are you suggesting that there is even one that does that?
Myself I haven't seen any shopping cart web servers that claim that they (the server itself) runs on a phone. Nor do I see mobile java phone games being marketed to the desktop PC platform.
> Platform independence is a marketing term invented by
> Sun to promote Java.
>
That statement seemed likely to me.
However I don't see that it is supported by the historical evidence...
From the java white paper http://java.sun.com/docs/white/langenv/Intro.doc2.html#937
Developing your applications using the Java programming language results in software that is portable across multiple machine architectures,
I've worked with marketing departments. I can't believe any of them would come up with a phrase "platform independence" all by themselves. They wouldn't understand it, and it doesn't sound sexy enough, and like most MBA types they're afraid of anything really new. (They like the idea of "new" but are afraid of it in practice -- thus the "race to be second" phenomenon.)
I can believe that the Java language designers came up with the phrase, demonstrated that it had some resonance with developers, and then the marketing department (now convinced) proceeded to slap the term on everything they could.
> I can believe that the Java language designers came
> up with the phrase...
Source: MacWEEK
Publication Date: 30-JAN-90
The ABCs of Mac graphics file formats. (explanation of Apple Macintosh graphics file types) (glossary)
COPYRIGHT 1990 Mac Publishing
By Connie Guglielmo
San Francisco -- To communicate in the Macintosh graphics community, graphic artists must speak a language of acronyms. A variety of Mac graphics file formats -- some standard, some proposed -- now exist.
>PICT (Picture Format), was developed by Apple in 1984 as the standard format for storing and exchanging graphics files. The original release only supported black-and-white images; PICT2 arrived in 1987, with support for eight-bit color and gray scale. Users running Apple's 32-bit color QuickDraw can now generate 24-bit color PICT images.
>TIFF (Tag Image File Format), a platform-independent format for storing and exchanging scanned images, was developed in 1986...
http://www.accessmylibrary.com/premium/0286/0286-9211095.html
--
From the [url=http://nl.newsbank.com/nl-search/we/Archives?p_product=BG&p_theme=bg&p_action=search&p_maxdocs=200&p_topdoc=1&p_text_direct-0=0EADEE3EECA45A69&p_field_direct-0=document_id&p_perpage=10&p_sort=YMD_date:D&s_trackval=GooglePM]Boston Globe[/url]:
ASSETS ACQUIRED
Published on January 16, 1988
BILLERICA -- Automatix Inc., the CAD/CAM control company has completed acquiring the assets of SuperCads Inc. of Santa Clara, Calif., for 2 million shares of Automatix common stock. SuperCads has developed and sells a full functionality three-dimensional CAD software package for mechanical design and drafting. The software is platform independent.
--
More results from a [url=http://news.google.com/archivesearch?as_q=&num=10&btnG=Search+Archives&as_epq=platform+independent&as_oq=&as_eq=&as_ldate=1980&as_hdate=1990&lr=&as_src=&as_price=p0&as_scoring=]Google search[/url].
I compared the the publication dates with this: http://www.java.com/en/javahistory/timeline.jsp
> then the marketing department (now convinced) proceeded to slap the term on everything they could.
Conversely, I haven't seen anything to suggest that Sun used the term "platform independent" as anything other than just another descriptive quality; certainly not anything to suggest a marketing blitz based on the phrase.
~
