Hacker News new | ask | show | jobs
by BringTheTanks 4070 days ago
I'm curious, is there a reason to avoid using .NET for web services deployed on *nix?

I'm interested in using it, I love .NET as a platform, I just have this vague sense of worry that I can't quite rationalize. Mostly based on Microsoft's past performance with cross-platform efforts.

Thoughts? Is my gut feeling right or wrong?

6 comments

I can't answer with complete certainty, but I'd like to point out that C#/.NET is now more open than Java/JVM. A case like Google vs. Oracle couldn't happen.

- C# is standardized (albeit an older version that the current one) - C#/.NET has more permissive licenses (MIT & Apache vs GPL) - C#/.NET is now developed in public, on GitHub - Microsoft has promised not to sue for patent infringement on .NET

I'm not a lawyer nor do I play one on TV, but it looks like even if Microsoft changes it's mind, it can't take it back. The worst it could do would be abandon support. That would be a huge hit, but something the community could recover from.

Meanwhile, you have Java with Oracle shutting down security fixes for Java 7, unless you get a long-term support contract. Which would you rather deal with?

> it looks like even if Microsoft changes it's mind, it can't take it back

I had some correspondence with RMS back in November right after CoreCLR was announced, and he doesn't seem to agree. All he said was that MS's non-standard/custom patent grant isn't sufficient and that http://endsoftpatents.org/2014/11/ms-net/ is correct.

While I think http://www.fsf.org/news/dont-depend-on-mono was cogent and made a convincing argument at the time, and there may even be problem with the new patent grant, the endsoftpatents.org analysis just seems like a poor one.

I also pointed out that the .NET Micro Framework wasn't under a custom patent promise, but instead has been available under Apache 2.0 for years. It seems that even if let's say the worse case scenario is true, and there is a loophole in the patent promise, and it was put in to facilitate nefarious plans on MS's behalf, then the free software community could render even such deliberate plans as ineffective. The key move would be to continuously and aggressively hedge on alternatives and to make it well known that's what's going on. The community could aim for aggressive portability to other languages/runtimes with the use of a tool to do mechanical translation. If MS (or one of its affiliates) tries anything shifty, the community flips a switch and for compatibility relies on an NETMF-based runtime (still being available under Apache 2.0 and all) and otherwise begins living entirely in Vala land, with MS having proven they don't want to play ball.

It's like Mutually Assured Destruction, except for one side's wholesale elimination of their risk of being destroyed.

CoreCLR is open source now, so even if Microsoft abandoned it tomorrow, the community would keep maintaining it or worst case most of it would probably get merged into Mono. This BSD port was mostly a community effort by the way.

I've recently decided to switch to .NET for everything. Mainly because I really like F#, and I've been using C# for a side project in Unity, but also because an open source CoreCLR makes me worry a lot less about vendor lock in.

Nice choice! There is a _lot_ of investment in .NET at Microsoft. The move to open source and the community reaction to it has only made it more exciting and compelling for the company.

I get and appreciate the sentiment on "if Microsoft abandoned it tomorrow". Just clarifying that this risk is _very_ far from reality.

It's also really interesting to look at how Microsoft is approaching C#/Roslyn. One aspect of that is the C# 7 effort, which has an ambitious scope and has a great deal of open/public interaction. Check it out: https://github.com/dotnet/roslyn/issues/2136

IIRC, the stack was mostly proprietary commercial software. It was expensive to get started unless you use the dev edition, even then you need Window.

For me, the web development was too magic, way more so than RoR. I got an acquaintance that only do .Net. And he harps about how .Net got Razor and data base represented as object unlike open source. When I pointed out that Razor was just a template engine and that database thing is just ORM which many other MVC frameworks have he just didn't get it. He didn't get it's a template engine nor does he understand that it's an ORM. Magic! I also tried some .Net dev, and it's very magic in term of abstraction. The VisualStudio IDE is amazing and C# seems like a much better language than Java. But the ecosystem isn't as rich, Apache such an awesome organization but Oracle is very pushy.

The downsize for me is big, ecosystem. Most of the open source projects play very well together, C# is a newbie, I rather wait for it to mature within the open source space (including books and tutorials).

I feel like there's this stereotypical .NET dev in everyone's head on HN. Your friend, for example, didn't even know that Entity Framework was an ORM, and he likes "magic" and not understanding any lower level implementation.

