5

I have a desktop project I've been working on for a couple months that I want to run on Windows and Mac. When I started the project, I started writing it in Qt 4.8 in C++. Development has gone fine and the application runs fairly well on both Windows and Mac like I hoped. I would say it's about 40% complete at this point.

For a little background information, the application is a variation of an email client.

But I am thinking about abandoning what I've done so far in C++/Qt and purchasing a license for Xamarin Studio and writing the application in C#.

There are a few reasons I am strongly considering this:

  • I want to release mobile versions of this application too, and with C# a lot of the backend code could be reused on all platforms.

  • I want to publish this app on the Apple and Windows stores. I know that you publish Qt Apps on the Apple Store but I have not read or been able to find anything about anyone publishing Qt Apps to the Windows Store. Not to mention, Qt 4.8 has no built in support for Metro UI (I would have to use Qt 5.0, which would mean rewriting a large part of the code anyway).

  • Having worked in both C# and C++ for many years, overall I am "happier" developing in C#.

However, I have a few reasons the stay the course:

  • As I mentioned above, I am about 40% complete in the first incarnation of this project.

  • A large portion of my program rests upon Lua, for which I'm able to use the native Lua libraries quite easily in C++, and I'm not sure how well the Lua implementations I've seen for Mono/C# work.

  • Maintaining two separate UI code for the desktop app (hence, in Qt I can #include <QtCore> on Windows and Mac, but in C# I'd have to using System.Windows.Forms on Windows and 'using MonoMac.' on Mac)

Honestly, at this point I'm inclined to start over in C#, using what I have in C++ as a guide and delay my release for about a month (about how long it'll take me to catch up considering other responsibilities in my life).

I was looking for some input from people who have been in a similar situation. And I'm particularly interested in hearing from anyone who has used C# to publish apps on the Windows and Mac stores.

What do you think?

Addy
  • 161
  • 1
  • 1
  • 6
  • 1
    Qt works fine on mobile platforms, does it not? – Patrick Hughes Apr 06 '13 at 15:59
  • 1
    @PatrickHughes: it used to, back when that meant Symbian. unfortunately, i think the current state is something like "runs on every platform except iOS or Android" – Javier Apr 07 '13 at 01:06
  • Qt for Android - [almost ready](http://blog.qt.digia.com/blog/2013/03/13/preview-of-qt-5-for-android/), should be there for Qt5.1; [Qt for iOS](http://blog.qt.digia.com/blog/2013/03/05/qt-for-ios-preview/) should be in 5.2 – gbjbaanb Apr 07 '13 at 13:08
  • 1
    Qt for Android and Qt for iOS have convinced me to stay with Qt (for now)! Is there any word on the cost structure of either of them? – Addy Apr 08 '13 at 10:16

2 Answers2

9

Don't be fooled by the "grass is greener" syndrome. You have something that is getting complete, it works, and will be available on other platforms in the future like you want... so why would you want to change now!?

You know the situation you currently have, if you changed you'd have to discover the problems you'll face all over again - its one reason why you should never rewrite from scratch.

gbjbaanb
  • 48,354
  • 6
  • 102
  • 172
  • 1
    It wouldn't be a complete rewrite, since a large portion of the product is implemented in Lua and I want to reuse the Lua across all platforms (and whatever languages) I end up using. – Addy Apr 06 '13 at 15:59
4

I don't think rewriting from scratch is a good idea in general, but to address a couple of the technical points you mentioned:

I want to release mobile versions of this application too, and with C# a lot of the backend code could be reused on all platforms.

There's not really any particular reason why you couldn't reuse your C++ code for mobile platforms. It's definitely not an ideal state of affairs for C++ aficionados, but it is feasible.

A large portion of my program rests upon Lua, for which I'm able to use the native Lua libraries quite easily in C++, and I'm not sure how well the Lua implementations I've seen for Mono/C# work.

Scripting in the .NET Framework in general is a .. little tricky. In order to reload scripts, you'll have to manage a/some AppDomain(s) specifically for scripting. If you intend on modifying scripts frequently as would be implied by some use cases for scripting, this is a significant factor to consider.

Additionally, last time I checked (though this could easily have changed since), the Lua bindings for .NET were really awkward to use because of the C heritage. There are some DLR Lua projects which may or may not be better than the libraries I was attempting to use at time. I can't post more than 2 links otherwise I'd link to a couple, but you can use your preferred search engine.

Joel
  • 1,169
  • 8
  • 12
  • Actually, there will be no runtime reloading of the scripts. Nor am I using anything beyond the standard C API in the Lua libraries. I don't intend to do any "fancy" binding, so all I really need is a Lua implementation that can handle the basic functionality of the C API. – Addy Apr 06 '13 at 15:58