• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

java [What are the differences between Java and C++?]

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what are difference between the java and c++?
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This one & this from wikipedia have some good comparisons. And please carefully choose one forum when posting here.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this recent topic.

Please use a meaningful subject line instead of "java" when you post a question.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
these are the techniques which are not allowed in java but allowed in c++

Pointers
Structures & unions
Operator overloading
Multiple inheritance
Goto operator
Automatic type conversion
Destructors
Unsigned integers
 
Rancher
Posts: 4686
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

s.palanivel rajan wrote:these are the techniques which are not allowed in java but allowed in c++

Pointers


Thank the gods, pointers are how you program in assembly language. They are the source of untold bugs.

s.palanivel rajan wrote:Structures & unions



While technically correct, a java Class is the same as a 'struct' if you don't have any functions.

s.palanivel rajan wrote:Operator overloading



This was popular in languages designed in the 70s, Ada, C++, etc. And the example was always dealing with Strings or Complex numbers.
The problem is, that a decent language should have Strings (and probably Complex) build in, and when you have that, then the obvious uses of operator overloading are rare.

s.palanivel rajan wrote:Multiple inheritance



The bain of my existence when I was a C++ developer

s.palanivel rajan wrote:Goto operator



GOTO considered dangerous. Was true when Djkistra wrote it, and is still true today

s.palanivel rajan wrote:Automatic type conversion



Actually, Java has this for some cases. Strict language designs discourage it.

s.palanivel rajan wrote:Destructors


another huge source of bugs, handling destuctors properly with exceptions is a real challange.

s.palanivel rajan wrote:Unsigned integers


I don't see this as a problem, but not having unsigned byte data is a pain for crypto code
 
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.
 
Pat Farrell
Rancher
Posts: 4686
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Fred Hamilton wrote:As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.



In practice, this is true for perhaps as much as one percent of all applications. Or rather, the claimed performance improvement is worthwhile in as much as one percent of the cases. The rest of the time, i.e. the vast majority of all times, the programmer productivity gained by not having to worry about stuff like destructors and memory allocation is a net win.

A decade or more ago, the performance penalty was real and had more impact. With modern JIT optimizations, its rare when the real world performance is an issue, its nearly always the DBMS or the Webserver or the user that is the bottleneck.

A lot of the things that are "more control" are things that humans do not do very well.

 
Fred Hamilton
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Pat Farrell wrote:

Fred Hamilton wrote:As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.



In practice, this is true for perhaps as much as one percent of all applications. Or rather, the claimed performance improvement is worthwhile in as much as one percent of the cases. The rest of the time, i.e. the vast majority of all times, the programmer productivity gained by not having to worry about stuff like destructors and memory allocation is a net win.

A decade or more ago, the performance penalty was real and had more impact. With modern JIT optimizations, its rare when the real world performance is an issue, its nearly always the DBMS or the Webserver or the user that is the bottleneck.

A lot of the things that are "more control" are things that humans do not do very well.



Well sure, no disagreement, if programmer productivity is a prime concern, then yeah. But I was talking about cases where performance is a prime concern, and programmers that can make use of the control.
 
Popeye has his spinach. I have this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic