This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes java is for idiots and C++ is for geniuses ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java is for idiots and C++ is for geniuses ??" Watch "java is for idiots and C++ is for geniuses ??" New topic
Author

java is for idiots and C++ is for geniuses ??

Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
my computer teachers college professor once said this . what are ur comments. no emotional replies plz, give backed up statements.

this will decide whether i lean c++ or java first.

Ali
Steve JK
Greenhorn

Joined: Jun 16, 2004
Posts: 5
Hi Ali,

To answer your question, both languages have their strengths and weaknesses. C++ is not necessarily harder than Java.

In fact, JAVA is a very powerful language that is platform independent unlike C++.

Fair enough, if you are writing computer games then C would hold the advantage, but for applications JAVA is very stable, has lots of support out there and does not take ages to program the simple things (like windows, menu's etc like it would in C++).

Hope that helps,
Steve


Happy Coding all!
Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
u said, that c++ takes time for simple things such as menu and stuff
wont it be easier if i used say visual c++ program??

tell me about performance? in industry where is c++ used and where is java???

and one more thing. can a program made in java connect to a flash program??? that is exchange data? can c++ can??

Ali
Igor Ko
Ranch Hand

Joined: Jun 24, 2002
Posts: 90
Good title.

It is simple, see explanation why Microsoft invent now .net and c#
Because normal programmer can't write server that works 24 hours, 7 days in
week without reboot in C, C++. There will be a lot of bugs in a typical program with multi-threading and dynamic data structure. And you must
be professional and spend a lot of time to catch them.

Language with garbage collection (likes Java, C#) much
more stable, and easy to use in such cases.

So you can think less about memory leaks,
or wrong pointers, stack overflow, strings library, thread synchronization,
bugs and features of your OS...

But more about what your program must do.

Price for it is CPU/memory usage, but now computers double
its power each 1.5 years (about).

---------------------------------------------------------------
Yes, C++ is more complex language than java.
But it will be fixed in new java release

see version 1.5
(generics,function with variable number of arguments, auto boxing/unboxing,
language built-in class enum, and other complicate features)
[ June 16, 2004: Message edited by: Igor Ko ]
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

writing computer games then C would hold the advantage


I disagree with this statement. Java is coming into the games market very quickly. Game programmers are realizing the advantage of writing cross platform game code. As far as performance goes, there is very little difference in Java verses C. I have seen very good games built with Java and performance is not an issue at all.


Barry
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
In the industry, it is simply a matter of using the best tools for the job. If Java is more suitable for my work than C++ or my client dictates that I uses Java over C++, I'd use it, and vice-versa.

If you ask a C++ programmer (probably your professor) he'd condemn Java and vice-versa, best way is for you to learn both & find it out yourself! That way you'd become more marketable & can make a sound judgement for yourself.

Besides, I don't believe having a Phd is equivalent to knowing everything. Nowadays, there're many academics who are just ... academics, i.e., they have entirely no (or very little) working experience, never been out in the industry long enough. They just spend their lifes in school.
[ June 16, 2004: Message edited by: Cheng Wei Lee ]

SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Ali Gilani
Ranch Hand

Joined: Mar 01, 2002
Posts: 137
but isnt c++ more of a 'multi-platform'?? think about it. all u have to do is take the c++ code and run it thru a different compiler and it will work great on a windows, linux or Mac and will load faster than Java???

comments??

Ali
Warren Dew
blacksmith
Ranch Hand

Joined: Mar 04, 2004
Posts: 1332
    
    2
I'd recommend you interpret the original quote as follows: 'Java is sufficiently straightforward that a normal human being can write good code in it - even an idiot can use it. C++ is sufficiently complex and crufty that it takes a genius to produce a good product with it.'

And no, you can't just run C++ code through different compilers and have it work on different platforms. Different compilers accept different dialects of C++, and different platforms have different libraries for interacting with the system, so porting C++ code always requires some effort - sometimes so much effort that it's easier to rewrite the application from scratch for the new platform.
Dmitry Melnik
Ranch Hand

Joined: Dec 18, 2003
Posts: 328
all u have to do is take the c++ code and run it thru a different compiler and it will work great on a windows, linux or Mac

...only if the code does not call any platform-specific APIs, which is not the case if you want to implement GUI for instance
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
Just a note: "Harder" does not equate to "Better." Someone said, Java is catching up with complexity, look at all the fun new things in 1.5. I would argue that more complex, extra things to have to know, does not mean better. To the contrary, I would argue that more complexity without otherwise gain equates to "worse." C++ is somewhat rawer, and thus requires one to know alot more to write complex programs in (where would I put that preposition to get it away from the end of the sentance?). However, this is a detriment, not a benefit. Java is extremely fluid, which is partly why I'm a bit wary of these new generics.


I've heard it takes forever to grow a woman from the ground
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
No Joseph. 1.5 will make programming a lot easier. Sun say so themselves...
Just as the C++ STL makes programming a lot easier (yah, you wish...).


42
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

Originally posted by Joseph George:
Just a note: "Harder" does not equate to "Better." Someone said, Java is catching up with complexity, look at all the fun new things in 1.5. I would argue that more complex, extra things to have to know, does not mean better.


I thought he was just being sarcastic.

While I share some of your apprehensions about the new features in 1.5, I also think that with the new "power" comes the responsibility to understand how to use it properly. See my comments in this thread.

As for the question about C++ vs. Java, see Allen Holub's bio at the end of this article: "He now looks at C++ as a bad dream..."


Junilu - [How to Ask Questions] [How to Answer Questions]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Here's one way to look at the strengths of Java ... I'm in the insurance call center biz and I'd like every line of code I write (or read!) to sing about insurance or customer service. Every bit of code that I have to dig through for housekeeping or computer-science-major cleverness is lost productivity in delivering insurance functionality. Java rates fair to good here. Our team produces quite a few classes with almost all insurance logic, but still has too many that keep our frameworks happy. C++ rates, um, less well. You spend a lot more time keeping the compiler happy, or parsing punctuation just as carefully as the compiler to get the correct undertstanding of what code does.

That's only one measure, tho. Make a prioritized list of the most important things to you - performance, portability, compile time, disk footprint, memory footprint, low level OS access, productivity, look & feel, learning curve, resume building, ease of modification, commercial or open-source frameworks, interoperability, etc. and grade several languages on each point. See what you come up with. Better yet, show us what you come up with!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by Junilu Lacar:

As for the question about C++ vs. Java, see Allen Holub's bio at the end of this article: "He now looks at C++ as a bad dream..."


Then how come he kicks against Java every chance he gets in his book and steadfastly refuses to honour things like naming conventions?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

Originally posted by Jeroen Wenting:

Then how come he kicks against Java every chance he gets in his book and steadfastly refuses to honour things like naming conventions?


I haven't noticed or seen this. Can you give some links/references?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Check out the article linked to here on JavaWorld, and especially the previous installments of his column there.

He refuses to use CamelCase, instead using underscores.
That's only the most visible of it, but symptomatic.
Essentially he disagrees with just about anything that's different in Java from the way it works in C++ in his book.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

I see your point about the camel case although I wouldn't go so far as to conclude that his nonconformity stems from not liking the language. Which of his books are you referring to?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Why does Alan complain about everything? Because controversy sells, and conformity doesn't. That's his niche.


[Jess in Action][AskingGoodQuestions]
Carl Wilburn
Greenhorn

Joined: Jun 17, 2004
Posts: 9
i believe you will find java easier to learn initially than c++ (or c). it eliminates some of the complexities of c++ such as pointers. java is a fairly pure object oriented language whereas c++ is a mixture of the old and new. most commercial interest is in java and not c++. there are far fewer coding changes between platforms when using java.

to become truly skilled in either language will require some years of experience. java makes it easier to write a gui or a threaded application, but to do it correctly, you will have to do your time.


Live, learn and do!
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
A common statement demonstrating pure ignorance and nothing of any value - typical academia stuff.


Tony Morris
Java Q&A (FAQ, Trivia)
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by Junilu Lacar:
I see your point about the camel case although I wouldn't go so far as to conclude that his nonconformity stems from not liking the language. Which of his books are you referring to?


His threads book.
Just a typical statement is the very first line of chapter 10: "In a way, the preceding chapters are a litany of everything wrong with the Java threading model...".

In many ways, that's the tone of the entire book, Java is basically flawed and if only it would be like C++ it would be good. Let Holub guide you on the path to make Java like C++.
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
1. The Java compiler and run time environment catch (with good error messages) many programmer errors that give obscure messages or just result in bugs or (even worse) leave holes for virus writers in C++.

2. For historical reasons (the early C++ implementations compiled into C), basics like variable size are implementation dependent, making porting an adventure.

3. There is a much stronger trend towards style standards in Java. There are also fewer redundant alternative ways to do things. This means that it's usually easier to pick up and understand someone else's Java source. SDK 1.5 may change this.

4. System code, and games that operate at low levels of abstraction, need the strong pointer manipulation of C and C++. You can do the same things in Java but it gets even more complicated than really messy C. See some of the Java library code.

5. Even with HotJava (sp?), good Java programs require more machine cycles than good C++ programs. However, few applications are so computationally intense as to show any difference.

6. I don't know if javac is written in java, but I'm sure the JVM's are written in C or C++, possibly with some assembler code.

7. The most important issue is: what jobs are available to beginners where you plan to live?


Mike Gershman
SCJP 1.4, SCWCD in process
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
One more comment: There are different kinds of geniuses.

Einstein wrote an excellent book explaining the theory of relativity to laymen.

Jim Gosling has written excellent books on basic Java for working programmers.

Bjarne Stroustrup only writes for the high priesthood of really bright people. His basic example in "The C++ Programming Language" is a recursive descent parser, very familiar to the beginning programmer - NOT!
[ June 18, 2004: Message edited by: Mike Gershman ]
 
jQuery in Action, 2nd edition
 
subject: java is for idiots and C++ is for geniuses ??
 
Similar Threads
What are virtual functions ?
shell
Extend a JNI wrapped class
Java vs C# (balanced view)
newby with Java I am trying to get a app compiling.