Software Development optimize

Is cross-platform development important to you?

Justin James is curious to know how many developers are actually writing code to be used across multiple platforms. Take the poll to share how important cross-platform development is to you.

The Mono project was recently updated to better help .NET developers target other platforms; and it's been said that Java's cross-platform compatibility has improved too. These developments expand the reach of .NET and JVM languages and frameworks. Other languages like PHP, Ruby, and Perl have been extremely portable for a long time. However, I wonder how many developers are actually writing code to be used across multiple platforms.

J.Ja

Disclosure of Justin's industry affiliations: Justin James has a working arrangement with Microsoft to write an article for MSDN Magazine. He also has a contract with Spiceworks to write product buying guides. --------------------------------------------------------------------------------------------------------------- Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Developer newsletter, delivered each Tuesday. Automatically subscribe today!

About

Justin James is the Lead Architect for Conigent.

28 comments
jslarochelle
jslarochelle

Not an easy goal to reach. There is no perfect tool for this right now. However, despite the many debates about it I still think that Java is the closes thing. Right now most of the software I run on both Windows and Linux are Java applications. The big guns include: Open Office, Netbeans (for Ruby and JRuby), JDevelopper mainly as a modeler (it has very good Use Case support including nice forms for actual Use Case elaboration) and of course Eclipse. All three applications feel identical under the two platform (all three are more responsive under Linux). I also use a number of other little Java applications like FreeMind and JEdit. JS

Jaqui
Jaqui

~chuckle~ I do think that it is important, and that all applications meant for a broad user base should be written for all operating systems. The problem with it is that the tools available for cross platform development all have something lacking. Java is bloated to the point of not being usable, as well, since Java is, and always has been, a single platform by virtue of being a virtual machine, it really is not a cross platform language. Perl, Python, PHP tend to be slow on Microsoft's operating systems. PHP doesn't have a scripting environment on MS' products, only the web interface option. Ruby isn't as widely known, so it's cross platform tool kit isn't tested as well as it needs to be for enterprise use. objective-c, well, the only os that makes significant use is OSX. C and C++, the biggest drawback is that there is no one toolset for them, on ALL operating systems. GCC is tweaked into djcpp for windows / dos, but those changes don't make it GCC on windows / dos natively. cygwin and mingw are making a linux environment on windows to run gcc in, which defeats the idea of one toolset native on all operating systems.

Saurondor
Saurondor

Couldn't help notice Java isn't on the tags for this article. Why is that so?

onbliss
onbliss

lol. No it is not important for the work I am currently doing. And it has never been an issue for me ever.

Neon Samurai
Neon Samurai

I have more than one OS platform in my life and being able to use the same programs across all platforms trumps most single platform applications.

Tony Hopkinson
Tony Hopkinson

I personally enjoy it, though what I have done in the past might be better described as distributed developement across multiple platforms. So called code portability in my opinion is self defeating. By the time you messed about through whatever method of making your code platform agnostic, you've lost any benefit of being on any particular platform. Lowest common denominator time. JVM, .net framework, even browser disparities prove this time and time again.

Justin James
Justin James

For some, this is a non issue... for others, it is a hot topic. Where does it stand on your list of priorities? J.Ja

Justin James
Justin James

I used to think that Open Office was a Java application too, until I looked into it. Open Office is actually written in C++ (http://contributing.openoffice.org/programming.html), but it requires Java (I beleive for some components). I think that at one time it may have been written entirely in Java, because there was a huge rumor of it, or maybe its early performance led people to beleive that it was written in Java. J.Ja

mikes
mikes

Mono has been a great alternative to Visual Studio for .Net programming; but the modify / compile / debug / recompile / test cycle tends to be too slow for many of my needs. When I need to be more efficient in my cross-platform development cycle, the Euphoria programming language has the scriptability of Perl,Python,etc.; but the speed of C. Code written on Linux will run on Windows and vice versa, without a ton of ifdef hacks.

Justin James
Justin James

"C and C++, the biggest drawback is that there is no one toolset for them..." I'm assuming you implicitly followed that with: " (besides the shear difficulty that most developers have writing quality code in these languages)". :) In all seriousness, C/C++ probably are the best choices for cross platform development (there are other options out there besides stuff like cygwin; Microsoft's "Services for UNIX" makes Windows POSIX compliant, and of course, there is Qt). But the languages themselves are miserable to program in, and people who are less than great C/C++ developers write more bugs per line of code than any kind of developers out there. "Segmentation fault", anyone? ;) J.Ja

