Wanted: user experiences with C# (mono) on MacOS and Linux - mono

I have a friend who is was a serious Linux developer but now he's working with C# on Windows and is really loving it. I'm attracted to C# because, like Java, I should be able to compile on one system and run anywhere.
If you are developing on Windows with C#, you're using dot-Net. On Linux and MacOS, you're using Mono.
Other people have posted that Mono is pretty good, no longer a science project, and that most of the core Microsoft functionality is present. But that's not really getting at the questions that I have. I'm wondering:
How does performance of Mono on Linux/MacOS rate against Java? If I want to run fast on all three platforms with the same object code, what's my best choice?
Is it easy/possible/reasonable to use Mono with makefiles and do my development with emacs?
Is there support for code factoring in MacOS and Linux, or am I better off just biting the bullet and doing all of my development in Windows?
How well does Mono work with Subversion and the rest of the open source development stack? How about autoconf? Or is this a completely different way of doing things?
Thanks

I have been using Mono on Linux for about three years and lately have been using it on OS X. Some of the Linux stuff was pretty extensive but the OS X stuff has just been some simple ASP.NET MVC2 apps so far.
1) Performance of Mono has never been an issue for me. That is not to say that performance has not been important, it is just that the performance of Mono itself has never been an issue. A lot of what I have done is web based so I/O and database memory use have hit me before Mono has.
Historically, the biggest deficiency with Mono has been the Garbage Collector (GC). I would say that Java is better tuned in this regard. The most recent versions of Mono have made huge strides in this area but I do not have any hard numbers for you in terms of comparisons.
I am sure Mono is faster sometimes and Java sometimes but I would say that Java is faster overall.
2) You can certainly do Mono development with makefiles. Certainly the Mono team itself does. Also you can certainly use Emacs and there is a C# mode for it.
I tend to use MonoDevelop and xbuild (Mono version of msbuild) myself and do not have any experience doing C# work in Emacs. MonoDevelop is great because it is exactly the same on all platforms. Also, although I rarely use it anymore, it is nice that the project format is the same as Visual Studio and SharpDevelop.
3) MonoDevelop has pretty decent code factoring support. It is the same on Windows, Linux, and Mac. You do not need to use Windows for development (though you certainly can) but I believe you will be happier using an IDE like MonoDevelop. Even things like Intellisense become hard to live without once you are used to them. But integrated debugging, being able to drill-down into the framework, database integration, unit testing, SCM integration, and other nice tooling support all in one place is just the way to go (for me at least).
4) Mono itself does not care about version control of course. Your source files are just text and you could use anything to manage them.
That said, MonoDevelop has fantastic Subversion support built right into the IDE. I have used it extensively and it is one of the reasons I have trouble moving off MonoDevelop even on Windows. The latest version of MonoDevelop (2.6 beta) includes Git support as well.
You did not mention unit testing but MonoDevelop also has NUnit support built into the IDE. I use that on every project as well and it works excellently. The version in MonoDevelop is 2.4.8 (if memory serves) so it is not quite current but it works great.
In a nutshell, Mono works really well with Open Source tooling in general. It has always played really well for me.
Autoconf is of course used by the Mono project itself but, as a Mono developer, I have never seen a need for it. I strive to only use managed code in my projects. As such, all I need on the target platform is Mono (or .NET). Not having to worry about all that stuff is one of the primary benefits of a managed environment like Mono or Java. The runtime itself (the CLR) ensures that my app has everything it needs to function properly.
I know that MonoDevelop will build autoconf/autorun files for C/C++ projects (non-Mono) but I have not done much with it myself.
As to a previous comment, the Mono JIT is obviously tuned to the target platform. That is where platform specific performance tuning happens.
Just as a comment, I find that Mono is best viewed as a development environment in it's own right rather than a compatibility layer for Microsoft stuff. The Mono team has extended .NET in many interesting ways. Anything you develop for Mono will run on .NET but there are some .NET features not available for Mono. For example, Mono does not support Windows Presentation Foundation (WPF). You have to use Windows Forms or GTK# for cross-platform GUI work. You can also use something like Cocoa# or MonoMac on the Mac, MonoTouch on iPhone, or MonoDroid for Android. You can use Moonlight instead of Silverlight as well although I have not played with it much.
One more thing since you asked about Java. I have found a few times that the Java world had libraries that I could not find equivalents for in the .NET world. In these cases, I have had amazing luck using IKVM.NET to integrate this into my Mono apps. IKVM.NET also works on .NET but Mono and IKVM.NET are very cozy and even share some code.
So there you go, one real answer for you at least.

Related

Is it considered bad practice to write Windows applications using GNUStep?

I want to start developing for Windows but I want to preserve some of my frameworks that I've used with NSFoundation. I want to build them on Windows using GNUStep and maybe write the whole application using GNUStep.
Would that be considered bad practice?
If I had to deploy apps on Windows, I'd use GNUStep, CocoaTron, or anything else I could find that let me avoid .NET or Win32. I might even settle for Qt if I had to.
Speaking for myself, I prefer Cocotron over GNUStep. A Cocotron application is self-contained, existing entirely in its own subdirectory under C:\Program Files. It also looks and acts more like a native Windows app. A GNUStep application requires a full install of the whole GNUStep environment, and doesn't blend in very well - it looks and acts just like what it is, a *nix app that happens to be running on Windows. Overall, I think Cocotron gives a better end-user experience.
On the other paw, the GNUStep developer tools can run on Windows, whereas Cocotron requires a developer to work entirely in Xcode and cross-compile to produce a Windows (or other non-Mac) binary. Whether that counts as a pro or a con depends on how much you like Xcode.

Cross platform software development (Mac, Window) language suggestion

I need to develop a software which works for both windows and Mac OS.
The requirement are follows:
User can view flash file, make the selection and software print out the user selected flash file list.
I have experience in .net and windows platform but no experience in Mac OS. What is best development language and tool for my current situation.
I may be a bit biased on this, but you should use Qt because it will make your code portable on Windows, Mac OS X, Linux and even some mobile platforms. I don't really understand your requirement but Qt is pretty much the all-round cross-platform solution. It's C++ based, but easy as such (no memory management hassle, Qt takes care of it all).
On one hand you could use Java, it's fully compatible with Windows, Mac and Linux, also the language is similar to C# so you could adapt without too much trouble, if you used .net with C#.
On the other hand you could use your knowledge in .net and use Mono. It's an open source library for running .net code in other platforms, It's not equal to .net (doesn't include all the libraries) but could solve your problem.
Hope my answer helps you.
Xojo is pretty easy to use and lets you make native Windows and Mac apps from a single source project so you might want to take a look at it.

Is it possible to develop using Cocoa in Windows and Linux?

I'm starting to learn Objective-C and I don't have a Mac (and I don't have plans to get one), but as I see that Cocoa is a very good framework to develop in Objective-C, I want to know: Is it possible to develop using Cocoa in Windows and Linux?
Thanks.
I think that your best bet, if you want to use Cocoa, is to get a Mac. You really won't regret it. GNUstep is a neat solution, but it is impractical to distribute applications built using GNUstep, because (as far as I know), clients must have the runtime installed for it to work.
Cocotron is an amazing project as well, and in the future, it may be useful for you if you want simple apps to run on both Mac OS and Windows. But you would still need a Mac to use it.
If you are interested in using a language like Objective-C with a framework like Cocoa, but don't want to get a Mac, why don't you try web application development with Cappuccino and Objective-J?. Objective-J is an implementation of an Objcective-C-like language in JavaScript, and Cappuccino is a really amazing imitation of the Cocoa framework in Objective-J.
Some examples of what can be created using that framework are 280 Slides and the new, stunningly beautiful EnStore. That's not a perfect solution, and unless you are content to just do web applications, you should buy a Mac.
Take a look at Cocotron
The purpose of the project is to provide an easy to use cross-platform solution for Objective-C development. In particular, source code level compatibility with recent versions of Apple's frameworks (OS X 10.4 and 10.5).
The general goal is to provide complete support on any viable platform, the project is intended to be as portable as possible. However, most of the work at this time is focused on providing support for Microsoft Windows. In particular the NT based versions, 2000 up to Vista.
You can also run Snow leopard Server inside a virtual machine, like VMWare Fusion.
Apple changed it licence in 2008 to allow that, but only with server editions. I have personally used it with some success to deploy iphone applications (Although it was admitably a bit slow).
You will need decent hardware and preferably a dedicated hard-disk drive to be able to use it properly.
And considering the cost of vmware and osx server you might be better off buying a used mac.

How to write a cross-platform program?

Greetings,
I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever?
This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively?
Update 1.
By "natively" I mean that the end result will be native code without intermediate layers like Java Virtual Machine or .NET Common Language Runtime
Update 2.
A FREE solution is preferable ;)
If you know C or C++ the first cross platform GUI framework I can think of are:
QT (C++, proprietary but free with the LGPL licensing)
wxWidgets (C++, the most complete and stable but also huge)
FLTK (C++)
FOX (C++)
IUP (C, simpler and cleaner than the ones above)
If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.
The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.
The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .
On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?
You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.
So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.
WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/
wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.
Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)
How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'
Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled
Which OS's do you have in mind when you say cross-platform?
As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.
In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.
If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.
I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.
Two other advantages to using Java are:
They have extensive libraries for building the UI, including UI component builders.
The Java runtime framework is generally updated automatically for the user.
One disadvantage:
The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.
http://www.realbasic.com
Edit: Generates native executables. There is a small cost - $100.
Have you looked at Qt?
Flash? It's installed pretty much everywhere.
If it "HAS" to be Desktop use Qt. Nothing beats it right now.
However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)
If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !
I agree with David Wees and Georgi,
Java is cross-platformness par excellence. You literally write once and run everywhere. With no need of compiling your code for each target OS or bitness, no worries about linking against anything, etc.
Only thing is, as you pointed out, that a JRE must be installed, but it's quick and straightforward to do even for novice end-users (it's a matter of clicking "Next>" a few times in the installer).
And with Java Web Start deployment gets even easier: the user just clicks the launch button on a webpage and the application runs (if the proper JVM is installed according to what specified in the JNLP descriptor) or the user gets redirected to the Java download page (if no suitable JVM is found).

Multiple platform development

I was currently developing a desktop application in C# using mono and testing in SuSE and Windows. The concept doesn't matter much, but it is a "web lint" program that will scan a web site and return possible issues with security and/or cross browser compatibility. However, I want to be able to offer binaries for multiple platforms. Should I stay with Mono, or is there another platform that would give me a better availablility of platforms, such as on Macs, Windows, Linux, and others (possibly mobile platforms), and make it easier to port?
Well, your best bet always is to use a language that actually exists on all the platforms. That usually means Java, I think, though even perl has flavours for mobile platforms (depending on the mobile platform in question).
I do most of my cross-platform work in C and perl, but there are some headaches with C (lots of #ifdef's), and perl may not be on a mobile platform you care about (yet). You'll have to evaluate the languages/compilers/interpreters that are common to all the platforms you want to target and then choose from that list. Without knowing the full list of such platforms, we'll have a hard time telling you what to use, though Java has enough buzz-wordness to likely be a strong candidate.
Iff you know C++, Qt will cover many platforms.
C# and Mono is probably cross-platform enough for most desktop environments. The trick will be the "mobile platform" requirement.
Mobile operating systems are wildly diverse and there's not a lot you can do to generalize. Some have Java, like the Blackberry. C# may get you onto Windows Mobile-based platforms. iPhones do their own thing. You pretty much have to pick a platform and target that. That may end up informing your desktop platform choice.
Just stick to the Mono, make sure that you have Gendarme code inspector (FxCop for Mono) checking your code for portability issues, and you should be fine.
Java will run on Windows, Linux and Macs. Should be easy to transition from C# - use Apache HTTPClient for grabbing the web content you are scanning, and the scanning code should be more or less the same. However the downside is requiring the user to have the Java runtime installed.
Python is another option - you can build stand-alone executables for Windows, and it comes with most Linux distributions by default, and also Mac OS X (citation needed ;) ). This is a lot less hassle for Windows users (language is compiled into the executable, no other downloads required).
If mono runs on Mac OS X then surely that is a good platform as well?
It really depends what you want to do. For web development, if HTML/JavaScript is enough then stick with it. If you need more advanced stuff I would use ASP.NET with Mono (what you probably did) since you already know that. (You can use Visual Studio here.)
Another option might be (since you are a C# developer) to use Silverlight. That gives you Windows and Mac platforms covered and hopefully Moonlight will cover Linxu platform later. (You can use Visual Studio and Expression Blend here.)
If you need desktop application then Java is probably the easiest since you already know C#. But if you know C/C++ try to take a look at wxWidgets for example.
Why limit yourself to the traditional C#/Java? Have a look at Adobe AIR and Microsoft SilverLight