• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java to C/C++

 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about C++ for Java Programmers by Timothy Budd.
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1392
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".
 
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How many kind of C++ and C are there I have heard like Miscrosoft Visual C++ , Borland ... etc...
and what are their differences???
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic