943,600 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 12480
  • C++ RSS
You are currently viewing page 5 of this multi-page discussion thread; Jump to the first page
Jul 21st, 2007
0

Re: C++ Vs Java

java compilers and the java runtime environment are created using C++


learning both C and C++ is good but you may find yourself trying to unteach yourself things from C when you work in C++.

Second that!
Reputation Points: 16
Solved Threads: 1
Light Poster
xander85 is offline Offline
29 posts
since Jul 2007
Jul 21st, 2007
0

Re: C++ Vs Java

why dont they rewrite the java VM in assembley it would be faster. maybe its too big.
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,485 posts
since Apr 2005
Jul 21st, 2007
0

Re: C++ Vs Java

because there's no need to. It's plenty fast enough as it is, and the way it's coded now a lot of the codebase is platform independent (meaning it compiles equally well for all platforms Sun supports), reducing lead time and investment drastically.
If written in assembly (or worse, Visual Basic) they'd have to rewrite the entire thing for each hardware and operating system platform supported, which by now has reached quite a number (Sun supporting both 32 and 64 bit versions of Windows, Solaris, and Linux, for a total of something like 10 different distributions).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 21st, 2007
2

Re: C++ Vs Java

Click to Expand / Collapse  Quote originally posted by jbennet ...
Hey, is the Java VM written in C++ ?
Yeah, I first noticed that "java" executable is written in C/C++ when I had some hotspot error and it wrote down a core file, whose pstack showed calls from main()->createVM()... So it's C at least if not C++.
You can execute "file java" on unix to see this. Also if you have some tools to list out names in a file like nm, or c++filt...

Anyway, that is no scale to say that C/C++ is better than Java.

For the original question, I would say that decide the industry (telecome, services, product-based, web-services...) you wanna go to, and pick based on that. If you donno which industry then just leave C/C++ and Core Java all 3 of them, shouldn't take you long to learn the languages. It will surely take some time to actually be good at programming in ANY 3 of them. Coz write code and write good are different things.
Abt java, given that apart from core java you have a 100 other things you can learn e.g. J2EE itself is a Pandora's box.

A personal note: every time I have interviewed a candidate for a job in my projects, I have looked for language/theoretical knowledge and good attitude in freshers (just outa collage) and programming knowledge in candidates with prior experience.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
Jul 21st, 2007
0

Re: C++ Vs Java

Click to Expand / Collapse  Quote originally posted by jwenting ...
If written in assembly (or worse, Visual Basic) they'd have to rewrite the entire thing for each hardware and operating system platform supported...
JRE is platform specific. You can't ftp /usr/bin/java from *nix to a windows machine and expect to run a java program using that.
By not writing it in assembly they don't save on that front. I presume, it's just that it's easier to do it in C/C++ than in asm.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
Jul 21st, 2007
0

Re: C++ Vs Java

I know that full well. The BINARIES are platform specific.
A lot of the SOURCE of the JVM however isn't.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 23rd, 2007
0

Re: C++ Vs Java

Click to Expand / Collapse  Quote originally posted by jbennet ...
why dont they rewrite the java VM in assembley it would be faster. maybe its too big.
On a project of that scale, compilers for modern chips would probably optimize the code better than (most) programmers.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ioillusion is offline Offline
8 posts
since Jul 2007
Jul 23rd, 2007
3

Re: C++ Vs Java

Click to Expand / Collapse  Quote originally posted by jbennet ...
why dont they rewrite the java VM in assembley it would be faster. maybe its too big.
Correctness is more important than speed.
Team Colleague
Reputation Points: 1133
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is online now Online
2,478 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: exit code error
Next Thread in C++ Forum Timeline: Why does my code not take my input?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC