[.net] Differences between .NET and Mono

Started by
28 comments, last by jpetrie 15 years, 8 months ago
Disclaimer: I think this is the appropriate place for this thread, but please feel free to move it to the appropriate place. Now, on to the subject. I've been having a discussion on C# with a co-worker for some time now. He likes C/C++ and thinks that C# is pretty much a proprietary Microsoft tool to make everyone conform to their way of programming. I've disproven this where I could by pointing out that C# has an ISO standard and that the Mono project is attempting to create an Open Source VM according to this standard. The one claim that I don't have an answer for is this: "C# is basically designed to work with Visual Studio. In Mono it's a completely different beast due to the fact that you don't have Intellisense or any of the other Visual Studio features that C# pretty much requires." Is this a dumb argument? I mean, the .NET framework and Mono are both implementing something based off the same standard so they should be the same (barring the stuff that is proprietary to Microsoft). At the same time, C# benefits from the features of Visual Studio (like Intellisense) just like any other programming language would. Shouldn't it always be harder to program in a plain text editor than in Visual Studio due to the differences in features, regardless of the language?
Advertisement
It's not really a valid argument. C# isn't tied to any IDE. You can edit your C# code in Visual Studio, and then compile it in Mono. The language is IDE independent, and the IDE can be used to edit the language source files without regard to which platform it is being compiled for.

EDIT: In fact, although I did not know this before, Mono can run binaries produced by Visual Studio. So there is no need to even recompile. Compile and run from Visual Studio, deploy and run on Mono.

Mono FAQ
Mike Popoloski | Journal | SlimDX
Quote:Original post by savagemonitor
"C# is basically designed to work with Visual Studio. In Mono it's a completely different beast due to the fact that you don't have Intellisense or any of the other Visual Studio features that C# pretty much requires."
What the fuck? This is wrong on multiple levels:
* Why on earth would Intellisense be necessary to write C#? Even the forms editor isn't particularly necessary (it's arguably even less necessary in C# than in C++/MFC).
* SharpDevelop supports Mono, and both SharpDevelop and MonoDevelop have Intellisense support and forms designers.

Basically your coworker is an ignorant fool, at best.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
There's also the bigger point that Mono is the runtime, not the IDE. "Ignorant fool" is putting it nicely.
Note that MonoDevelop[1], the IDE built by the Mono community supports intellisense. :)

I've been working on a C# project for years that works out of the box on Windows or Mono/Linux or Mono/Windows...

Basically, we have to think about coding for the .NET framework. Mono is stable enough to support almost everything you need.

[1] http://www.monodevelop.com/Main_Page
Let's get some torches and some pitchforks and rid the world of this scoundrel!
Now, Mono does trail behind the Microsoft CLR (the runtime) by a bit, mostly in libraries, but I haven't had much trouble switching my .dll's from CLR to CLR and pretty much everything runs nicely. Actually, my MfGames.* libraries are compiled on Debian and Mono and I just drop them into my Windows library directories.

There are some weak points, System.Windows.Forms is a bit, but its rapidly catching up and some of the more "obscure" namespaces of 3.x haven't been implemented (last I checked) and maybe 1-2 of the 2.0 or 3.5 features (like precompiling ASP.NET sites). They have a program (Momo) that gives you an idea of what is and isn't running.

Of course, I use Emacs instead of one of those fancy IDE's. :P
You can still use the VS IDE to develop. You can even compile your app in windows, and copy the exe/dll's to linux. It runs fine. And right, monodevelop is also pretty good. Specific to game development, the following is mono based

http://unity3d.com/

Second Life also uses it, though more as a scripting engine I think.
http://wiki.secondlife.com/wiki/Mono

Still, You're friend has a valid point. C++ is probably going to be faster..
default
Also, on the weak library note, I wanted to mention that the network stack on the mono runtime is not as robust as the network stack on the .net framework.

For example a simple udp socket application that I wrote a few months ago did not work on mono.

Also, some simple tcp network errors result in exceptions on the Microsoft framework, and just bring the process down entirely on Mono.

Since networking is a big feature set that doesn't work exceptionally well on Mono, it makes the system unready for prime time for my purpose.
Yeah you don't need VS2008 at all to get all the latest C# functionality. All you need is to download this:

Microsoft .NET Framework 3.5
Brief Description
Microsoft .NET Framework 3.5 contains many new features building incrementally upon .NET Framework 2.0 and 3.0, and includes .NET Framework 2.0 service pack 1 and .NET Framework 3.0 service pack 1.

and do everything from the command line like Petzold always does-LOL!
Visual Studio IDE itself is a proprietary MS tool though of which there is no comparable Linux version although there now is MonoDevelop as has been pointed out.
He does sort of have a point in that Microsoft has the better and more complete implementation compared to Mono but that should come as no suprise as I'm sure they are pouring alot more money into it.
So in theory they should be the same like Java on Windows or Linux, Mac,etc, including GUI stuff but in practice they are not since they are not being written by the same company so Mono is missing or behind in implementing things that are already available on windows!

The Mono project has been tracking some of the improvements available in those releases, some of the highlights of our work so far are:

* Core: mscorlib, System and System.XML assemblies. These support both the 1.x and 2.0 profiles. Work is underway to complete the 2.0 profile.

* ADO.NET: System.Data and various other database providers, they are 1.x complete, and most of 2.x is complete

* ASP.NET 1.x and 2.x: WebForms and Web Services are supported. Only WebParts are missing from our 2.x support.

* System.Security support 1.1 features and has partial support for 2.0 (like XML encryption) but the S.S.C.Pkcs namespace is still imcomplete.

* DirectoryServices implemented on top of Novell.LDAP

* Windows.Forms 1.1 with almost complete 2.0 support.

* System.Drawing supports both 1.x and 2.0 profiles.

* Compilers: C# 1 and 2 as well as bits of 3, VB.NET 8 and various command line tools that are part of the SDK.

* Transaction support, we have some partial support but currently no plans exist beyond the current implementation (see the notes on its implementation and limitations).

* Open Source, Unix and Gnome specific libraries, see our Plans page for more details.

There are certain features that we are not planning on supporting and are available either as stubs (to allow other code to compile or to satisfy dependencies) or are not even present in Mono, these include:

* EnterpriseServices
* Web Services Enhancements (WSE)
* System.Management: too Windows specific
* System.Messaging.

Support for designers in Windows.Forms and ASP.NET for the majority of Mono provided controls does not exist. This is due to the lack of tools for designing Windows.Forms and ASP.NET components in Mono today. When designer surfaces are completed (there are work in progress for both of them) work on this areas will resume.

Designer support is only needed at development-time, this is not something that is required to run the applications on Unix. Many applications that are reported through the Mono Migration Analysis tool reports these problems and can be safely ignored.

Some components exist that were once developed but are no longer actively developed, these include:

Last time I tried running some simple winform games I made using C# on Linux using mono they failed miserably due to missing winforms support but I hear it's gotten better?
So major fail IMO since C# apps and winforms go hand in hand otherwise why even bother?
I have to give them some props though for at least coming out with some tools like this to help people that want to give it a shot:
The Mono Migration Analyzer (MoMA) tool helps you identify issues you may have when porting your .Net application to Mono. It helps pinpoint platform specific calls (P/Invoke) and areas that are not yet supported by the Mono project.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe

This topic is closed to new replies.

Advertisement