What are the main differences between C++ and Java?

Pages: 12
closed account (Dy7SLyTq)
i just didnt like it. not to say its bad, we just didnt get along well

Launch any unsigned or self-signed applet or JWS application with a recent JRE and read the dialog. Anything unsigned, or signed from an unverified publisher will be blocked in a future release. From what I understand of the verification process: it's on a per-application basis, the certificate expires annually and must be renewed (for ~200 - 600 USD, as thwarte no longer offers free verification), and it takes time for your code to clear the review board assigned to assess it.


This applies only for applets signed from untrusted sources. Unsigned applets have the same priviledge level as JS or Flash, and they don't really pose any higher risk than JS or Flash. JS and Flash had their good share of 0-days, too. And I guess with the wider availability of WebGL this is going to get worse.

Anyway, applets are dead because of other reasons. Just compile Java to JavaScript and you'll be fine. Gmail is a great example of a 100% Java client side app that runs in a browser yet doesn't need applets nor JRE.
Last edited on
closed account (3hM2Nwbp)
It applies to unsigned applets as well. http://www.java.com/en/download/help/appsecuritydialogs.xml#unsigned

Privilege levels mean nothing when a vulnerability is introduced. I think their course of action is the best way to help ensure end-user safety, even if it's a pain for smaller vendors.

...and I was wondering what was up with gmail. It feels a bit odd and clunky sometimes.
This Slashoverflow.com Stackoveflow.com thread might be of interest?

What are some common Java pitfalls/gotchas for C++ programmer?
http://stackoverflow.com/questions/433853/what-are-some-common-java-pitfalls-gotchas-for-c-programmer

Andy

Edit : I think Stackoverflow.com and Slashdot.org must be stored close to each other in my brain...
Last edited on
COBOL might be legacy but it is definitely in use.

See this past fall's IBM Master the Mainframe Contest:
https://contest-reg.dfw.ibm.com/contest/usaca.nsf/MTM/studentspart2?open
Specifically, section 10 'COBOL: Oh yes, COBOL'

And my opinion on the original question is that the syntax of Java and C++ are really similar. I would just caution about trying to think the same way in both languages. They handle memory in different ways. Java sorta forces an object-oriented approach, whereas C++ allows a mix of approaches. I would recommend knowing both just because they are quite popular.
Last edited on

Privilege levels mean nothing when a vulnerability is introduced


Right, but there were just as many vulnerabilities in JS, PDF, Flash and browsers as there were in Java. This only means Oracle is more aware of the problem the other vendors. Which is IMHO good, because applets are terrible technology for other reasons.


and I was wondering what was up with gmail. It feels a bit odd and clunky sometimes.


I feel it too. The problem is Google. They seem to not be able to do proper UX design of all their services. Google+, Google Calendar and Android feel similar. These times everyone wants to hide as many options as possible in the interfaces. Which is IMHO terrible. 1990's designs with global top-down menu bars were soooo much better.
andywestken wrote:
This Slashoverflow.com thread might be of interest?
Is this some kind of in-joke that I don't understand? I can't understand how this could be a typo unless you're using a very different keyboard...
Last edited on
Gmail is a great example of a 100% Java client side app that runs in a browser yet doesn't need applets nor JRE


JavaScript is not related to Java.
closed account (N36fSL3A)
rapidcoder is an expert on Java, I'm sure he's aware of this.
closed account (3hM2Nwbp)
@Lowest0ne http://www.gwtproject.org/overview.html

Where there's a will, people will find new ways to obfuscate dynamic scripting languages. :P

There's also a javascript extension (mozilla rhino) that was pulled into JSR232 223. Mixed up my JSRs. ( https://www.jcp.org/en/jsr/detail?id=223 )
Last edited on
@Luc Lieber: That's pretty sweet.
The main difference between C++ and Java.

Java is somewhat "simpler" than C++. It hides most of the details from you so that you can program without worrying too much about the details. However, this "simplicity" can sometimes lead to restrictions that I won't go into detail. Most of the time, however, there are ways around those restrictions.

C++ is a mid-level language. This means that it has simplicity and complexity. You have far more control in C++ than in Java. However, with more control, you have to be more careful. Also, C++ is built on top of the C programming language, thus it inherits some of C's problems, too.

To be honest, I'd learn both, and I wouldn't skim when reading Java. There are certain fundamental differences between the two that will help you understand "HOW" the language works instead of just "how to use it." :)

I hope this helps.
Joe
closed account (Dy7SLyTq)
@lowest one: js actually is related to java, in the same way php is related to c++. @little captain: java is not a "simpler" language. true that you cant get as much control as with c++, but it is by no means simpler.
in the same way php is related to c++


You're going to have to explain that one to me.
closed account (Dy7SLyTq)
true that if i write a js file it wont work with the java virtual machine. however js is meant to be server side scripting that looks and feels like java, hence it is related to java. php is designed to look like c++
I guess they are related because they all make computers do things... Other than that, they are all different tools for doing different things.

JavaScript is a client side thing, this site uses it on its buttons. However, one could disable JavaScript and the same requests would be sent to the server. The server, which might be JS ( node.js ), or Ruby, or C++, or Java. And the html generated might use PHP, or erb, or haml, or any number of other things.

Edit: I'm sorry, looks like haml is just another way to write erb. Just like coffee script is just another way to write javascript.
Last edited on
@Lowest0ne: With GWT you can write Java code and cross compile it to JS.


@little captain: java is not a "simpler" language. true that you cant get as much control as with c++, but it is by no means simpler.


It is at least by means of grammar size and type. And LL(k) Java grammar is definitely simpler than a context-sensitive, ambiguous grammar of C++. As of getting control from Java - it is just as simple as writing that code in C++, compiling it to a DLL / SO and calling it from Java.
Topic archived. No new replies allowed.
Pages: 12