Justin James
Justin James

The tags are automatically generated. It saw me mention ".Net" and tie that to the ".Net" tag, but it was not smart enough to tie "JVM" to the "Java" tag. :( J.Ja

Jaqui
Jaqui

a "cross platform" development tool / language, since it is a virtualized environment to run java apps it's the same platform. edit to finish thought: no matter what hardware / os the java environment is on.

Saurondor
Saurondor

While you may loose the benefits of a particular platform you gain the benefits of not being tied to a particular platform. That in today's changing environment is quite a plus. We also need to break down the cross-platform examples into various groups. We have hardware cross-platform (x86, PowerPc, Itanium, Alpha, Sparc, etc). We have OS cross-platform (Windows, Linux, Mac, BSD, UNIX in all its variants, etc) We have OS version cross-platform (Windows Vista, XP, 2003 Server, NT, 2008 Server). We have OS point release cross-platform (x.1, x.2, x.3 or SP1, SP2 etc) We have to break down the cross-platform solutions into: Compiled for a particular environment. Scripted language that runs on top of an interpreter. Virtual machine. The Java and .NET solution. Now compiled for a particular environment gives you the most benefits to a particular platform, but also ties you the most to it. So when that platform expires so does your application. Being cross platform gives you a longer lifespan to your product. And I don't mean Windows to Linux. The Vista debacle has shown us just how important this can be. XP SP2 showed us that too. Even Microsoft's own apps had issues. Good cross-platform practices benefit you even if you don't leave the same OS ever. Then there's the issue of who maintains the cross-platform application. If it is a database for example and I don't have to do the cross-platform development then it is certainly a plus to have a cross-platform database. Same goes for scripted languages. The Apache, MySQL and PHP combo work well if they're LAMP or WAMP. They work the same on my PowerPC Mac, my Core 2 Dui 32 bit or my dual core Athlon 64bit, on XP, Vista or Linux (32 or 64 bit). I've worked with Gentoo for example and built it from the ground up. Compiled my Apahce, MySQL and php for the particular processor with particular setup. Did my application change? No. Was it a lot of work? Nope, I just issued a simple instruction and went to bed. Got up the next day and started working. Cross-platform in my opinion isn't that hard a thing to deal with. It is also something that pays up in time as your application matures and the systems and hardware used initially become obsolete.

JackOfAllTech
JackOfAllTech

Would you try to plow a field with a car? Sure, it has a seat, a steering wheel, an engine, and tires as a tractor does but it's just not the same. It's the same with a program. In order to use the hardware efficiently, the code HAS to be specific to that hardware. True, maybe 90% of the code is internal and can be re-used but all the human and hardwware interfacing code MUST be unique. When I write a program that is applicable to more than one platform, I write all the common stuff first then add modules appropriate for that platform. BTW - I despise .Net

Jaqui
Jaqui

The "wizards" and auto-formatting of documents are java applets for open office. The reason it is often seen as a java app, Sun's Star Office is now currently a "proprietary" version of open office. It's the Sun Microsystems and Star Office connection that causes the java association. I refuse to use open office because of it's ( limited ) requirement for java to enable full functionality.

adeyemi.opeoluwa
adeyemi.opeoluwa

Hi, The stability of this office suite shows the power and character of a product produced using C++. I have always been a C++ proponent, but many shy away from this language because of its demand: that you mange memory and its lack of tolerance for errors.

jslarochelle
jslarochelle

I should have double checked because I did have my doubts. I think I came upon their C++ coding standard page once and one graying neuron was still clinging to that information (which apparently was not enough to make me double check) This makes OpenOffice quite an accomplishment because writing multiplatform C++ GUI application is a lot of work. I'm sure about the other ones though and they are quite impressive. You would enjoy working in Ruby using Netbeans. It really is a nice Ruby IDE (works with both JRuby and the C Ruby interpreter). JS

adeyemi.opeoluwa
adeyemi.opeoluwa

Hi Justin,, I just read your comments on C++ being difficult to manage in terms of software development, on one side I do agree with you as the syntax of the language does not permit for the minutest omission like Java , but it is sure faster and more secure because it hates errors. I see these days that a lot of new languages have developed or would I say evolved. But I am sure most evolved out of c/C++ language construct. In my opnion, C++ is good if you are developing a software or writing a back end that needs an error free routine. I haven't tried my hands on C# but have tried a bit on Java and VB6. What I do see is that it is a matter of choice and end- i.e what product do want to produce

Jaqui
Jaqui

I was thinking more along the lines of the delphi environment for toolsets, something like that, running on every os, with the same look and feel and functionality. QT, widgets, no compiler / make. Trolltech's QT dev tools, no compiler / make. GTK, widgets, no compiler / make. wxWidgets, no compiler / make Code::Bocks IDE, wxwidgets, no compiler / make, except for the mingw included windows installer. [ as opposed to the no mingw included windows installer ] The tools to develop C/C+ for all platforms, and have the SAME tools natively on every platform don't exist. can we say segmenation fault with java? .net? perl? python? ruby? ... yup. bad code happens in all language options.

Saurondor
Saurondor

Java's. And php and Ruby and Perl and Mono. The generator should be twitched a bit to be more "open" :)

Saurondor
Saurondor

Under that criteria then neither is php, Ruby and a whole set of scripted tools. Neither is .NET. I can build a C++ app and run it on a platform without then need for gcc, but can I do that with php? ruby? without having php or ruby installed? Leaving your Java dislike aside. What would you call it given an application written in it can run on Windows, Linux, Mac, BSD, cell phones, etc?

Tony Hopkinson
Tony Hopkinson

If you sit down and say right I'm going to do a piece of platform independant piece of software, and in order to avoid platform dependancies I'm going to effectively do it in parallel. Then fine. If however, you've developed it for one platform, got some market success and see an opportunity to go cross platform, something will almost certainly have to go. Given option two is the norm... In a non trivial application, what .NET 2.0 to 3.5 changes will hit you if you support both. There are some, and they a critical functionality wise, and there's little chance of you predicting and preaparing in advance for them. A simple one is in 3.5 you can only use named pipes for inter process comms not not across machines with WCF. So what are you gonna do now? You 2.0 design will work , so will your 3.5 one. If you've got a brain all that stuff will be hived off into one place. iF you are lucky the connection change (other than instantiating it) will not break anything. But you won't just be porting your existing design..... What the 'Vista debacle' actually showed is that the third parties we rely on to have a platform/version agnostic abstraction, don't give a crap that we do.

Justin James
Justin James

Sometimes, the application itself doesn't need to take advantage of particular hardware (in fact, 95% or more of applications are like this). C/C++, depending on what you are doing, can be extremely portable, and many of the various interpreted languages out there like Perl, PHP, Ruby, and Python, port very well. In fact, the only porting problems I ever had with Perl, was one particular Sun/Solaris machine was really twitchy when it came to reading files, for whatever reason. J.Ja

Justin James
Justin James

The last week or two, my Ruby learning progress has slowed (other items got in the way), but I am looking forwards to getting back on it. I really like it so far; not *perfect*, but it has a lot to like. Unfortunately, IronRuby isn't where I need it to be, and I don't have any projects that can justify using it at the moment. :( J.Ja

Tony Hopkinson
Tony Hopkinson

are much stricter on things like type safety and such. One of the reasons why I like them, they cut out a good pile of my stoopid mistakes before the code gets near a processor. Sort of related C wise. One place swapped OS flavour (from Sun/Solaris I think). Didn't want to pay for the C compiler they were using again, so switched to good old GNU. Code wouldn't compile.... Someone remembered I had C on my resume before the entire management team went into headless chicken mode. Apparentky some halfwit had assured them that there would be no problems.... It was only two functions where some numpty from Anderson had implicitly converted int to an enumerated type. Of course they were called a lot. Took me about ten minutes to fix it. There's more to this cross platform stuff than the code and the platform.

Justin James
Justin James

... Pascal is (I suspect), still a possible choice for cross platform development as well, with the same performance characteristics as C/C++. The difference between bad C/C++ code and bad .Net, Java, Perl, Python, Ruby (etc.) code, is what happens when the code blows up? In C/C++, it has the potential to take the whole system down, or open a massive security hole. In interpreted/p-code/VM'ed languages, this is much less likely to be the case, if at all. The amount of skill needed to write safe, stable C/C++ code is higher than the industry average, IMHO. J.Ja

Justin James
Justin James

I wish I knew how it worked or how to tweak it, to be honest. At some point, I could add additional tags manually, but I don't know where that feature went off too. J.Ja

Jaqui
Jaqui

requires a platform other than the os? I call is a script. applications do not need anything but the os to run. :p so scripting languages are not for application development. and, linux can & does power cell phones, so c and c++ can be used to write apps for cell phones.