That's too bad, because there are tons of sharp .NET devs who despise the concept of "magic" (and no, ORMs are not magic, and Entity Framework is fantastic) and who understand the abstractions that .NET offers. I would hesitate to write off all .NET enthusiasts as clueless less-than-hackers.

(disclaimer: Microsoft employee, nothing to do with .NET though)

One thing I find good about Microsoft's libraries is that for the most part they do a good job of working as magic and working with someone with understanding.

XNA is the example I always use. You can use XNA and make games without understanding anything about the graphics card but you can also dig in and write your own shaders and basically go however deep you want to/need to.

There are some things in .NET that do seem kinda magic, and razor is one of them. Not because it's a templating engine but just in how lightweight it is and how surprisingly decent intellisense can be with it. Most templating engines feel so verbose and ugly after working with razor.

Agreed on Razor... it's by far the best template engine I've used. It's a shame it's a bit of a pain to use outside of a web context (email templates, for example). Though I actually like using component-like systems more now (React, MercuryJS, RiotJS, Polymer...) with JS client and server.
I know what you mean, but I also think that street runs in two directions. ASP.NET was pretty late with MVC because (of course this is just me speculating) that was what those dirty Django & Rails heathens were up to. Turns out, MVC was a pretty good idea after all.
If you use ASP.Net MVC it's a lot less magic and more predictable than using webforms... That said, Razor with C# is a really nice template engine. The integration is far nicer, and more predictable than any other I've used. These days I'm targetint React under node/iojs which I would say is far more magical...

Entity Framework is also a really nice ORM for most small-mid sized projects... If you're really stuck on using a strongly-typed environment I will say that C# is one of the better ones and would choose it any day over Java (and a lot of others). My issue with many .Net and Java projects is that a lot of "enterprise" design patterns are used when they are more in the way than helpful. Abstractions are used which only improves testing or portability, but neither testing or portability are used. But this is more of a design choice from the developers than the languages/platform used.

I also disagree with your reference to .Net/C# not having a large ecosystem... There are a lot of tools for C# out there, most open-source and easily available via Nuget. Not to mention that Stack Overflow has authoritative answers to almost anything you could need with .Net or C# and has MS employees as regulars to offer support.

This is from someone who doesn't even write much C# any longer (still supporting two legacy apps in C#), and does most of his development being deployed to Linux servers.

Just because someone doesn't understand it doesn't mean it's magic.
I wouldn't worry about the past part. We use IBM software on *nix and they were worse in their day than MS ever was.

A few people have concerns that the patent grant isn't as broad as it should be.

For me it would mostly be an ecosystem thing. I use Typescript because it drops right into the pipeline I was already using, but switching VMs is a big ask. How good is Thrift for .NET?

Yeah, there are Microsoft patent traps out there for code that uses core .NET features in idiomatic ways, and Microsoft's patent grant only covers what's necessary to implement the core CLR. They also only used to cover patents that were essential to implementing the CLR, so just using code that implemented it in the obvious/efficient way could land you in legal hot water. I'd hope they've extended it to cover their actual implementation now that it's open source.
The patent promise that the MIT-licensed CLR has been available with since .NET Core was announced last year is completely different from the patent promises MS has used in the past, and definitely applies to Covered Code (i.e., what they are shipping), just like Apache 2.0. In fact, it's almost as if they referenced http://www.fsf.org/news/2009-07-mscp-mono while crafting the new promise, to intentionally address the problems in that post.

> just using code that implemented it in the obvious/efficient way could land you in legal hot water

Apache 2.0, GPLv3, and MPL2 are no different; you can't take Covered Code that company X is distributing but that doesn't infringe their patent A, then modify it to make use of methods/techniques that do infringe patent A, and expect to be indemnified from litigation. And each of these other "sufficiently-free" licenses explicitly says so.

Having said all that, I do wish they would have expressly used Apache 2.0 instead, just for good measure and to avoid the casted aspersions.

The tooling isn't as good as on windows (namely, httplistener isn't as fast, ditto with the mssql driver).

It's "safe" to use, and will be for the future but is not on par with windows yet.

IntelliJ is better on Unix than Monodevelop - there is still no end to end story for *nix developers backed by MS (compared to something modern like Dartlang)
Monodevelop/Xamarin Studio does indeed have a long way to go. Do you know about the open source project OmniSharp? http://www.omnisharp.net/ which provides xplat development toolchain. .NET in Sublime Text/Emacs/VIM yep. It was created and maintained by both employees of MSFT and the OSS community.