wood burning stoves 2.0*
The moose likes Bunkhouse Porch and the fly likes Java to C/C++ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Books » Bunkhouse Porch
Bookmark "Java to C/C++" Watch "Java to C/C++" New topic
Author

Java to C/C++

Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Anybody have a suggestion for a preferred book for a Java developer to learn C and/or C++ programming?
My mind goes numb with the beginning C/C++ books I've started to read as so much of the material I already know from Java. It's just too boring reading page after page on for-loops and if-else constructs. But I find that I can't safely and quickly skim such material as I'm too likely to miss some small, barely mentioned feature specific to C/C++.
So, has the great "From Java to C/C++" book been written, yet?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

I'd recommend Andy Koenig and Barbara Moo's "Accelerated C++." It's not specifically for Java programmers, but it was the book that introduced the new style of teaching C++, which is not to start with C and add objects, but to start off using, e.g., the string class right away. So you won't find page after page of introductory syntax. The syntax is intermixed with learning to think in terms of standard containers and algorithms. It's a small but powerful book.


[Jess in Action][AskingGoodQuestions]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9052
    
  12
How about C++ for Java Programmers by Timothy Budd.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
I recommend Koenig and Moo�s Accelerated C++.
I have been studying C++ for a couple of months. When I started, I experimented with the following books.
C++ Primer by Stanley Lippman
Essential C++ by Stanley Lippman
C++ for Java Programmers by Timothy Budd
Accelerated C++ by Koenig & Moo
The C++ Programming Language by Bjarne Stroustrup
I decided to use Accelerated C++, and follow up with The C++ Programming Language. C++ for Java Programmers is an interesting and entertaining supplement.
[ February 20, 2004: Message edited by: Marlene Miller ]
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Here is a description from Accelerated C++ by Koenig & Moo about their approach to teaching C++.
The first part concentrates on programs that use the standard-library abstractions. The second part talks about defining your own abstractions.
Presenting the library first is an unusual idea, but we think it is right. Much of the C++ language � especially the harder parts � exist mostly for the benefit of library authors. Library users don�t need to know those parts of the language at all. By ignoring those parts of the language until the second part of the book, we make it possible to write useful C++ programs much more quickly than if we adopted a more conventional approach.
Once you have understood how to use the library, you will be ready to learn about the low-level facilities on which the library is built, and how to use those facilities to write your own libraries. Moreover, you will have a feeling for how to make a library useful and when to avoid writing new library code altogether.
Although this book is smaller than many C++ books, we have tried to use every important idea at least twice, and key ideas more than that.�

[ February 20, 2004: Message edited by: Marlene Miller ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Thanks for the advice.
The title of Timothy Budd's book sure fits the bill. I'll have an eye out for it.
Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
Dirk, a word of caution...
As one amazon reviewer has pointed out,

This book was mistitled. It should have been "Differences Between Java And C++: A Crunch Translation Guide". Like an English-LanguageX translation guide (or a culture-to-culture translation guide, for that matter), this book is intended to identify the sorts of things that a Java developer jumping into C++ with no background in C++ would typically incorrectly presume or fail to correctly presume without having been told. To that end, this is an excellent, one-of-a-kind book that immediately immerses the reader into very significant and important differences between the languages regarding everything from syntax to compilation and execution.

Even so, when I am reading through Accelerated C++ and I come across something Java-like but not really, or never seen before in Java, I would rather refer to The C++ Programming Language by Stroustrup for a complete description of the C++ way.
Budd's book is good for highlighting and introducing the differences. It is an interesting and helpful supplement.
[ February 29, 2004: Message edited by: Marlene Miller ]
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Even if you are a Java veteran, this book will always be the one to read and do exercise with, "C Programming Language". This isn't actually a beginner guide, it requires alot of thinking and exercise.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Originally posted by Adrian Yan:
"C Programming Language".


K&R is a wonderful book, but folks who teach C++ for a living have developed a very different way of teaching that language in recent years, and that new way definitely does not include learning C first. C++ isn't thought of anymore as C plus some extra stuff; it's a higher-level language that is compatible with C. I'd not have a C++ newbie pick up "The C Programming Language" until they had become quite conversant in C++.
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
I tho Dirk wants to learn C/C++. The common mistake for alot of people when they say I want to learn C/C++ (&& ||) , they don't realize there are many differences between them (C++ has much more features than C). From my personal experience, comparing C to C++ is not clear or precise, C++ is more comparable to Java.
I'm not a C++ guy, so I can't comment on how to learn it (I know the basics). As far as learning C goes, you can't beat "C Programming Language".
James Chegwidden
Author
Ranch Hand

Joined: Oct 06, 2002
Posts: 201
My thoughts from a teacher that teaches programming:

1. The K & R C book is a good book. Too advanced for newbies. Have the book as a reference for my C course.

2. C is technically a subset of C++ (except with C99)

3. You can learn C++ first without knowing C.

4. C is the "grandfather" of C++, Java, and C#.

5. There is still debate whether to teach C++ or Java first to newbies. Look at the college/university level.

6. C# is actually more like Java than C++. I can see saying C++ is like Java.


JC




Author and Instructor, my book
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
How many kind of C++ and C are there I have heard like Miscrosoft Visual C++ , Borland ... etc...
and what are their differences???


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Dom King
Greenhorn

Joined: May 19, 2004
Posts: 18
It should be noted that Java developers who need to learn C++ can still make use of the rich Java API in their new language. This approach (native C++ coupled with the Java API) lowers the learning curve dramatically and smoothes the transition. Several solutions exist for accomplishing this.

One is NewJ Library for C++, which implements the Java API (and Java language features) in native C++, for C++. NewJ apps run 100% native and do not require a VM or JRE for development or deployment.

Another is NewJNI (included with NewJ), which provides a natural C++ interface to VMs, JREs, and JNI. NewJNI makes Java objects and interfaces feel like real C++ objects.

As an aside, like Timothy Budd's book, the NewJ Library for C++ Developer's Guide discusses the intricate differences between Java and C++ and warns Java-to-C++ developers about the rocks beneath the surface.

More information here:
http://www.pure-native.com/newj.html
http://www.pure-native.com/support.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java to C/C++