views:

489

answers:

15

What's your opinion on whether one should write an application for a specific platform or use a cross platform approach and reach more potential clients?

It would be a GUI based application and I'm thinking of using Java.

Most of the applications that I've used built on Java don't run as smooth as the native applications on the respective platforms.

The two platforms I'm thinking of are windows and macs.

If I was creating the app just for my own use, and I had to choose one system, I would choose to focus on the mac.

I would like to hear your thoughts.

A: 

Why don't you consider Web Application.

You can build rich UI Web site running in browser which runs everywhere and all platforms, If you are familiar with Java, you can try GWT for the 'Weblication' Check out the demo page of GWT

codemeit
A: 

Make it a web app ? Otherwise Java i guess. It depends of many things, type of your app, target etc.

coulix
+3  A: 

I suggest to develop it first for the platform you feel comfortable with, and where you can make use of all platform gimmicks; in this case, this would be OS X.

Later, if your app is successful for the Mac, look at porting options. It's IMO not worth to put effort into porting until it is certain that there would be significant interest in the app in the first place.

Martin v. Löwis
+4  A: 

Requirements, requirements, requirements.

In all seriousness, "it depends" is the right answer.

Truly cross platform is hard work; Working where you/your users are familiar is worth something. Solving the problem in an effective manner is really the highest priority.

Ken Gentle
+1  A: 

If your app uses an MVC design, you can write portable model classes using C++, and native controller and view classes for each platform you want to support. That gives you the best of both worlds - portability where that's practical, and a native interface for which your users will thank you.

Sherm Pendley
+1  A: 

I agree with your observation about Java applications versus native applications, although I'm sure that an experienced Java programmer could probably make it work.

The bottom line is that the programming APIs for both Mac and Windows are the best tools to use for building interfaces on their respective systems. If you want your app to run smoothly on a particular system, you should use that system's API.

If it is absolutely essential to have a cross-platform implementation, consider writing all of the core functionality (non user-interface portion) for your program in a library that can be compiled for both systems (c++ is an obvious choice), and then build a nice user interface for each target system that can makes calls to the common library.

e.James
+4  A: 

Cross platform development, in general, is a bit overrated as an artform. Java is the leading technology here, but even in this case, most Java programmers don't really go cross platform. There are a few spectacular examples of tools like Vuze and LimeWire and JRipper which work pretty well just about anywhere, but these are exceptions, statistically speaking. Most Java apps, especially of the corporate variety, are coded with one platform in mind, and they never really move around.

If you want to go Mac and Windows, consider spending time in the Limewire and Vuze codebase. Both of these apps work extremely well on both platforms.

You will definetly need two builds. One build probably won't do.

David Leon
+1  A: 

IMHO, this discussion should be answer by the customer needs.

Most of the time IT provide solution, the way the solution is build is only a detail for the customer.

However making the code reusable could be useful in case your first choice of development environment was wrong.

many other criteria may come into the thinking. for instance if your software is for health care you may want to support for 10 years, then you have to select an OS supported for more than 10 years (forget windows and mac). etc.

call me Steve
+2  A: 

In this day and age, is there really a good reason to write native code?

Yes. The languages and libraries available do not allow excellent programming to be done well. At best they allow one to write code that works ok across platforms, but never excel.

Pick one and focus on it. Focus on that audience (you'll find the audiences are different in their tastes and desires anyway).

Once you've got an app people are clamoring for on the other side, and just before someone makes a competitor, evaluate the cost/benefit to porting your finely tuned and well designed product over.

If you try to 'serve two masters' you'll make design decisions based on what's easiest for both platforms, and that's not a good design process.

Adam Davis
A: 

I have had good luck with cross platform Java using SWT. This will give you a nice native-look on any OS, and there aren't a whole lot of problems out there that require any JNI code. With any luck, you should be able to distribute the exact same codebase to both targets, and it should just work.

Having said that, you should evaluate whether or not you really need the cross platform functionality. At the very least, it will require you to test the GUI layer of your app on each OS (testing layouts, presentation, etc). With a large app, this becomes cumbersome very quickly.

In either case, choosing a cross-platform language from the start will give you flexibility in the future. If you were to write native code from the start, it would be non-trivial to port the code to another platform. It would likely be accompanied by several bugs, and would also require a port of all the test code to the new platform. You would run into synchronization issues with any new features, bug fixes, etc. With Java, you can write JUnit tests which will run in both OS's, and any bugs or new features will be propogated to both versions automatically.

It really does depend on your specific application. If you are anticipating a user base on both OS's, then that should dictate your language choice.

James Van Huis
+6  A: 

I would use Qt and yes, definitely target Cross Platform...

The major reason isn't in fact what you think it is (being cross platform by itself) but actually that by targeting multiple platforms your code by some freaking weird magical reasons tends to end up with far better code quality. I've seen this happen countless times in my own projects. Every time I add a new platform the quality of the code increases and the code becomes more clean...

Also every serious app should have as few "dependencies" as possible, being cross platform means you have less dependencies... ;)

Then as a "bonus" you get to your app to run on multiple platforms...

Thomas Hansen
I think that the code is more "Clean" is because you need to write to standards as some platforms, mainly Mac OS X and Linux are very strict with their tolerance to deviation of the standards
Brock Woolf
+1  A: 

Depends on how much time you wish to spend on the application. Fastest way is Java, otherwise you can build your model with C++ and do separate GUI code using MFC and Cocoa.

Dan
A: 

It is possible to get a nice looking Java app to run on Windows, Linux and Java - look at SBCommander for example - and note that you can run it and look at the UI even if you don't have the hardware that it's supposed to control.

On the other hand, one thing I've found very hard to do is to write a cross-platform app that looks and behaves like a native app on each platform; there are just too many different assumptions about how an application should behave.

Mike Heinz
A: 

It really depends on who your users will be. Don't go cross-platform just because you can. There needs to be a real need regardless of the tool. And testing is going to eat up quite a bit of time. You'll still need to thoroughly test on both platforms.

I use REALbasic to create a wide variety of cross-platform desktop applications from a single code base and it has worked well for me and my clients.

Paul Lefebvre
A: 

Quite often I find PC developers attempt to capitalize on the Mac market (some do successfully). In turn, they development the application in the described above "cross-platform" architecture (Java, or some Qt framework, etc...) The result is usually, a hideous looking application with poor OS integration support and the community backlash commences in the reviews.

My advice, port it. Do a good job, understand your market before dumping your cross-platform product in your carpet bomb marketing approach.

Rev316