I was speaking to Matt from LugRadio on Skype earlier today, and we got onto the topic of Mono and .NET (the Framework, not the ‘brand’ that has been badly abused).
I tried to explain to him ‘Why .NET?’ and by association ‘Why Mono?’, which prompted me to write this.
Jack of all trades…
First a little background… I regularly code in Perl, PHP, Delphi, and C#. I’ve played a little with C, C++, and Java. I’m familiar with HTML, XHTML, XML, CSS, and JavaScript. I can also do VB/VB.NET, but only under extreme duress! I’m in the process of learning Python.
So I’ve got plenty of tools to choose from when I’m writing applications, so why do I prefer developing in .NET?
Horses for courses…
That statement isn’t entirely true – I prefer coding in all of them (except VB!). Perl is my favourite for quick scripts and prototyping – I’m also learning Python for these purposes. Delphi is my preference for standalone MS Windows applications – it’s lack of runtimes elevates it above all other offerings here. For ‘public’ internet sites, PHP, Perl & CGI or mod_python will be used, mainly for cost and security.
Now, here’s why I like .NET:
Web Applications – ASP.NET allows you to create event driven applications easily. This requires extensive JavaScript knowledge in other languages.
Web Services – .NET makes creating and consuming web services ridiculously easy. I know they can be done (relatively easily) in other languages, but in .NET they are a part of the furniture.
Security – Code Access Security is – initially – quite difficult to get your head round. As a consequence it’s ignored by a lot of developers, but it allows very fine-grained control over who and how your code is used, and what rights your code needs to be able to execute. Authentication is built-in to ASP.NET applications.
Cross Platform – Yes, .NET only runs on MS Windows, but MS Windows runs on several platforms – PCs, Pocket PCs and SmartPhones. Combine these with
web services, and you have a killer solution.
Object Orientation – OO is very much a part of .NET.
nTier – A nice buzzword, but once you understand the concept, .NET makes it easy to implement.
Visual Studio.NET – This is a big part of why .NET works so well. I learnt ASP.NET via Notepad and the SDK, and I managed. When I moved up to VS.NET it opened up a whole new world. VS.NET is a bloody good IDE, and it makes writing applications very quick.
Note that MS Windows applciations (with the exception of consuming Web Services) are not a reason I use .NET.
To sum it up, if I look at a problem I can visualise and implement the solution in .NET very quickly. If I try to do the same in another language, I get extremely frustrated – e.g. using OO in PHP and Perl.
Snake Oil
Don’t get me wrong. .NET is not a panacea for development – it has it’s fair share of problems but due it’s extensible nature most can be remedied without involving Microsoft. A huge community – encouraged by Microsoft – has grown around it, and unlike it’s predecessors a lot of code, libraries, and utilities are released for free – either under the GPL or comparable license. There is still a lot of proprietary or shareware stuff, but some are well worth paying for. If that really rubs you up the wrong way, just remember you don’t need them to your job done.
One of my biggest problems with it is that the HTML generated by ASP.NET ‘bends the rules’, so it you are standards junkie, you will be frustrated. On the flip side is that ASP.NET adapts its output according to the capabilities of the browser.
What about Mono?
I see a lot of potential in Mono, but it’s still got a lot of ground to make up. For now you can forget about compiling your .NET code on Mono and vice versa. Cross platform (different OSes in this case) is possible, but only by using Mono on both UNIX and MS Windows.
Where I can see it getting a lot of use is powering Web Applications and Web Services. Being able to run your application backend on a UNIX or MS Windows server will appeal to a lot of current .NET developers. As far as desktop application development is concerned, it’s not currently going to win many .NET developers over – in fact I can imagine more Mono developers jumping to .NET once they’ve got to grips with the concepts.
Disclaimer (of sorts)
I’m currently certified in C#/.NET Web Applications and Web Services and studying for my MCAD and MCSD which I intend to complete before the end of this year.