Cross Platform Development with Mono

Recently I moved my main home PC and Laptop over to the Linux Mint distribution, which for someone who has been a dedicated Windows users since I ever got my hands on a PC back around 1990, has gone amazingly well. My next little venture is to do a little cross platform development. Although I have moved away from Windows (not strictly true as I have set up Windows 8 in a Virtual Box environment in-case I need to switch over for something) I still really like the .NET environment and C# language, so I would like to carry on using it. I would like to learn another language like Python / Ruby, but I really don’t have the time at the moment as I have just changed job and I also have young kids at home which takes up a lot of my spare time.

Mono Development with C#
Mono Development with C#

Thankfully, there is the Mono .NET implementation that I can use and it is really well supported. Mono is a Free (as in freedom) implementation of the C# language and .NET runtime that is written to the ECMA-334 open specification. As well as being open source, Mono also has a company, Xamarin, sponsoring its development as they use the mono system for their IOS and Android application development system, of which you can also use for free (within limits).

My main interest at the moment is writing desktop applications for both Linux and Windows. Mono does support Windows Forms, but it isn’t as well supported as the Linux Gnome user interface library GTK. Mono has a version called GTK# and it is designed to be cross platform so you can use it with Windows and Mac OSX as-well.

Fully Moved to Linux Mint

After more playing around with Linux I decided to take the plunge and wipe my main desktop PC and install it natively. I have been trying out both Linux Mint and Elementary OS for a few weeks now in a Virtual Box VM to see whether the desktop experience is any good, and I am glad to say that it has now matured perfectly.

I first decided to install Elementary OS natively. This worked fine on my laptop, but there was a problem when I installed it onto my PC. There seems to be an annoying display bug where the screen just flips out if you have multiple monitors attached. This looks to be a known issue, but I am not sure when it will be fixed. This is a shame as Elementary OS has a nicer look and feel to Linux Mint, but after recently shelling out for 2 very nice 24inch flat panel monitors, I wasn’t going to be in a position where I could only use one of them. Elementary OS worked fine though if you unplugged one of the screens.

Linux Mint Screen Shot
Linux Mint Screen Shot

Next up I decided to install Linux Mint, which in itself is an amazing distribution. The installation process for this was very smooth and within 15 minutes my PC was wiped and I was logging into a fresh install of Linux. Everything worked as expected, sound, display, usb etc. I spent an hour or so installing updates and some applications (Mono Develop, xMind, Cairo Dock etc) and I was all done.

Elementary OS the Stylish Minimalist Linux Distribution

In a previous article I talked about whether a Linux desktop was ready to become a mainstream OS on a desktop computer for everyday, non techie users, like my Dad or Wife. In that article, I concluded that, Yes, Linux is now at the point where it is becoming a viable option. Linux has been the mainstay on servers for many years now, and powers a large proportion of the internet, but it has never really caught on with standard desktop computing. This has changed though with tablet computing as Linux sits underneath the Android operating system.

In the article I stated that Linux Mint was a very good transitional Linux distribution because it looks and acts very similar to Windows, so this would make a users migration to Linux a lot smoother. There are still a number of hurdles to overcome for the user like giving up any Microsoft specific applications like Office in favour of LibreOffice, and general hardware device compatibility, which driver wise, lags behind Windows.

In the comments for the other article, a reader suggested checking out Elementary OS. Elementary is another Linux distribution based off of Ubuntu, that has been designed to be very easy to use. The user interface as you will see in a bit is gorgeous. Also this distribution is very lightweight in that it doesn’t come with hundreds of installed applications like Linux Mint does. This makes it more like a base install of Windows, where you just get the operating system and a collection of small apps and utilities. I find this quite appealing as I don’t like clutter.

Elementary OS - Install
Elementary OS – Install

So lets take a look at this OS. You download the ISO file image from Elementary OS website. Again I am installing it under Windows 8, using Virtual Box. As this distribution is based on Ubuntu, it has a very familiar installer which is very easy to use. The whole process took about 15 minutes. Once the installation had completed I was at the Login Screen ready to sign in and start using the OS.

Free Software Movement Explained by Richard Stallman

I came across a great video by the Richard Stallman, who is the founder of the Free Software movement and the GNU Public License. There is general a misconception that Free Software means that software is free of charge, but this is not necessarily the case.

In this 16 minute video, Richard explains what free software is and what it means philosophically. He also discusses the Creative Commons Licenses and how they can apply to the Free Software movement. Well worth a watch.

 

Can a Linux Desktop Ever Become Mainstream?

Professionally and at home, I have been a dedicated Windows user since I can remember. Windows 3.1 was my first foray into the Windows world. I have never really had any need to use anything else. When I used to work in the games industry all of our development was done under Windows, even if we were targeting other platforms like the Playstation platform, Gamecube, Wii etc.

Every now and again, I take a little dip into the Linux world just to see how it is coming along. One thing that has always interested me is if a Linux Desktop can ever compete in the mainstream against Windows and OSX. By this, I mean would it ever become a feasible operating system to use for non developer hacker types. Or to put it another way, could my Wife or Dad ever use Linux as a general all purpose operating system?

Transition from Windows to Linux
Transition from Windows to Linux

Every-time I take a look, the answer I come too is, No. It is just too hard to use for the lay person. For someone like my Dad or Wife, expecting them to do any kind of configuration from the command line isn’t really appropriate, and the GUI’s of Linux past have been pretty grim. Hackers love them, but not the average guy / girl on the street.

I recently took another look to see how Linux was progressing, because fundamentally, I love the idea of it. A Free, and Open operating system that is not tied to any one particular company. First of all I tried Ubuntu with their new Unity interface. After about 30 minutes use of this new GUI I was left thoroughly underwhelmed. Why, because it doesn’t feel like Windows. Don’t flame me just yet, let me explain. In my opinion, to get an experienced or novice windows user to switch to Linux, then they need a certain level of familiarity to make the transition easier and Unity just didn’t provide it. Sure it has it’s own identity and you can’t knock it for this, but the whole experience felt clunky and incomplete. Next up was Linux Mint 16 with their Cinnamon interface.

#Develop – Open Source Alternative to Visual Studio

For my entire working career, I have been a Microsoft boy. I use Windows (including desktop and server operating systems) and I am a .NET fanboy. It’s a fun environment to program with, flexible and the tools are great. Also I have never really given open source much thought. Not because I don’t agree with it, or anything negative, but I have just never really bothered with it. Until recently that is.

LibreOffice
LibreOffice

About 7 years ago, I tried Open Office, and I didn’t have a very good experience. More recently I have been having more problems with Microsoft Office. It is slow, clunky, and quite unreliable in that I experience more crashes with it than I would like. I decided to try Open Office again, well more specifically Libre Office as that’s what the cool kids seem to recommend. This suite has had quite a while to mature, and you know what, I love it. It is fast, compact, and reliable. It interoperates with Microsoft Office documents perfectly and is a joy to use, so I have made this a permanent switch.

XMind
XMind

This got me thinking. If something like Libre Office is a slick as it is, and Free (Free as in cost and freedom with the source being open), then what other goodies are out there. This has led me on to switching over to many open source tools instead of commercial tools. I now frequently use Gimp and XMind. I am also looking to switch away from Enterprise Architect to an open source UML tool. I haven’t picked my final tool yet, but Modelio is looking very good.

Block Encrypter .NET Library

I have recently released a small open source library that I thought might be useful to people. The library is called Block Encrypter it is designed to make asymmetric encryption of  data in .NET / C# easier. The code in this library has been developed over the past year and used in my open source tools SafePad and Text Shredder. The way in which this library goes about encryption has been peer reviewed by many people in the open source community so should give you a level of comfort that it is secure in how it goes about encrypting data. Block Encrypter encrypts data using standard cryptographic primitives like AES, HMAC, PBKDF, and cryptographically secure random number generation.

Download the Block Encrypter .NET encryption library.
Download the Block Encrypter .NET encryption library.

I have previously discussed AES encryption in .NET in my cryptography series of articles. I also posted an article linking to some really useful videos by Patrick Townsend about how the AES algorithm works. If you are interested in symmetric cryptography I highly recommend watching them.

encryption

First lets look at some usage examples. The main object in the library to call is the Block Encrypter object and this contains methods that allow you to encrypt/decrypt strings or byte arrays of data.

Overview of the Library

The library itself is quite straight forward to use and there are not that many objects to get to grips with. The main entry point for the library is the BlockEncrypter object. This object will then call out to the GzipCompression object, Aes object, and the ByteHelpers object.

Block Encryter Class Diagram
Block Encryter Class Diagram

The library is also well covered in unit tests that exercise the majority of the functionality.

%d bloggers like this: