Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving from Windows API to Mac OS

I'm a Windows (native, not .NET) programmer and I'd like to port an application to the Mac.

Actually, I believe it will be more of a rewrite, as the original depends on many activex controls.

As I have never used a Mac in my entire life, I'll need some guidance. O:-)

a) What book(s) would you recommend to make the move from Win32 to Mac OS?
b) Is there anything similar to Delphi (RAD) for the Mac?
c) Can anyone recommend (or not) Lispworks (www.lispworks.com)?
d) Is there anything similar to the Windows market of 3rd party COM components (so I don't have to write everything)?
e) Anything else I should be aware of the Mac market?
f) Oh, BTW, what Mac should I buy? O:-) (must be a laptop)

Thanks in advance

like image 576
cfischer Avatar asked Sep 29 '09 12:09

cfischer


People also ask

How do I transition from Windows to Mac?

Open Migration Assistant, which is in the Utilities folder of your Applications folder. Follow the onscreen prompts until you're asked how you want to transfer your information. Select the option to transfer from a Windows PC, then click Continue. Select the icon representing your PC, then click Continue.

Which API is used in Mac?

Cocoa is Apple's native object-oriented application programming interface (API) for its desktop operating system macOS. Apple Inc.

Is transitioning from Windows to Mac hard?

Transferring data from a PC to a Mac isn't complicated, but it does require Windows Migration Assistant. These step-by-step instructions make it simple to move all your files. Once you've transferred all your basics, you can get to work downloading the software for your business's needs.

Does Win32 work on Mac?

Win32 Disk Imager is not available for Mac but there are plenty of alternatives that runs on macOS with similar functionality. The best Mac alternative is balenaEtcher, which is both free and Open Source.


2 Answers

I've taught Cocoa programming to several Windows-experienced programmers. You may find a previous post on the subject useful.

Cocoa is a very different way of thinking then MFC and its kin. You will do much, much better if you take the time to learn how Cocoa approaches things and adapt to its mindset rather than trying to find the quickest way to implement your current way of thinking in ObjC. It is possible to write MFC-style code for Mac, but you will always be fighting the framework if you do. I've seen a lot of Windows developers struggle with this.

The best book to learn Cocoa is Cocoa Programming for Mac OS X. Assuming you are a C++ developer with a solid OOP background, this is the book to start with. If you have limited Object Oriented background, then start with Programming Objective-C 2.0.

You would be amazed how fast Objective-C can be to code once you understand the patterns. It really can be stunning compared to C++ in my experience. There are more RAD-like systems like REALbasic, and you can develop Cocoa apps in Ruby now which can be a bit quicker. But there really is no substitute in the Mac market for ObjC. It's hard to make an app that works like a Mac app without using the Mac frameworks, and Mac users tend to be much fussier about such things than Windows users.

I have no background in LispWorks, but LISP seems a terrible language for developing the kind of rich UIs that Mac apps are known for. I like LISP (quite a lot actually), but Functional Programming's "no side effects" philosophy seems at odds with most rich UI goals (especially as the Mac UI becomes more and more animation-centric). If anything, Mac programming is moving towards Declarative rather than Functional programming (Core Animation and Grand Central Dispatch have a lot of Declarative concepts creeping in).

There is not as large a third-party component market as there is for Windows. Some of this is because Cocoa already provides such a rich set of components, which MFC does not, and because well-behaved Mac apps are expected to use those components so that you work like all other Mac apps. There is definitely little market for commercial components in the vein of RadControls for .NET (very nice toolkit, that one). But there are quite a few nice free components out there with flexible licenses (generally MIT-based). A few of my favorites:

  • Positive Spin Media's excellent tabbar control
  • OmniGroup's frameworks (though I never use them "as is;" they're better used as examples of how to do things)
  • Growl
  • Sparkle
  • RegexKit
  • CocoaDev's ObjectLibrary list of other stuff

As I mentioned before, Mac users are picky about their UI. Much, much more so than Windows users. They expect things to be polished, and they expect things to integrate with all the little things that make Macs nice. That means drag-and-drop, Spotlight, services, Applescript, Expose, QuickLook, integrated spelling check, etc. etc. It's very hard to do all these things right if you don't use the built-in frameworks. That's why I recommend new Mac developers start at the beginning and learn the frameworks.

For a Mac, if you have a bunch of hardware lying around (like keyboards and monitors), then a Mac Mini is a nice cheap box. iMacs are great if you want an all-in-one, and any MacBook is appropriate if you like portability. There is no Mac on the market today that is not a perfectly fine development box. Obviously if you do a lot of work, an 8-core Mac Pro makes compiling much faster, but I've done a lot of professional development on a 13" MacBook. If you want to get in as cheaply as possible, look for refurbished or used (I love my refurbished Mac Mini). Any Intel-based Mac is going to be fine for development, at least while you're getting started.

like image 95
Rob Napier Avatar answered Oct 12 '22 20:10

Rob Napier


If you are familiar with C, you may want to learn Objective C since that is the Macs "native" programming language. It's also what you have to use to write iPhone applications. Cocoa is Apple's primary API that will have a lot of the tools you are looking for.

a) Read this thread for book recommendations: https://stackoverflow.com/questions/7571/cocoa-and-objective-c-resources

b) Apple makes Xcode for developing in. There are certainly better ones out there, but it's not bad.

d) Cocoa is Apple's main API, which provides "core" services like CFNetwork for networking. There is also core data, core audio, core animation, core image, core location,... Underneath it all, OSX is Unix, so you have access to many unix/linux libs.

e) The iPhone is a big part of the Mac market. The iPhone and OSX development environments are not that different, so you can learn both.

f) Any Mac is sufficient for most development. If you want a laptop, it's really a question of screen size and price. But I would recommend at least a 15 inch screen. You don't need to spend extra for a faster CPU, but you may want to get a larger hard drive.

like image 41
Brent Baisley Avatar answered Oct 12 '22 21:10

Brent Baisley