bradyep.com

A Vanity Website

Developing AND Running Dot Net Application on a Mac

Technologies like Entity Framework and Asp.net MVC have been open source for some time now, so although the open sourcing of the .net compiler wasn't a complete shock, it has opened up a world of new possibilities. The first thought that probably popped into people's heads was running web sites and services on cheap Linux boxes, and that is right around the corner, but what I figured I'd take a look at is developing and debugging .net applications on my Mac.

Visual Studio Code

The first thing you will want to check out is Visual Studio Code:

Right now I'd consider this a text editor with some pretty impressive IDE capabilities. For c# and TypeScript, you can do things like find all references to a symbol, refactor symbol names, either go to or peek definitions. Plus it's got full Intellisense for supported languages. The first thing I did after downloading it was compare it to Sublime Text. Since VS Code doesn't support plugins, I wanted to see if it could do everthing that my Sublime with plugins could, and surprisingly, it did! I have a diff plugin for ST that is matched by VS Code's "Compare Active File With" functionality - which displays side by side diffs for any two files. I also needed something that made unformated JSON and XML look pretty. For Sublime I used a package called 'Indent XML', and this is totally outclassed by Visual Studio Code's "Format Code" option! VS Code also supplies both automatic bracket highlighting as well as one-button Markdown previewing - again both things I needed packages for in Sublime Text.

Considering it's only been out a few months, VS Code is pretty amazing. Consider that it is also built using Electron, which is something that Git built to allow web applications (HTML, CSS and JavaScript) to run on the desktop. Also worth mentioning is that it runs really well! I tried loading one of those gigantic XML files into Visual Studio Code and it actually loaded faster than the native Sublime Text! This is even more impressive given that Git's own Atom editor (also built on Electron) is notoriously slow at loading huge files. I'm not sure I've seen a impressive use of web technologies in a desktop app - it really is a ringing endorsement for the future of "hybrid" application development.

Local Debugging

As you can see I'm using Mono to run the actual .net code on the desktop in OS X. You'll have to jump through a few simple hoops to get this all up and running and it is outlined here.

Conclusion

Hopefully the open-sourcing of .net leads to wider use across the technology spectrum. It has some pretty impressive takes on synchronicity (async/await), working with collections (LINQ) and of course killer languages and development tools (c#, TypeScript, Visual Studio and VS Code). But even without wider adoption I think Microsoft has succeeded in making their tech more attractive and even cool. For instance, I am actually planning on creating my next Ludum Dare game not with Game Maker as I had before, but with the open source JavaScript game framework Phaser, using Visual Studio Code and TypeScript - all while working on my Mac!