19

OK, this is minefield, but trying to understand why one would pick .NET (or equivalently Mono) for cross-platform development over the other toolkit is difficult without experience in the both.

For programmers who may have used both, what features would be missed or desired? Conversely, what would a user of one find missing from the other in terms of paradigm or some other aspect? There is a lot to be said of either toolkit, but comments from someone who has used both would be valuable.

Here are some related questions on the topic:

Edit: Would using Mono only be a viable option if Windows was one of the targetted platforms?

Community
  • 1
  • 1
casualcoder
  • 4,770
  • 6
  • 29
  • 35
  • As for your last question, yes, you could simply target Mono if you decide to go that route, although it would require your users to have Mono installed, whereas the .NET Framework comes installed on newer versions of Windows. – Sasha Chedygov Dec 25 '09 at 00:49

7 Answers7

9

You would pick Mono (and perhaps C#) for cross platform development for the same reason that someone would pick Java or Python. These languages run on a virtual machine and if you are careful choosing libraries and designing code it will work cross platform (without recompilation). Native languages (like C, C++) do have standards so the language is the same on multiple platforms, but the compiler settings and libraries you use may not be cross platform (e.g. processes, networking, etc).

Besides the technical issues, the familiarity of a cross platform framework saves time. E.g. learning a GUI library can take weeks/months. You're obviously going to save time if the API is the same on all targets.

Qt4 is well designed, well documented and comes with some useful, solid tools. wxWidgets is becoming massive with dozens of widgets, some of which you'll never use. Qt has fewer widgets that are more flexible. I used to use wx quite a lot but I'm a Qt convert now because of LGPL license, good docs, the designer, PyQt, the new IDE and growing user base.

Both Qt and wxWidgets have Python bindings (i.e. PyQt and wxPython) so you could write cross platform GUI code using these libraries. For Mono it is more tricky but there is GTK# and Qyoto. I haven't tried either of these but they seem to be getting to a point where they are mature enough to used (e.g. see MonoDevelop).

Nick
  • 27,566
  • 12
  • 60
  • 72
5

For cross-platform (and unique platform) I would go to Qt because it's more clean than Mono and Windows.Forms and with the MVC pattern all the application is more easy to expand and modify

Jesus Fernandez
  • 1,170
  • 2
  • 10
  • 23
4

I'm using Qt4 for cross platform development and are quite happy with it. Deployment works fine (at least if you link Qt statically, which isn't hard at all), the API is really nice and consistent and Qt Designer allows fast development of the GUI parts so one can concentrate on the real logic. The signal and slot concept is also something I really like after getting used to it.

From my experience deployment with wxWidgets deployment is harder (in my case it was specifically Linux due to the dependency on GTK, no idea about Mac).

bluebrother
  • 8,636
  • 1
  • 20
  • 21
1

Here is another option which you do not mention, and I didn't notice mentioned here, but Lazarus is crossplatform, and is becoming more mature as it moves forward. Of course, like something written in Qt you would have to compile it for specific platforms. In my case, I've used Lazarus successfuly in a project that runs on Mac OSX, Linux, and Windows. Lazarus is a good RAD tool, and Object Pascal works well for most things I've written. Lazarus is a good option for application speed. It compares well to software written in c/c++. I'm not going to bother to back that up, there are case studies, and you can do your own testing if you have need to.

My impression of coding in c# using MonoDevelop has been that library-wise, specifically html, and audio a bit challenging. I've only been playing with c#/MonoDevelop for a few months, so I'm still quite new with the whole kit. I would guess that there is a bit of a speed price to pay since it is managed code. Again, I think research would suggest that compiled-only code would more often than not have a speed advantage over c#/.NET code.

Of course another option would be Java. I haven't done as much there, but it certainly is ubuiquitous, and does work well, again I would expect that Java code would be slower than compiled-only code, such as c/c++/Pascal.

One other option that comes to mind which has compilers for the three main platforms is Eiffel. I haven't been doing much with it these days, but I liked it when I did play with it. ymmv

happy coder
  • 1,517
  • 1
  • 14
  • 29
1

Perhaps you can write most of the application in a portable language/framework, and write a separate "graphical interface skin" for each operating system you plan to support? That strategy of course may work well in some cases, but may fail horribly in many others.

yfeldblum
  • 65,165
  • 12
  • 129
  • 169
  • 3
    in case of Qt, even the "skin" can be written along with the application. The framework ensures that the "skin" has native look and feel. – jrharshath Sep 10 '09 at 10:07
0

Have you considered wxWidgets. Its also cross platform, C++ like QT and uses native controls unlike QT, and don't require any framework to run like .NET.

.NET and mono are almost the same thing, If you are writing simple user based application with not much system or network programming, .NET should be the best.

If performance is critical aspect of the application lot of people uses C++ libraries like QT, wxWidgets.

Priyank Bolia
  • 14,077
  • 14
  • 61
  • 82
  • Does this answer do anything for you: http://stackoverflow.com/questions/464463/qt-being-now-released-under-lgpl-would-you-recommend-it-over-wxwidgets/464689#464689 – casualcoder Feb 07 '09 at 17:27
  • how can I use an LGPL QT in my commercial application??? I go with wxWidgets only which I selected after a long research. Its fast, native controls, C++, multi platform. http://stackoverflow.com/questions/464463/qt-being-now-released-under-lgpl-would-you-recommend-it-over-wxwidgets/465803#465803 – Priyank Bolia Feb 08 '09 at 08:36
  • Link the LGPL Qt libraries dynamically. This meets the requirements of the LGPL. Of course, rewriting an existing corpus of code simply to use another library might not be worth it. Sometimes it is. – casualcoder Feb 08 '09 at 20:02
-2

.NET is not for cross platform. It is very painful to code and make it work effectively for MONO and .NET. The reason why individuals go with .NET more than TCL/Tk or Qt or Java Swing is because of Rapid Application Development.

RAD is virtually impossible with any of the other frameworks that exist. RAD is possible on simple cases, but when was the last time you wrote a business based application that had simple use cases.

GUI toolkits in general are difficult to work with because you need to understand the basics. The basics being data binding, clipping, refreshing, layout managers and event handling. All of these concepts are difficult for average developers. The reason being is that most of it is being abstracted away with more of the modern toolkits out there. For instance, with Java Swing I do not need to know anything about clipping or refreshing since they do it "magically" for me. What happens in the case of when something does not refresh magically, that situation then presents a virtually impossible solution. The code then becomes exponentially more complex.

.NET is typically used by many UI developers because extending it is very simple. Creating an extension method to extend a control is very easy. Creating a method to bind data is even becomming more simple with .NET entity framework. There is a cost to use this RAD tool though, and that is that it is not platform independent.

jwendl
  • 942
  • 7
  • 13
  • Could please elaborate on "painful"? – EricSchaefer Feb 07 '09 at 18:38
  • @EricSchaefer: I suspect that the differences between .NET and Mono make it so. – casualcoder Feb 07 '09 at 19:41
  • 1
    I dunno, this is debatable. Qt is pretty damn RAD. – mxcl Feb 10 '09 at 01:39
  • @EricSchaefer I should have emphasized the word 'and' between .NET and MONO. You wouldn't want to redistribute mono libraries on a windows machine, that does not make sense. – jwendl Feb 11 '09 at 01:28
  • 3
    Agree, QT IMO is near close to RAD as .NET, actually truly cross platform, and is native, and has no dependencies outside its self, which can be statically linked if need be. – ApplePieIsGood Apr 17 '09 at 14:05
  • 4
    -1: Why is it "virtually impossible" to do RAD with Qt? It has a designer, and using PyQt you can prototype things very quickly. – Nick Sep 10 '09 at 09:43