4

I'm a slightly-below average programmer in C#, and I only write apps with GUIs. I might be getting a Mac soon. Since there isn't the .NET Framework or Visual Studio on Mac, I'm going to be using Xcode and Cocoa. I think this will be a good opportunity to switch to a well known and well supported language (C++). I learned C# very easily without knowing C, so I'm hoping that C++ will be the same. I also want to learn Java. What do you suggest I do? Can I write apps with GUIs in C++ and Java? (can i do this with the tools included with xcode?). Do you reccomend any books/sites that will help?

Thanks, David

Code Creator
  • 71
  • 1
  • 3
  • 3
    Don't fool yourself. C++ is a MUCH tougher animal than C#. I would suggest sticking with Java if you want a more similar language and framework. C++ will be a very tough learning curve for you and everyone who endeavors to work with it. Also give Mono a look. – Paul Sasik Aug 25 '10 at 04:08
  • 3
    C, C++ and C# are all very different languages. If you want to learn one of them, you're probably best served by forgetting most things you know about the other two languages. Seriously. Except maybe for the separate compilation / linkage stuff which is a concept shared between C and C++. As a "slightly-below average C# programmer" you'll probably have a hard time adjusting to C++. Better grab a *good* C++ book and learn the basic concepts from the start instead of getting confused by the misinformation on the web. – sellibitze Aug 25 '10 at 05:30

3 Answers3

7

What do you suggest I do?

Bootcamp.

Since there isn't the .NET Framework on Mac

Says who?

Can I write apps with GUIs in C++ and Java?

Of course.

Do you reccomend any books/sites that will help?

You are looking at one.
There are dozens of threads on how to get started with <X>. Look for them.

Community
  • 1
  • 1
NullUserException
  • 83,810
  • 28
  • 209
  • 234
  • 3
    Most of the stuff for a Mac is written Obj-C. Not C++ or Java. You can with WXWidgets some other stuff, and Java obviously has libraries but, Objective-C is *the* way of doing it on a Mac. –  Aug 25 '10 at 04:05
  • @thyrgle: not if you're interested in developing a cross-platform app. Java or C++ with Qt doesn't seem like a bad idea. – sellibitze Aug 25 '10 at 05:35
  • If you're doing some corporate-internal or vertical app where the user experience really doesn't matter and time-to-market is critical, Java or wxWindows will get you far. You'd never want to try to sell such an app to a Mac user, though, because it won't feel "Mac-like". Write the front-end in Objective-C and Cocoa, and link to back-end libraries written in C/C++. – samkass Aug 26 '10 at 17:56
7

If you're going to be writing Mac software, just learn Objective-C and Cocoa. Otherwise you won't be creating apps that "feel" right on the Mac, and customers won't be enthusiastic.

If your'e going to be writing iPhone software, you'll want Objective-C for UIKit unless you're going to be doing everything in OpenGL.

I'd also recommend learning C++ since it's standard and a lot of libraries are written in it. But I'd personally avoid C++ for direct UI work on Mac, Windows, or iPhone, but would recommend it for back-end library work.

samkass
  • 5,774
  • 2
  • 21
  • 25
  • More to the point, you *can't* write Cocoa apps in pure C++ unless you want to write a translation layer yourself. – Chuck Aug 25 '10 at 04:13
  • How does Photoshop feel? As far as I know, it's written in C++. – sellibitze Aug 25 '10 at 05:35
  • Up to the previous version, Photoshop was written in C/C++ to the old Carbon API, and it's the reason the move to 64-bits was delayed and customers complained. The latest version has the UI rewritten in Cocoa, which gave it better MacOS X integration and 64-bit support. The back-end is still likely C/C++, because Objective-C can natively link to that. Which is another reason I suggested learning both. – samkass Aug 25 '10 at 15:39
3

I did the jump a while ago.

You have to know how to manage memory. Don't worry, its tricky but its not that hard. You have to know about RAII and why it matters. I asked it once.

You won't have .NET Framework. You can and should rely on STL and Boost.

Finally you should take a look at QT. It is a library for GUIs

Community
  • 1
  • 1
Eric
  • 19,525
  • 19
  • 84
  • 147