Java Or C++

A Member? Please Login  
type your username and password to login
Date: October 14, 2008, 04:57 AM
249610 members and 148284 Topics
Latest Member: sojaslim99
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Java Or C++
Pages: (1) (2) Go Down Send this topic Notify of replies
Author Topic: Java Or C++  (Read 1049 views)
ebot
Re: Java Or C++
« #32 on: May 26, 2008, 11:06 PM »

@ sbucareer
Unix is written in C not C++, just to be clear.
sbucareer (f)
Re: Java Or C++
« #33 on: May 28, 2008, 09:03 PM »


Thanks for the clarification, but what is the difference between C and C++?

logica
Re: Java Or C++
« #34 on: May 29, 2008, 11:16 AM »

@sbucareer

i'm sure that was a rhetorical question.
sbucareer (f)
Re: Java Or C++
« #35 on: May 29, 2008, 12:24 PM »


No logica, I just want to be clear
logica
Re: Java Or C++
« #36 on: May 30, 2008, 12:39 PM »

OK. I thought u are a programmer.

ps: c++ = c + 1 => a level higher than c. i don't think i need say more than that.
ebot
Re: Java Or C++
« #37 on: May 31, 2008, 07:56 PM »

Quote
OK. I thought u are a programmer.

ps: c++ = c + 1 => a level higher than c. i don't think i need say more than that.
   

@logica
thumbs up  Grin
Ghenghis (m)
Re: Java Or C++
« #38 on: June 02, 2008, 07:41 AM »

Quote from: ebot on May 31, 2008, 07:56 PM
   

@logica
thumbs up  Grin

I'm sure its more than a level.

Many people just use them interchangeably, thats wrong.

Did you know that a lot of the solaris OS was written in Object C ,

How many levels ahead of C would that be  Grin
If you've written C++ and C , you'D know the difference ,
logica
Re: Java Or C++
« #39 on: June 02, 2008, 04:36 PM »

i was simply pointing out that the suffix "++" which happens to be the "increment" operator in the C language is there to show that C++ is an "increment" (advance 1 level) to C.
Ghenghis (m)
Re: Java Or C++
« #40 on: June 02, 2008, 05:15 PM »

Quote from: logica on June 02, 2008, 04:36 PM
i was simply pointing out that the suffix "++" which happens to be the "increment" operator in the C language is there to show that C++ is an "increment" (advance 1 level) to C.
Yeah, the pun is clear ,but in retrospect both languages are quite different. : Wink
Bjarne used C as the vehicle for his new language because he wanted it to be adopted quickly by At & t people. So he tried to make everything that was valid in C valid in C++, but  i doubt that is true anymore ,  C99 brought many new things on board.
logica
Re: Java Or C++
« #41 on: June 02, 2008, 07:36 PM »

well, how different are they when c++ is a superset of c (meaning c became a subset of c++)? same cannot be said of c/c++ and java for instance as they are quite different.
khai_khai (m)
Re: Java Or C++
« #42 on: June 04, 2008, 12:07 AM »

The major difference between C and C++ is that C++ has object oriented features like, classes, inheritance, polymorphism etc.

Java is OO based too, but includes garbage collection and does not have those stupid pointers u see in C/C++.
Ghenghis (m)
Re: Java Or C++
« #43 on: June 04, 2008, 07:27 PM »

Another thing going for C++ is multiple inheritance ,  while Java has singly rooted hierarchy

for differences between C and C++ http://david.tribble.com/text/cdiffs.htm

Apart from the pointer thingy and large library java is also very much like C  Shocked
javarules (m)
Re: Java Or C++
« #44 on: June 04, 2008, 08:17 PM »

The most powerful programming language I have ever come across is c/c++.

Does that tell you something? yes I see no disparity between both.

You have doubts? MySQL c-based, Oracle c-based, Firefox c-based, Java c-based, Linux c-based, i can go on and on.

But don't mis-understand me, when I say c-based I mean c/c++ because you can't actually compile any of these from source(where source are available) without having both the gcc and g++ compilers(i mean c and c++ compilers).

The question I keep asking myself is this, where was Java when all these things are being developed using C.

I am not slighting Java because its actually my language of choice
@tomX (m)
Re: Java Or C++
« #45 on: June 04, 2008, 10:36 PM »

Well Java is great. I am in favour of C++ however.
Java users point out the strenght in Java and the weaknesses in C++ but Java has its Achiles heels too. I'll point out some of the weaknesses of java i.e. areas where C++ is known to out perform Java:

1. Speed - Because java is an "Interpreted code" it requires Java Virtual machine to interprete the programmes compilled byte code. This makes Java slower than equivalent native code produced by an optimised C++ compiler.

2. Poor low level access - Java has no pointers (while this is touted as one of it's strenght since it makes it simpler and easier to use) it is virtualy incapable of accessing a computer system on low level. This makes Java unsuitable for system software that perform such operations as calling BIOS and DOS subroutines and responding to interrupts. Java is not a good choice for writing operating systems, device drivers, and other low level code.

3. No Multiple inheritance - Java classes supports only single inheritance. In C++ a class may be derived from several base classes, while in Java a class may only be derived from one superclass. [a limited form of multiple inheritance is possible using Java interface clases but it does not compare to the more sophisticated form of multiple in C++]

4. No bBackward compability with C - Any legacy code written in C will have to be totally re-written if it's desired in Java. C++ compilers are however able to tranlate C.

5. No support for in-line functions - Java does not support in-line function but C++ does. The use of inline functions provide programmers with optimisation techniques which have a great impact on program runtime speed. Java does not support source-level optimisations, and the code optimisations supported by Java compilers are not language specific.

This are just a few I picked out of a Book by one of my favourite Java Authors. (Tom Swan).
There are many advantage/ disadvantages to both languages and there are many shared points too. it wouldn't hurt to learn both languages. I've learned close to 8 programming languages (not counting scripting languages) but my favourite is C++. Learn as much as you can. Both languages are great.
Ghenghis (m)
Re: Java Or C++
« #46 on: June 05, 2008, 12:24 PM »

Quote from: @tomX on June 04, 2008, 10:36 PM
1. Speed - Because java is an "Interpreted code" it requires Java Virtual machine to interprete the programmes compilled byte code. This makes Java slower than equivalent native code produced by an optimised C++ compiler.
You are not necessarily correct,  Java is compiled to bytecode then interpreted , thats the user friendly explanation. These days Java uses JIT (Just in Time Compilation),the run-time knows about the running environment and as such can take advantage of certain features/optimizations

Java programs can also be optimized by compilers

Quote from: @tomX on June 04, 2008, 10:36 PM
2. Poor low level access - Java has no pointers (while this is touted as one of it's strenght since it makes it simpler and easier to use) it is virtualy incapable of accessing a computer system on low level. This makes Java unsuitable for system software that perform such operations as calling BIOS and DOS subroutines and responding to interrupts. Java is not a good choice for writing operating systems, device drivers, and other low level code.
Yeah thats not necessarily a bad thing, what % of written code needs the kind of access you're talking about ?
Besides, there's JNI

Quote from: @tomX on June 04, 2008, 10:36 PM
3. No Multiple inheritance - Java classes supports only single inheritance. In C++ a class may be derived from several base classes, while in Java a class may only be derived from one superclass. [a limited form of multiple inheritance is possible using Java interface clases but it does not compare to the more sophisticated form of multiple in C++]
Cheesy Have you used multiple inheritance before ?
In C++ there's something called object slicing , now imagine a class that thats up cast to say i grandparent like say object, if you make a polymorphic call which parent should be called ? If thats confusing, then so is multiple inheritance ,
Besides inheritance is not the best form of reuse, HAS - A is better than IS-A blah  blah blah
Kids please stay away from multiple inheritance ,


Quote from: @tomX on June 04, 2008, 10:36 PM
4. No bBackward compability with C - Any legacy code written in C will have to be totally re-written if it's desired in Java. C++ compilers are however able to tranlate C.

hmmm, http://david.tribble.com/text/cdiffs.htm Tongue

Quote from: @tomX on June 04, 2008, 10:36 PM
5. No support for in-line functions - Java does not support in-line function but C++ does. The use of inline functions provide programmers with optimisation techniques which have a great impact on program runtime speed. Java does not support source-level optimisations, and the code optimisations supported by Java compilers are not language specific.

Absolutely wrong!!!!
Have you  heard of final methods, constant folding etc.

Quote from: @tomX on June 04, 2008, 10:36 PM
This are just a few I picked out of a Book by one of my favourite Java Authors. (Tom Swan).
There are many advantage/ disadvantages to both languages and there are many shared points too. it wouldn't hurt to learn both languages. I've learned close to 8 programming languages (not counting scripting languages) but my favourite is C++. Learn as much as you can. Both languages are great.
I agree with your summary though ,


Guys java has really matured, 13years in the making ,
people are getting to know more and do more,
java is not VB
hype time is over and the buzz is here
Say  HURRAY if you're a java programmer  Grin
javarules (m)
Re: Java Or C++
« #47 on: June 05, 2008, 01:23 PM »

C++ or Java, Its just a question of what is it you want to do.I am yet to see a very functional OS written from ground up with Java, there is one  OS on SourceForge some Jokers claim can compete with the likes of Unix and Linux, tried it and puff its blam.

So as I av said its a matter of what is it you want to do. If you want to write drivers, OSes and d likes i will definitely advise even the KIDS to stay with C++, but if you what you want is a compelling user interface across multiple screens of your live, write once run anywhere, intuitive technology backed by a Fortune 500 company and a community as large as you can have, with all the necessary hypes and buzz, then what you need is Java

Now I ask myself, will I rather write an OS or a Driver or a very good software that is actually usable? Its a matter of choice. I believe if C++ has the kind of backing Java has, it will also make sense for writing client side programs, even with IDE's it's still a little pain designing GUI's with C++.

What can't I give for Netbeans.

I beg leave story for market women java indeed rules.
lucianoefe (m)
Re: Java Or C++
« #48 on: June 05, 2008, 02:06 PM »

 hey my lovely niaja people,  rily missed u guys even though no one bothered to notice my absence,  love the topic here!!! i think i'll stick with c++ because i've seen some real life applications of the lang. Though, i'm yet to understand java well, 
cheers people.

Kiss
 MCSE: How Many Exams To Write?  Building Nigerians Programmers A Home  C++ or Delphi  Page 2
Pages: (1) (2) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.