Server Help

Non-Subspace Related Coding - java VS c++

hellzlaker - Mon Dec 18, 2006 4:22 pm
Post subject: java VS c++
Can any one tell me the main differences and advanteges if there are any?
Maverick - Mon Dec 18, 2006 5:36 pm
Post subject:
fucking google it
http://www.google.nl/search?q=java+vs+c%2B%2B
CypherJF - Mon Dec 18, 2006 8:54 pm
Post subject:
Ah yes we haven't had anyone ask this question this month... quota met. Next.
Bak - Wed Dec 20, 2006 10:35 pm
Post subject:
c++ is compiled while java is interpretted.
Anonymous - Tue Apr 17, 2007 9:11 pm
Post subject:
Just to let you know, that is a terrible question to ask. I would suggest learning something on each topic before asking a broad question such as that.
SamHughes - Tue Apr 17, 2007 10:11 pm
Post subject:
Just to let you know, that is a terrible answer to provide. I would suggest reading some of the thread before writing a redundant reply such as that.
Doc Flabby - Wed Apr 18, 2007 3:22 am
Post subject:
Neither they both suck

Use a real programming language like Pascal.
BDwinsAlt - Thu Apr 19, 2007 6:08 pm
Post subject:
FORTRAN and COBOL are soo much coolerz than Pascal. sa_tongue.gif
tansey - Sat Apr 21, 2007 7:30 pm
Post subject:
Bak wrote:
c++ is compiled while java is interpretted.


That's not true. Java is compiled to Byte code which is then compiled to binary form on the fly during runtime by the Just-In-Time compiler in the JVM.

As for the original poster, if you really are asking that broad of a statement, I would suggest learning Java first as it's a more simplistic language to start with.
Cyan~Fire - Mon Apr 23, 2007 11:28 am
Post subject:
Quote:
compiled to a binary form on the fly

Wow, that sounds a lot like interpretation to me.

I guess you can argue that JIT compiling is not interpretation, but I'll still never regard Java as a compiled language.
Animate Dreams - Mon Apr 23, 2007 8:12 pm
Post subject:
I don't agree that Java is a more simplistic language. I think the two are too different. C is more simplistic than C++. Python is more simplistic than any of them. Simplistic shouldn't be a factor when learning programming, however, usefulness to the learner probably should be.

For example, if you want to learn how to write modules for AS3, Java is a bad place to start.
BDwinsAlt - Mon Apr 23, 2007 9:36 pm
Post subject:
Would a python biller ever work out. That would be hot. I don't see why it matters if Java compiles are not. It all works. The outcome is more important to me than the detailed technical terms. As long as it works does it matter if it's compiled or not?

Maybe someone wants to write java applets for ASSS modules. icon_biggrin.gif
Dr Brain - Mon Apr 23, 2007 10:39 pm
Post subject:
Cyan~Fire wrote:
Quote:
compiled to a binary form on the fly

Wow, that sounds a lot like interpretation to me.

I guess you can argue that JIT compiling is not interpretation, but I'll still never regard Java as a compiled language.


As it happens, x86 assembly is interpreted. It's a "virtual" CISC machine on top of a RISC core. That doesn't make assembly an interpreted language, though.
Doc Flabby - Tue Apr 24, 2007 9:43 am
Post subject:
BDwinsAlt wrote:
Would a python biller ever work out. That would be hot.


It would be quite possible to code a python biller.

You can make a biller with any programming language that is capable of manipulating bytes of data and sending and receiving udp/tcp(depending on biller tongue.gif) packets (or is able to call other libaries to perform these functions)

One thing i think everyone will agree on is the task of coding a biller will be substancially more difficuly in ASM than it is in C or Java
Cyan~Fire - Tue Apr 24, 2007 10:36 am
Post subject:
Well, Brain, there is still the major difference between hardware and software. Anyway, I am not saying that Java is inferior because it's not compiled (although I may believe that icon_razz.gif).
Doc Flabby - Tue Apr 24, 2007 11:16 am
Post subject:
Rember someone could create a physical java machine (and they do exist)
http://www.a-e-d.com/

http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part3/Chapter24/chips.html

and execute java byte code on it. Thus it would be completly "compiled", before it is executed.

The Java VM you see on windows is essentially an emulator. It emulates a java machine. You may have heard of VMware or Xen, which are a x86/x64 emulator for x86/x64 systems.
tansey - Tue Apr 24, 2007 12:37 pm
Post subject:
Cyan~Fire wrote:
Quote:
compiled to a binary form on the fly

Wow, that sounds a lot like interpretation to me.

I guess you can argue that JIT compiling is not interpretation, but I'll still never regard Java as a compiled language.


No, that is not what an interpretted language is. Java's JVM actually converts the class files to binary representations upon first instantiation (or earlier if static analysis shows it will always need to be loaded). So after you use something once, its binary form is still in memory. Compare this to Perl, where instructions are never compiled to any intermediate form and there is no JIT.

And as Doc correctly pointed out, you certainly can make a physical Java machine.

As for the AD's comment that Java is not a more simplistic language, what does Java provide from a language perspective that C++ does not? C++ has multiple inheritance, templates (generics are not the same-- templates are turing-complete), and pointer semantics to name a few. Not to mention that in order to parse C++ you need an infinite look-ahead but parsing Java is very easy from a grammar standpoint.
Dr Brain - Tue Apr 24, 2007 2:12 pm
Post subject:
Cyan~Fire wrote:
Well, Brain, there is still the major difference between hardware and software. Anyway, I am not saying that Java is inferior because it's not compiled (although I may believe that icon_razz.gif).


I don't see any difference.

Java may be linked on the fly, but it *IS* compiled beforehand.
Animate Dreams - Tue Apr 24, 2007 3:35 pm
Post subject:
tansey wrote:

As for the AD's comment that Java is not a more simplistic language, what does Java provide from a language perspective that C++ does not? C++ has multiple inheritance, templates (generics are not the same-- templates are turing-complete), and pointer semantics to name a few. Not to mention that in order to parse C++ you need an infinite look-ahead but parsing Java is very easy from a grammar standpoint.


Your first statement makes no sense. Offering the same things or different things than C++ has doesn't make either one a more simplistic language. Unless you just mean simplistic as in, Java doesn't go into classes as deeply as C++ does, in which case you should recommend C instead, since it doesn't go into classes at all. But that would be a horrible way to decide which language to learn first anyway. Besides, you could learn how to program in C++ without learning classes, if you wanted. Well, and had a teacher that was willing to teach you that way.
tansey - Tue Apr 24, 2007 3:52 pm
Post subject:
Animate Dreams wrote:
[..]



Your first statement makes no sense. Offering the same things or different things than C++ has doesn't make either one a more simplistic language. Unless you just mean simplistic as in, Java doesn't go into classes as deeply as C++ does, in which case you should recommend C instead, since it doesn't go into classes at all. But that would be a horrible way to decide which language to learn first anyway. Besides, you could learn how to program in C++ without learning classes, if you wanted. Well, and had a teacher that was willing to teach you that way.


I think that having less features and a smaller grammar is the definition of a simpler language. C does not have a smaller grammar than Java, and Java is a stronger-typed language that doesn't require the user to deal with things like memory allocation/management. Also, if the user is trying to learn OOP, then C is out of the question.
Dr Brain - Wed Apr 25, 2007 8:15 am
Post subject:
tansey wrote:
C does not have a smaller grammar than Java


By what standard? I'd say it's pretty clear that with OO, Java has more keywords than C.

BTW, this doesn't mean I agree with AD. He's wrong on more things than I can count.
tansey - Wed Apr 25, 2007 11:36 pm
Post subject:
I'm not talking about the number of keywords, I'm talking about the actual BNF grammar of the languages. Almost all programming languages are mapped out to a formal grammar which can be used to automatically generate a compiler for the language.
SamHughes - Thu Apr 26, 2007 2:46 am
Post subject:
The grammar isn't what makes a language simple or complicated. It's not what makes the programming language, either. Java's is as simple as C's and C++'s, except for superficial differences.

The features of a language don't decide simplicity either. Java has more "features" than, say, Haskell, but in terms of language complexity, Java is simpler. In terms of writing programs, though, Haskell is simpler. Which type of complexity are you considering?

If you ask me, the most useful measurement of a language's complexity is its type and scoping systems. On this measurement, Brainfuck < Scheme < Java < C < Haskell < Perl < C++ ? PHP, where '<' reads "is simpler than", and PHP can't be compared with the others because its type system and scoping rules are imaginary. Then, a more important measurement is how good the type system is for writing big programs.
Doc Flabby - Thu Apr 26, 2007 7:10 am
Post subject:
How could you forget QBASIC
tansey - Thu Apr 26, 2007 10:27 am
Post subject:
SamHughes wrote:
The grammar isn't what makes a language simple or complicated. It's not what makes the programming language, either. Java's is as simple as C's and C++'s, except for superficial differences.

The features of a language don't decide simplicity either. Java has more "features" than, say, Haskell, but in terms of language complexity, Java is simpler. In terms of writing programs, though, Haskell is simpler. Which type of complexity are you considering?

If you ask me, the most useful measurement of a language's complexity is its type and scoping systems. On this measurement, Brainfuck < Scheme < Java < C < Haskell < Perl < C++ ? PHP, where '<' reads "is simpler than", and PHP can't be compared with the others because its type system and scoping rules are imaginary. Then, a more important measurement is how good the type system is for writing big programs.


Ok, I agree completely with that. Great points.
Animate Dreams - Thu Apr 26, 2007 11:20 am
Post subject:
Rofl, qBASIC automatically gets put on the end. It probably rates just under COBOL in terms of complexity. It didn't seem hard when I was little, but now, I look at the goto statements out the ass, and line numbers, and it makes me want to cry. Also, SamHughes, did you seriously say Scheme is simpler than Java, C, C++, and PHP? Scheme belongs right alongside Perl. PHP would have to be much earlier on the list... I have several friends that have picked up PHP on their own, but I know very few people that have any degree of proficiency in C without having had several classes. And I don't see how you could ever say any OOP language would be simpler than a non-OOP equivalent language(C and Java).
Doc Flabby - Thu Apr 26, 2007 11:38 am
Post subject:
I still use the odd goto tongue.gif

The hate against goto is sometimes a tad irrational. Sometimes a simple goto will make something much more clear than alot of nested ifs.

Then again nesting an if statement more than 3 times means you are probabbly doing something wrong...


Anyone ever own a ti-83 I rember when i used to code games on my Ti-83 with its wierd version of basic.
tansey - Thu Apr 26, 2007 11:45 am
Post subject:
Doc Flabby wrote:

Anyone ever own a ti-83 I rember when i used to code games on my Ti-83 with its wierd version of basic.


haha, yeah I remember that. It was my first programming language in high school. I remember everyone scribbling down notes in physics class while I was instead making programs on my calculator that would do it for me.
SamHughes - Thu Apr 26, 2007 12:54 pm
Post subject:
Animate Dreams wrote:
Rofl, qBASIC automatically gets put on the end. It probably rates just under COBOL in terms of complexity. It didn't seem hard when I was little, but now, I look at the goto statements out the ass, and line numbers, and it makes me want to cry. Also, SamHughes, did you seriously say Scheme is simpler than Java, C, C++, and PHP? Scheme belongs right alongside Perl. PHP would have to be much earlier on the list... I have several friends that have picked up PHP on their own, but I know very few people that have any degree of proficiency in C without having had several classes. And I don't see how you could ever say any OOP language would be simpler than a non-OOP equivalent language(C and Java).


C's type system is more complicated than Java's because it has pointers, unions, anonymous unions, pointers to pointers, function pointers, and null pointers. Its scoping system is more complicated because it has pointers without garbage collection, and objects on the stack can go out of scope. Java doesn't have these properties, except for null pointers.

I did seriously say that Scheme's type and scoping systems are simpler than the others'. You can learn the rules of Scheme in five minutes. Two, with coffee. Every variable is lexically scoped, so its scoping system is no more complicated than the others'. Its type system is simply strong dynamic typing, with automagical numbers and go-anywhere functions. Perl's types and scoping are far more complicated than Scheme's: you have 'our' and 'my' and 'local' variable declarations, automagic string conversion/deconversion for scalars, list contexts and scalar contexts silently affecting the behavior of functions, strange namespaces for arrays, scalars, hashes, and those whaznits that have something to do with the star operator or filereferences, and an object system that's very disgusting. If you want a sane(r) version of Perl, try Perl 6.

PHP is not anywhere on the list; it's connected to the list with a question mark operator, representing total confusion and frustration as to why anybody would design a language this way.

OOP languages don't have non-OOP equivalent languages. How is C in any way equivalent to Java? They just look the same.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group