I actually never thought .NET would appear on Linux. Years passed and the Mono Project brought an implementation of .NET to Linux. When I was building a personal website in 2009, I decided to launch it on top of the Mono implementation of .NET. That website went away as I focused on other things and Mono improved. Months ago, Microsoft decided to official support .NET on Linux.
I recently built a substantive example website from scratch in 4 days using .NET for Linux. The process grew my understanding of how .NET could be improved in a Linux environment. This article provides a short list of things that would be useful with the technology.
Universal Case for C# and .NET
The technology is immensely productive. I have done some work with C++ in my spare time during the last few years. Even with a time gap of 2 years since I last used C# and .NET, I noticed I can write complete solutions (reliable and feature complete) in less time than the equivalent solution in C++. Even when the conditions are equal such as using the command-line, using a text editor, and no debugger at all. That is not a critique of C++ but reflects the streamlined nature of C# and .NET. You can accomplish a wide variety of software from scratch with .NET sooner in pursuit of your goals. C# is a well structured programming language that has a range of complexity from the minimal to the most intricate. The modules you can design with C# and .NET meet many quality criteria in software development.
From Linux to Microsoft
Linux was the first platform I adopted for web development in 1998. My use of Linux was for a company I ran and much of it was on third-party, free shared hosting. I had no server costs. It was a brief period of time ending in late 1999. I didn’t have a viable business model at the time. I learned much, but for professional work I shifted to Microsoft. I quickly found that Classic ASP was more in demand by employers where I was living. Linux was a distant memory. When 2001 came around, I was firmly in the direction of using Microsoft technology and became one of the first wave of people to apply Microsoft .NET technology and advocate its use.
Why Choose Microsoft over Linux
I still apply Microsoft in professional endeavors. It is the preferred platform for corporate business for data processing and Microsoft Office is the standard on desktops. Both are well supported from an IT systems administration standpoint which is important for business continuity. Steve Marks on Forbes.com explains it realistically in his article, Why Most Businesses Will Keep Buying Microsoft.
Privately, I use Linux. Privately, I do not need Windows and related software. I once considered that transitioning businesses and institutions to Linux would be a good idea, for about a year, until I slowly decided that was not a good idea. It is not enough that someone knows how to build Linux solutions. Any solution you define must flow into established paradigms of IT support. See the VentureBeat article, Microsoft leans on enterprises, which now account for more than half its revenue.
People who advocate for Linux who want to see it spread further may not want to hear this, but Linux does not work in the enterprise. Business is about customer relationships and value delivered. Microsoft is more aligned with getting business to outcome more efficiently.
Where Linux Definitely Works
Corporate business benefits from Microsoft but global scale web applications and computer networked applications at global scale are often better served by Linux. Enter companies like Google, Facebook, and Amazon.com. I often cite those three. I do so because I am part of a generation that witnessed them go from zero to mass level in a short time (under 10 years) partly on the technological choice to use Linux or BSD. The Linux-based operating systems have proved themselves at scale, cost, and technical evolution. Scientists certainly use it and related systems having created their own version of Linux called Scientific Linux. The point is, for certain situations and goals, Linux definitely works.
Why I Privately Use Linux
While I use Microsoft professionally, I personally use Linux for the following reasons. I was drawn to it on the principle that Linux was more technologically rigorous, peer recommendation, inherently more secure, and more likely to obtain core innovations.
- Technological Rigor – At the time I began switching (it was some period of back and forth to Windows as I got adjusted), I considered that software coders working on the Linux Kernel were greater in number and more free to transform that code to correspond with the best ideas from computer science.
- Peer Recommendation – I do not discount the years where personal colleagues of mine expressed the virtues of Linux in casual discussions about technology in general. I overlooked their suggestions for a long time because I was intensely focused on other things. My focus was streamlined enterprise IT systems definition and implementation. Their comparative descriptions about security, reliability, and expansion capability remained with me. A time came many years later when I would explore these claims myself as I was seeing limitations in the Microsoft model in my private endeavors.
- Security – This is more perception than reality and unlike in social affairs the two are not the same in technology. Linux does have a design more secure against the casual disclosure of information than several alternatives. More secure alternatives than Linux exist (most of us cannot afford them). The reality is that almost no digital computer system is 100% secure but it is good that Linux addresses casual disclosure particularly well with particular privilege separation design and abundant selection of cryptography tools. All these tools and designs are more accessible to wider vetting by the technology community.
- Innovation – The advances seen in Linux are not the kind normally associated with products for sale. They are more fundamental innovations involving better ways to transfer data, process data in programs, store and secure information, define information systems, and software assembly that more closely corresponds to academic research and practice. For some of us inclined more towards the practical side of technology, this is often so abstract as to be unnoticeable. The impact is in making solution derived from core innovation much better in form and operation. That makes innovation of the product and operational kind more likely and sustainable.
Those are not very strong arguments for Linux. They are actually opinions without factual basis. In my personal experience, these qualities exist concordant in Linux in a way I have found quite useful. Seeing these qualities in operation in the release of new distributions such as Ubuntu and RedHat has given me reason to believe that open source and free software values actually do work.
Where does that leave us with .NET on Linux?
Free Software Principles
A great improvement for .NET on Linux would be in licensing. The implementations do have an open source license. I am fine with the license that I have seen. Based on comments I have read, many others may decide not to embrace it due to a lack of certainty around the license.
A traditional view is that if you widen the license, you could lose control. A different view is that if you widen the license, you get to prove you are the best source for the technology. Even though the Linux kernel is done according to free software principles, why is it that most of the operating systems that use it pull from a single source? What does Linus Torvalds do differently that most operating systems built around Linux opts into his implementation over others? The answer is that his is the best implementation and the group surrounding that implementation is more active in cultivating it. The same could be said of an open source .NET solution that is more aligned with the perception of an open source project.
.NET Environment Optimization
This is where I switch to technology. My biggest critique of .NET on Linux is that it is too big. That is to say if I want to quickly spin up a development environment, I have a lot of downloading and installing to do before I am ready to go. When the complete .NET environment for development is packaged up, it needs to be just one or two files, not the dozens of files that is consists of today. The goal is quick deployment. Using a term from .NET terminology, .NET itself needs to trivially operate according to the xcopy deployment approach.
I do not mind privately building an example showing ASP.NET running on Linux in a virtual machine as a series of articles. The way Mono and .NET Core are currently organized could be vastly improved enough in the deployment department that others may find it as flexible to use as Linux itself. When I consider .NET as a development platform for Linux, I truly admire the progress it has made in terms of availability and now support from Microsoft. The next step before I would really be viable is greatly improving how the infrastructure of .NET is disseminated.
C# Has a Greater Potential
Limiting C# to .NET is a huge limitation. The sharp mind, Anders Hejlsberg, designed one of the most superb language specifications. He created true productivity in terms of a language with a C-Style syntax. The next step is to make C# a supported language for the gcc and clang compilers. Cross-platform, native code C# would dramatically change the technology industry overnight. Especially if it could link in existing native libraries. A good starting point could be the open source .NET Compiler Platform.
Such an accomplishment might even be the one legacy of Microsoft, in the technical arena, that exceeds their other contributions in terms of widespread use. A native code C# addressable by gcc and clang could become the 21st century version of C for application development and those areas that sit between systems level and application level code. Until then, the potential for C# will remain hindered by the valid preferences for execution environments other than .NET.
Competition with PHP
As of this writing, PHP 7 is around the corner. The group around PHP has fostered a web development foundation for Linux when both PHP and Linux was emerging on the scene. PHP has proceeded through a longer cycle of tuning and optimization relevant to Linux. ASP.NET has a proven design for web development, is very structured, and highly attuned to the IT way of developing web applications. Despite these advantages, PHP has the edge on Linux in terms of mind share. That can change, but it is early to bet a critical operation on the use of ASP.NET on Linux short of a cadence of credible success stories at the scale of Facebook.
Short-term Future for .NET on Linux
No one can say for certain what the future holds with .NET on Linux. It could come and go in terms of initial momentum or it could be the next big thing. As a professional option, today, I think ASP.NET on Linux can scale to a department level, but I wouldn’t put it in a world facing web situation. I can say for myself, .NET on Linux, in a virtual machine, is a good way to stay current with the technology and perhaps write a few utility programs in a virtual machine. With all that I have put forward here, that may be all the value it has to provide for the foreseeable future.