C ++ from Java and Objective-C

So, I know both Java and Objective-C quite well, but (perhaps strangely) I never learned C ++. Obviously, all languages ​​are related to each other, but there are syntactic differences that I do not quite understand. Is there a good document that describes the basics of C ++, but still assumes that the student knows the programming language? Perhaps even a textbook whose purpose is to describe the differences between languages. This is what I am looking for.

Also, is there a good guide on using C ++ code inside a Mac or iOS application? The reason I feel the need to learn C ++ is because I am trying to port a program to C ++, and I heard that you can use C ++ code and just port it to the Obj-C GUI. Can someone point me to the documentation / tutorials on how to do this?

Thanks!

+8
java c ++ objective-c porting
source share
3 answers

Despite the fact that the languages ​​of this family are connected with each other, this does not mean that you can carelessly switch from one to another and expect to write beautiful code. You must learn linguistic idioms and features, test your strengths and way of thinking.

I would recommend reading the original Straustrup book (of course, a modern edition). This is the most specific reference (with the exception of the actual standard), and it is very clearly written. The advantage of this approach is that you will be taught to think “how would I do it in C ++”, and not “how to transliterate this piece of Java code so that it compiles”. (Also, this approach eliminates any risk that you might have to “learn C first . ” ).

On MacOSX, download and create a free GCC or get Xcode (which comes with GCC). For iOS, I don’t know, I have a suspicion that you cannot deploy your own code on it.

+6
source share

I would choose pure C ++ - the route, the quality of the material being a reference, rather than searching for ObjC + Java-> C ++.

At the university I'm working on, we tried both ways of teaching C ++ students with extensive programming experience, in particular Java experience, for obvious reasons.

The conclusion was that the specialized course did not help teach C ++ than the general one, with some additional exercise materials. This is important for the quality of training materials.

Edit: You are likely to get many good answers to the actual differences, as well as a Voo comment on your question.

+2
source share

I know how you feel - already worked in several languages ​​and studied C ++. I was in the same boat too. For some time I thought that it would be easy for me to learn right away, it was not so simple. So, I went back to the basics and became more recent to learn C ++. "C ++ Primer" is a very good book to start with. Since you know most of the basics of programming, some of the first few sections can be skipped. When you are done with this, I would recommend the book Effective C ++ and frequently asked questions about C ++ here [http://www.parashift.com/c++-faq-lite/].

In fact, you can first familiarize yourself with this FAQ and see which one makes sense, and use this as a guide to determine where to dive deep.

Hth, k

+2
source share

All Articles