473,889 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

On Java and C++

Java programmers seem to always be whining about how confusing and
overly complex C++ appears to them. I would like to introduce an
explanation for this. Is it possible that Java programmers simply
aren't smart enough to understand C++?

This is not merely a whimsical hypothesis. Given my experience with
Java programmers --- the code they write and the conversations they
have --- Occam's Razor points to this explanation. For example,

"Oooh I'm confused about the difference between pointers, references,
and objects! How confusing!"

"Oooh operator overloading confuses me! The expression x + y is so
confusing, who knows what's happening with that? If x and y are
complex numbers, what the hell could x + y mean?"

"Oooh multiple inheritance is so confusing! Though I am both a father
and a programmer, I still find it so confusing how the same object can
be two different things! How confusing!"

"Oooh and virtual bases are so bizarre! I am a student --- myself
'the father' is the same student as myself 'the programmer' --- but
nonetheless the idea of virtual bases is absolutely confounding and
confusing to me!"

Again, Occam's Razor is a valuable tool here. In deciding among
competing hypotheses, choose the simplest one. To impartial observers
of indoctrinated Java programmers, the explanation is simple indeed.

Apr 26 '06
458 21648
On Tue, 02 May 2006 21:49:07 GMT, Phlip <ph*******@gmai l.com> wrote:
People are learning that technology in their lives that fails the most often
is software. And C++ is leading the charge.


Do you have a credible citation for that? The C++ part I mean. Thanks.
May 3 '06 #311
JustBoo wrote:
People are learning that technology in their lives that fails the most
often
is software. And C++ is leading the charge.


Do you have a credible citation for that? The C++ part I mean. Thanks.


If I made it up, I could also make up "C is leading the charge", because
that's the language all these penetratable systems are usually written in.
Same difference, and yes I agree with Werner that robust and bullet-proof
C++ is easy to rapidly write...

Click the link I provided; it's a symptom of a major source of these
defects. And many shops hire people to read the code and review it looking
for nothing but these obvious problems.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
May 3 '06 #312
peter koch wrote:
Walter Bright skrev:
Roedy Green wrote:

...
This principle is evident in things like power tools and aircraft
design. In the former, you've got to do extra work to remove things like
guards and safety interlocks. In aircraft design, one of the terrible
no-no's is for a mechanic hook up the flight controls backwards. So the
designers go to great lengths to make it very hard for the mechanic to
do so, hopefully hard enough so that at some point the mechanic realizes
he must be doing something wrong. If it's easy to install the flight
controls backwards, sooner or later it will be, with deadly consequences.


I do not disagree with you here. C++ is not the perfect language,
inheriting as we all know some of the bad stuff from C - including
arrays.
What you can do is not teach beginners about e.g. pointers, build in
arrays and stuff like that. Just as e.g. Koenig and Moe do in their
introductory text.

I myself, and probably many people out here use C++ only because they
naturally come to C++ from C.
In my opinion, C was very good language for his time. It was not safe,
but it was very clear. You always knew exactly what is going on.
C++, on the other side, is current, very bad overcomplicated language. I
myself use it only because it easily allows me to use only small subset
of it's features and still use Microsoft MFC relatively efficiently. I
am sure this ability to use small subset of C++ (which programmer is
familiar with) is what allows C++ to still be generally popular language
now.
If you will strongly insist on using only new, 'SAFE' C++ features there
will be no reason at all to use C++, it will quickly become small niche
language to addicted.
May 3 '06 #313
peter koch wrote:
Roedy Green skrev:
On 27 Apr 2006 12:31:12 -0700, "peter koch"
<pe************ ***@gmail.com> wrote, quoted or indirectly quoted
someone who said :
This is ridiculous - like claiming you only know to drive a car with
automatic shifts because manual shifts are all to difficult. I do not
know what gear to use!

come on. There are alternate notations that generate the same
assembler code. That is a legacy wart, not a feature.


Are you talking about C++ references and C++ pointers? While they might
be identical under the covers, they have widely different semantic uses
and you can't substitute one for the other.

C++ references are not SO different from pointers. Just like Roedy Green
said - one more addressing mode. I doubt any well designed language
(like Java) would have (or has) references.
May 3 '06 #314
Walter Bright wrote:
Mishagam wrote:
I think the fact that nobody uses D means suggests that it has not
only one stupid feature, but a lot of stupid features.


For a stupid language nobody uses, the D programming language is doing
remarkably well, having moved up to number 19 on
http://www.tiobe.com/tpci.htm

One part of being uninformed about language is being uninformed about
this language status ;)
But still asking "OK, are there any stupid features in D?" in this
thread is not very clever, because in this thread we talked about C++
and Java most people knew about, and because most people here don't know
D nobody knows D stupid features and so D language could get unfair
advantage.
This is why I posted my answer (at the top).
May 3 '06 #315
Luc The Perverse wrote:
"Oliver Wong" <ow***@castorte ch.com> wrote in message
news:9GQ5g.4422 $Fg4.335@clgrps 12...
"Walter Bright" <wa****@digital mars-nospamm.com> wrote in message
news:ia******** *************** *******@comcast .com...
Mishagam wrote:
I think the fact that nobody uses D means suggests that it has not only
one stupid feature, but a lot of stupid features.
For a stupid language nobody uses, the D programming language is doing
remarkably well, having moved up to number 19 on
http://www.tiobe.com/tpci.htm

(referring to http://www.tiobe.com/tiobe_index/images/tpci_trends.gif
as of May 2nd, 2006): I wonder what happened in 2004 that made Java drop
considerably, and everything else jump up a bit.


It would appear that the rise in Python users (From virtually nothing)
corresponds almost exactly with the drop in Java users. VB also rose,
which probably stole a little java use.

There are many strange features in this chart. Why C always so much
higher than C++? Why VB started growing now when it is losing MS support
and there isn't any reason to use VB?
What is measured here anyway?
May 3 '06 #316
On Wed, 03 May 2006 00:33:04 GMT, "Phlip" <ph******@yahoo .com> wrote:
JustBoo wrote:
If I made it up, I could also make up "C is leading the charge", because
that's the language all these penetratable systems are usually written in.
Same difference, and yes I agree with Werner that robust and bullet-proof
C++ is easy to rapidly write...
Yep. All it takes is learning ones craft, rather than wanting the
"tool" to do all the work for one. (Btw, I've read enough of your
posts to know *you have* learned your craft, so absolutely nothing
personal in this reply. But then we have the Java guys....)
Click the link I provided; it's a symptom of a major source of these
defects. And many shops hire people to read the code and review it looking
for nothing but these obvious problems.


http://c2.com/cgi/wiki?MicrosoftSampleCode

That link right above? Dude... man... that's ALL straight C code. I
don't see a C++ construct anywhere in sight. :-D

If you drop your keys into molten lava just let 'em go
'cause, man, they're gone. - Jack Handey
May 3 '06 #317
"Mishagam" <no*****@provid er.com> wrote in message
news:D7******** ***********@sou theast.rr.com.. .
Luc The Perverse wrote:
"Oliver Wong" <ow***@castorte ch.com> wrote in message
news:9GQ5g.4422 $Fg4.335@clgrps 12...
"Walter Bright" <wa****@digital mars-nospamm.com> wrote in message
news:ia******** *************** *******@comcast .com...
Mishagam wrote:
> I think the fact that nobody uses D means suggests that it has not
> only one stupid feature, but a lot of stupid features.
For a stupid language nobody uses, the D programming language is doing
remarkably well, having moved up to number 19 on
http://www.tiobe.com/tpci.htm
(referring to http://www.tiobe.com/tiobe_index/images/tpci_trends.gif
as of May 2nd, 2006): I wonder what happened in 2004 that made Java drop
considerably, and everything else jump up a bit.


It would appear that the rise in Python users (From virtually nothing)
corresponds almost exactly with the drop in Java users. VB also rose,
which probably stole a little java use.

There are many strange features in this chart. Why C always so much higher
than C++? Why VB started growing now when it is losing MS support and
there isn't any reason to use VB?
What is measured here anyway?


It would be funny if it were something dumb - like number of applications
being run by what they are written in

--
LTP

:)
May 3 '06 #318

Mishagam wrote:
C++ references are not SO different from pointers. Just like Roedy Green
said - one more addressing mode. I doubt any well designed language
(like Java) would have (or has) references.


Java has references.

May 3 '06 #319
Noah Roberts wrote:
Mishagam wrote:
C++ references are not SO different from pointers. Just like Roedy Green
said - one more addressing mode. I doubt any well designed language
(like Java) would have (or has) references.


Java has references.

Excuse me. I meant separate references and pointers with so close
functions. Java has references, but they have also some features of C++
pointers like they can be null.
May 3 '06 #320

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6823
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what the issue is. Thanks Ravi
1
6927
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
9298
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
0
5664
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to connect to the DB I get the following exception at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2120)
1
9675
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
12
5939
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it says: usage: java fit.FitServer host port socketTicket -v verbose I think this is because I do not understand the jython mechanism for inheritance (yet).
0
3295
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)) and in both cases, get the following list returned from calling getDeclaredFields() on java.lang.ClassLoader via this code snippet: Field fields = loaderClass.getDeclaredFields(); for (int i = 0; i <...
1
4314
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in Linux there is an error. The code that fails is the following: SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); I´m sure that code is ok. In fact, I´ve found that in several...
0
3304
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
11188
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10789
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10889
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5828
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6028
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4647
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.