Author |
Message |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: 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? |
|
Back to top |
|
|
Maverick
Age:39 Gender: Joined: Feb 26 2005 Posts: 1521 Location: The Netherlands Offline
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Dec 18, 2006 8:54 pm Post subject: |
|
|
|
|
Ah yes we haven't had anyone ask this question this month... quota met. Next. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:24 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
unknown1988 Guest
Offline
|
Posted: 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. |
|
Back to top |
|
|
SamHughes Server Help Squatter
Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
Posted: 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. |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Wed Apr 18, 2007 3:22 am Post subject: |
|
|
|
|
Neither they both suck
Use a real programming language like Pascal. _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Apr 19, 2007 6:08 pm Post subject: |
|
|
|
|
FORTRAN and COBOL are soo much coolerz than Pascal. |
|
Back to top |
|
|
tansey Novice
Joined: Nov 03 2004 Posts: 53 Offline
|
Posted: 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. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: 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. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: 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. |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: 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. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: 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. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: 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 ) 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 |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: 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 ). |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
|
tansey Novice
Joined: Nov 03 2004 Posts: 53 Offline
|
Posted: 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. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: 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 ). |
I don't see any difference.
Java may be linked on the fly, but it *IS* compiled beforehand. |
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: 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. |
|
Back to top |
|
|
tansey Novice
Joined: Nov 03 2004 Posts: 53 Offline
|
Posted: 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. |
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: 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. |
|
Back to top |
|
|
tansey Novice
Joined: Nov 03 2004 Posts: 53 Offline
|
Posted: 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. |
|
Back to top |
|
|
SamHughes Server Help Squatter
Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
Posted: 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. |
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Thu Apr 26, 2007 7:10 am Post subject: |
|
|
|
|
How could you forget QBASIC |
|
Back to top |
|
|
tansey Novice
Joined: Nov 03 2004 Posts: 53 Offline
|
Posted: 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. |
|
Back to top |
|
|
|