473,842 Members | 1,887 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 21557
In article <e3**********@o nline.de>, ma*****@bossmai l.de
says...
Im sometimes amazed at how many people seem to know.
mostly its the "CV" effect.
People put gazillions of languages in their CVs to make it look
impressive.
That depends -- some of us learn a lot of languages
simply because languages we learned early on have gone
out of style to some degree or other. Back when I was a
whole lot younger, I wrote a fair amount of code in
FORTRAN IV, Pascal, SNOBOL, APL, and assembly languages
for PDP-11's, CDC Cyber mainframes and most of the old 8-
bit CPUs (6502, 8080/8085/Z80, etc.)

Most of these are simply of little or not practical use
for what I'm doing now -- my choices were to learn new
languages or start some entirely different occupation.

[ ... ]
i mean i think the sentence:
"Most of the messages in this thread appear to be written by people who
only know one programming language."
is meant like:
you know this language well and have worked full time with it in a
professional environment for some years.
Personally, I think that's a bit excessive. In fact, the
requirement that you work with it full-time for some
years more or less makes it a tautology that nobody
really CAN know more than one language by this
definition. If you use two languages on a regular and
ongoing basis, clearly you're using each of them only
part of the time.

[ ... ]
I also think every language has its strenghts and weaknesses.
True knowlegde of the language means also knowing which language suits
best fo the desired task.
There is no better or worse.


IMO, you're displaying a high level of ignorance here. Go
study Brainfuck or Intercal, and then try to keep a
straight face while you claim they're not worse!

--
Later,
Jerry.

The universe is a figment of its own imagination.
May 7 '06 #441
Jerry Coffin wrote:
Personally, I think that's a bit excessive. In fact, the
requirement that you work with it full-time for some
years more or less makes it a tautology...

Well i do also worked with some amount of languages for a while... but i
know the difference between "I wrote a fair amount of code" and "I
worked with this language for a couple of years".

There is no better or worse.

IMO, you're displaying a high level of ignorance here. Go
study Brainfuck or Intercal, and then try to keep a
straight face while you claim they're not worse!


well fine... then tell us which is the master language, that 0wnz all
other? you seem to know.
May 7 '06 #442
In article <e3**********@o nline.de>, ma*****@bossmai l.de
says...

[ ... ]
There is no better or worse.

IMO, you're displaying a high level of ignorance here. Go
study Brainfuck or Intercal, and then try to keep a
straight face while you claim they're not worse!


well fine... then tell us which is the master language, that 0wnz all
other? you seem to know.


Not at all -- as I pointed out, some are worse. I'm not
at all sure that means there's one that's better than all
others. If there is, I'm not at all sure what it would
be.

--
Later,
Jerry.

The universe is a figment of its own imagination.
May 7 '06 #443
In article <u4***********@ hotmail.com>,
Tor Iver Wilhelmsen <ja********@hot mail.com> wrote:
bc*@pvv.ntnu.n o (Bent C Dalager) writes:
The day we have a programming language that is so good a monkey could
produce quality software with it is the day we have won.


No, then we get replaced by monkeys, and have to drive taxkis to make
a living. Unless cars get so automated monkeys can drive them, too.


I expect we are referring to different 'we's :-)

I wouldn't mind if programming became so easy I could be replaced by a
monkey. I can always find something else interesting to do, and it
would do miracles for society if software development projects became
effectively free.

Cheers
Bent D
--
Bent Dalager - bc*@pvv.org - http://www.pvv.org/~bcd
powered by emacs
May 7 '06 #444
In article <e3**********@o rkan.itea.ntnu. no>,
bc*@pvv.ntnu.no says...
In article <u4***********@ hotmail.com>,
Tor Iver Wilhelmsen <ja********@hot mail.com> wrote:
bc*@pvv.ntnu.n o (Bent C Dalager) writes:
The day we have a programming language that is so good a monkey could
produce quality software with it is the day we have won.


No, then we get replaced by monkeys, and have to drive taxkis to make
a living. Unless cars get so automated monkeys can drive them, too.


I expect we are referring to different 'we's :-)

I wouldn't mind if programming became so easy I could be replaced by a
monkey. I can always find something else interesting to do, and it
would do miracles for society if software development projects became
effectively free.


While I agree, I don't think it's a reasonable
expectation or even goal. I don't think I'm even going
out on a limb very far to say that nothing we can hope
for in the way of a programming language will really make
much difference in this regard. The real difficulty
involved in a software project is rarely writing the
code. The real difficulty is deciding what the software
should do. Perhaps I lack imagination, but I don't see
much way for a language to help much in making that kind
of decision -- in fact, most of it is entirely
independent of any programming language at all.

--
Later,
Jerry.

The universe is a figment of its own imagination.
May 8 '06 #445
I wouldn't mind if programming became so easy I could be replaced by a
monkey. I can always find something else interesting to do, and it
would do miracles for society if software development projects became
effectively free.

Computers are great, but they lack one thing: Intelligence. If you want them
to do something, you've to tell them EXACTLY what way to do it -- they don't
take any hints.

Monkeys have intelligence, but not as much of it as we humans do --
therefore we'll always be the better programmers.

So, maybe if you wanted cheap programming, you could approach the monkey
industry, and if you wanted high-quality programming, you could approach the
few remaining human programmers (assuming the monkey industry kicks off).
-Tomás
May 8 '06 #446

"Jerry Coffin" <jc*****@taeus. com> wrote in message
news:MP******** *************** *@news.sunsite. dk...
In article <e3**********@o nline.de>, ma*****@bossmai l.de
says...
I also think every language has its strenghts and weaknesses.
True knowlegde of the language means also knowing which language suits
best fo the desired task.
There is no better or worse.


IMO, you're displaying a high level of ignorance here. Go
study Brainfuck or Intercal, and then try to keep a
straight face while you claim they're not worse!


Brainfuck and Intercal are not "worse" at what they were designed for:
to be difficut to program and maintain in. In fact, these languages are,
IMHO, one of the best for the task of confusing the programmer and the
reader. Use the right tool for the job and all that.

- Oliver

May 8 '06 #447

Otis Bricker wrote:
Actually, your example from before shows that i MIGHT change. At least
logically change.

class I{
int & handle;
public:
I(int& x):handle(x){};
void morph()const{
handle++;
}
void dump(){
cout<<handle<<e ndl;
}
};

void foo(I i){
i.morph();
}

I guess you could argue that it was the int& that changes. But clearly,
the state of the original i is not the same before and after that call.


Actually, considering this further I in fact does not change, neither
logically nor semantically. The object that handle refers to is not
part of I. I itself cannot change and won't...this is guaranteed
(short of the mutable keyword). What is not guaranteed is that an
immutable object won't mutate any other object that is mutable. I
believe this is a good thing.

Clearly, the state of the original i is the same both before and after
that call. Nothing about i has changed but objects that i refers to
have...and i itself made those changes. The value of the object handle
refers to is not part of the state of i.

The above case is actually perfect for explaining why... If in fact
the value of the int handle refers to where part of I instances then it
would not be necissary, nor wanted, to use a reference. The fact that
i accepts a non-const reference to an int and assigns it upon
construction to its own non-const reference to that same int means that
int is not a part of I instances and is not intended to be. This int
should be, and is by the compiler, considered a reference to an
_external_ entity. Such entities cannot be considered a part of I
instances, only the references can be...and that reference couldn't be
changed even if it where implemented in the form of a pointer, which
unlike references can be reseated.

To further illustrate the point:

int x = 5;

I i(x);

x = 7;

x has been changed without talking to i in any way...therefor it is not
a part of i and cannot be considered to be so...logically or otherwise.
If alterations to the value of x cause i to change its behavior it is
because i's behavior is based on an external input...not because this
value is part of i's state.

May 8 '06 #448

Mishagam wrote:
There are many strange features in this chart. Why C always so much
higher than C++?


Probably because they count most C++ as C programmers too, with the
common notion that people program in C/C++. C is thus higher when you
add in those who program only in C.

And then there are all those device-driver programmers.

May 10 '06 #449

Tomás wrote:

Computers are great, but they lack one thing: Intelligence. If you want them
to do something, you've to tell them EXACTLY what way to do it -- they don't
take any hints.

Monkeys have intelligence, but not as much of it as we humans do --
therefore we'll always be the better programmers.

So, maybe if you wanted cheap programming, you could approach the monkey
industry, and if you wanted high-quality programming, you could approach the
few remaining human programmers (assuming the monkey industry kicks off).


But are programmers employed for their intelligence? Or for having
played with all the right toys and for having taken the career path
that the HR desire them to have.

May 10 '06 #450

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

Similar topics

0
6821
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
6923
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
9294
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
5662
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
9668
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
5935
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
3292
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
4310
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
3301
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
10940
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...
1
10670
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
10308
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...
1
7854
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7030
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5695
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...
1
4499
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
4087
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3141
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.