
Ask HN: What are the selling points of .NET? - brightball
Just looking to better understand the stack and it&#x27;s strengths, particularly where large web applications are concerned.
======
jasonkester
On top of all the good replies about Visual Studio and the C# language, one
major benefit I don't see mentioned here is framework stability and backward
compatibility.

ASP.NET is a Boring Stack. In the best possible sense of the word. Nothing
surprising will happen to your code while running in the wild. The server will
stay up, memory won't swell to infinity, nothing needs cycling periodically
"just in case", and patches for critical bugs (which seem to be few and far
between) trickle in via Windows Update on the server and never seem to require
user attention. And it's generally fast enough that you won't ever (meaning
_ever_ unless you're StackOverflow) need to think about adding even a second
server to run it.

Better still, you can know that there will never be a breaking change to the
framework. I have code that has been running in production since 2003 with
occasional bursts of activity, but mostly just doing its thing without any
drama. It started on Version 1.1 and has received a handful of 5-10 minute
bump-the-version-then-smoke-test sessions along the way to bring it up to
Version 4.5, with never any requirement to rewrite something that was working
because the framework authors decided to go in another direction. And of
course, it would still be happily running today on ASP.NET Version 1 had I
decided to leave it there.

That's _huge_. It means that, rather than having "keep this website alive" be
a part-time job, I can spend that time instead building something _else_.

And even fifteen years later, that next something else invariably ends up
being written on that same boring-yet-evolving Microsoft stack.

------
samfisher83
In my opinion Visual Studios is one of the best IDEs out there. Also .NET is
pretty well documented. C# also tends to be very good about getting new
features Linq, async, anonymous function, generics etc.

------
Nelkins
As with any platform there are strengths and weaknesses. In my mind, the
greatest strength of the .NET framework is the sheer number of ways you can
leverage your .NET knowledge to create various types of products. For example:

1\. Desktop GUI applications. WPF is in my opinion the best GUI framework for
Windows, and many well-known Linux GUI apps have been made with Mono + GTK.
You can even create Mac GUI apps with Xamarin.Mac (with commercial support!).

2\. Server/web software. ASP.NET MVC, ASP.NET WebAPI, NancyFX, Suave...the
list goes on for various frameworks (most of which will run on Windows, Linux,
and OS X).

3\. Video games. Unity is very commonly used.

4\. Internet of things. You can run .NET on a Raspberry Pi, and on various
other embedded devices (again, with commercial support!).

5\. Mobile apps. You can write iOS and Android applications using Xamarin. In
my opinion, it's the best tool to write native, cross-platform mobile apps
(when considering tooling, enterprise support, etc.).

Some other great points:

1\. C# and F# are generally considered to be very-well designed languages that
support a variety of programming styles.

2\. .NET has very broad adoption in enterprise. We hear about Rails, Go, Node,
Clojure, etc. here in the HN echo chamber, but in any town beyond the big
cities you're far more likely to find a C# or Java job. In the next big
downturn, you'll be happy to have .NET on your resume.

Now of course, .NET can't do EVERYTHING. It's VM-based platform, so of course
there will be applications (very low memory, for instance) for which it isn't
suited. That said, from a bang-for-your-buck perspective it's a pretty
tempting offer.

------
sharemywin
There's a large pool of .net developers that are generally less expensive to
hire.

he following technologies feature most strongly in job vacancy advertisements:

Java — featured in 18% of adverts with an average salary of $100,000 USD

JavaScript — 17%, $90,000

C# — 16%, $85,000

C — 9%, $90,000

C++ — 9%, $95,000

PHP — 7%, $75,000

Python — 5.5%, $100,000

R — 3%, $95,000

Scheme — 3%, $65,000

Perl — 3%, $100,000

[https://www.sitepoint.com/best-programming-language-
learn-20...](https://www.sitepoint.com/best-programming-language-
learn-2015-job-demand-salaries/)

------
jacobprudhomme
I guess first and foremost would be Visual Studio. Still one of the greatest
and most powerful IDEs to use, in my opinion. I love it. Secondly would be
that it might just be the most well-documented and supported native language
for Windows, that isn't open-source. The power of all the languages at your
disposal (the ones that run on .NET) is immense, and if you already programmed
with another standard of C++, getting used to the .NET implementation will be
a piece of cake (mostly). Also, if you'd like to go with smaller languages,
there are many others that are based on the .NET framework, such as the
functional F# or the Python-like (but compiled, not interpreted) Boo.

------
UK-AL
I'm a C#/MVC developer working on a fairly large e-commerce site. It's a
distributed system using message based microservices tied together using
[https://particular.net/nservicebus](https://particular.net/nservicebus).
There is also
[http://masstransit.readthedocs.io/en/master/](http://masstransit.readthedocs.io/en/master/)

Some great tooling Visual Studio, Octopus Deploy, red gate SQL source control
etc

C#/F# - The languages are very nice. Huge inbuilt library.

C# is probably one of the best statically typed, OO languages there is. For
functional languages you have F#,

C#/F# is starting to run on many platforms including iOS/Android/Linux etc See
Xamarin

The .NET platform is the home of CQRS and event sourcing if you want MASSIVE
scale.

------
Someone1234
I'm currently a .Net programmer (C#/MVC).

But we're just developing in-house business systems, on a mostly Windows
network which it is well suited for. If you're actually doing a "large web
application" (distributed?) I'd likely still recommend Java on Tomcat.

Why? .Net's biggest strength as a platform is that it hooks into other
Microsoft services and technologies (from AD, to Sharepoint, to Office 365, to
Azure, and beyond).

.Net's biggest drawback, at the time of writing, is still licensing. .Net runs
in IIS on Windows Server. Yes, I know, .Net core is on Linux but that isn't
near production ready. So for the next year or two you'll be paying for
Windows Server which is pricey (both literally and because the hardware per
user is lower).

Java on Tomcat running on Linux is cheap. Very cheap. And it is a tried and
tested platform that has been used at almost all scales (from small bespoke
business applications up through distributed goliaths).

I actually prefer C# to Java in terms of programming language. I also prefer
how the .Net libraries are laid out and how thoughtful even down to method
overloads are. But ultimately language and library choice should play second
fiddle to platform choice and cost/benefit analysis.

If you're doing bespoke business applications in a business with a Microsoft
network, .Net may make the most sense. If you're exposing it to the world as a
service, I'd do Java or in some cases look at Ruby on Rails or something else.

~~~
UK-AL
Running a huge e-commerce site using .net has been pretty good for us.

~~~
Nelkins
It has been good for Jet.com also.

~~~
stan_programmer
Jet.com is all in F# at that...

------
PerfectElement
Visual Studio: I run a medium-sized profitable project pretty efficiently and
all I have to install and understand in terms of tooling is Visual Studio.

C#: Very flexible and extremely powerful. For a busy(lazy) programmer like me,
it's very easy to find libraries or stackoverflow solutions for pretty much
everything.

------
twunde
Pros: 1) .Net has strong interop abilities with Excel via COM objects. Where I
work, the Operations department basically uses Excel to run 80% of all
automated processes. They just need to upload a spreadsheet, press go and
everything runs. This is probably .Net's biggest strength. 2)You can run
everything out of Visual Studio including Azure integrations 3) Unlike
Eclipse, Visual Studio is fast and frankly is full-featured unlike Sublime.
It's really nice. 3) Microsoft stack (SQL Server + .net) works well together
4) C# has several frameworks like Web API for REST apis and WCF for SOAP that
really make development nice and easy. 5) You do get support 5) The main
languages are well-written and full-featured. C# and F# are actually a
pleasure to use. C# also gives you LINQ which is really has few if any
equivalents in the open-source world.

Cons: 1)Very little is open-source compared to other stacks. Be prepared to
pay for everything including deployment mechanisms. This also includes
tutorials and other learning resources. 2)Anything outside of Visual Studio is
difficult. This is improved with Powershell, but there seems to be a lack of
Powershell knowledge among Windows sysadmins/.Net developers compared to BASH
knowledge among linux developers. 3)You may need to have 2-3 different
versions of Visual Studio installed. 4) If you're doing something unusual
that's outside the traditional software stack or requires something that
Microsoft hasn't built yet, you may be in for a world of pain

In Summary: .Net really shines when you're using it with the entire .net stack
especially if you're using Microsoft Office. Additionally .net has the nicest
IDE I've seen so far. If you're used to the open-source world it could be a
painful journey. There are tons of libraries without free equivalents in .NET
and certainly learning resources are limited.In java or python you could
easily switch out parts of your stack, that's not the case with Microsoft.
Everything is fairly well-polished but there are missing pieces, especially
once you start to stray away from the Microsoft solution to the problem.

------
clyde-radcliffe
i've been using .net for years (since 1.x), before was using Java... i think
you should consider the very good documentation (MSDN on all) the main
drawback, IMHO, is when you try to go out of the MS PATH you could go crazy
(eg using different DBMS different than SQL Server or using different
implementation patterns).. this applies to medium-big sized project not for
simple ones... Hope the .NET CORE will solve this.

Moreover, Visual Studio is great even if a bit buggy. hope this helps

~~~
brightball
So is the implication that using non-.NET stack pieces creates headaches? Ex -
PostgreSQL with the T-SQL plugin?

~~~
WorldMaker
It definitely has been the case that .NET very nicely golden pathed the
Microsoft solutions and working with non-Microsoft options in the same space
was quite a bit harder and a lot less golden.

Some of that was intentional (if you are using .NET, you clearly should buy a
MS SQL Server license), and some of that was simply that .NET as a culture
didn't embrace open source all that much until recently. Most .NET developers
traditionally have been in the sort of big-E Enterprise development land where
"use what Microsoft sells because we can trust it" and "don't publish anything
to open source" have long gone hand in hand.

Both of that definitely seems to be shifting for the better. There are a lot
more .NET developers with at least one foot in open source these days,
including and especially Microsoft as almost the entirety of .NET itself is
now open source. You can also see that the Developer Division at Microsoft is
less marketing driven and sees less need to pressure people to stay on the
Microsoft sold golden paths and is increasingly happy to help pave over some
of the cow paths and make working with non-Microsoft solutions easier than
ever before.

Obviously, still a lot of work to do on that front, of course, but if you look
at EF Core, for one example, you see much more embrasure of supporting the
Microsoft option _and_ the non-Microsoft options. Before EF Core it was hard
to imagine seeing PostgreSQL support or SQLite support in EF.

------
randomnumber314
I've done some development with Java, writing Android apps, and some work in
Unity making games, and by trade I'm a PHP developer--I'd be curious to hear
how .NET workflow compares to these others.

------
facorreia
As an alternative to the native Windows stack (C++) its main selling point was
increased productivity and fewer bugs by using managed memory allocation and
by avoiding native pointers.

------
Khelavaster
__Visual Studio __

\- One-click build and debug for every project.

\- One-click publish to web (AWS, BlueMix, Azure, etc.)

\- CodeLens and its inline code annotations.

\- Unit test runner is multithreaded, runs tests continually in the background
as you edit code.

\- Completely integrated with bug tracking and task/'Kanban' board provided by
on-site TFS installation or by Visual Studio Online. Checkins can be
associated with bugs, new bugs and tasks can be created from the IDE, CodeLens
shows which snippets of code have been associated with each checkin, etc.

\- Built-in style cop/lint tool as well as static code analyzer tool.

\- Debugger prints execution time for each line of code passed over.

\- Built-in instrumented/trace-based profiling and sampling profiling.

\- Built-in REPL (read/evaluate/print loop) console.

\- Debugging supports on-the-fly runtime modifications with the Immediate
window. Modify a variable in script and see the modified version propagated
through the rest of the program.

\- Fakes & Shims is the most powerful unit testing framework in existence.
Shims let developers arbitrarily overwrite any dll's, including .Net framework
dll's, after they've been loaded into memory to redirect method calls to
"shimmed", custom implementations of those method calls. Fakes automatically
generates mocks from classes you yourself create.

 __ASP.Net MVC + Web API from Scaffolding with Entity Framework __

\- Start with a C# class, optionally annotated with DataTypes (e.g.
[DataType(DataType.Email), limitations (e.g. [MaxLength(20)]), and database-
oriented attributes (e.g. [Key] or [Column(2)])

\- Async server methods are as easy as prefacing the controller method with
'async' and 'await'ing on the function you're waiting on.

\- Automatically generate a base ASP.Net MVC + Web API website with a set of 6
database tables for member/role-based authorization and basic user
authentication tables.

\- Automatically generate a set of 5 csHTML webpage templates for index,
create, edit, delete, and details views for the C# class you created at the
beginning.

\- Add a link to this new set of webpages to the automatically generated
navigation bar, which already links to example "about", "contact", and "main"
pages.

-Data migrations entail:

...1. Once in your entity framework project's lifetime, run "enable-
migrations" in the NuGet console.

...2. Whenever you've made a change to your C# entity class and want to update
your database, run "add-migration YourArbitraryLabelNameHere"

...3. When you're ready to push the changes to your test database, run
"update-database".

 __.Net Libraries __

\- Covers all your bases. If it 's something you need to frequently do on a
Windows computer, there's a library for it. From strings to spreadsheets to
speech recognition and synthesis [for accessibility.]

 __Networking __\- Thanks to clever use of generics and a config file, create
a ClientBase <TService> MyClient; and you're able to call services remotely
with MyClient.ServiceMethod().

\- Serialization mode is an enum. It's trivial to switch between binary, JSON,
XML, SOAP, and custom serialization.

\- Encryption up to TLS 1.2 is trivial by using the correct enum promoting a
MemoryStream into an SSLStream.

\- Any program can self-host a service or a client by adding a WCF reference
and including a config file.

\- RESTful HTTP Web APIs out of the box; see auto-generating MVC and Web API
sites above.

 __C# Language __

\- Built-in async /await and Task/Parallel libraries for effortless
multirthreaded, asynchronous, and

\- Functions are first-class objects. Func<int, string> GetLength = (s) => {
return s.Length; }; GetLength("Hello") = 5;

 __LINQ Library __

\- Declaratively filter, transform, and aggregate data on any IEnumerable.

\- LINQ to SQL, the .Net ORM querying framework, is always interchangeable
with LINQ to Objects. Your data access code remains identical whether you're
working with a SQL database or with in-memory objects.

\- Virtually eliminate need for foreach loops.

\- Powerful base group of features including GroupBy, Select, Where,
SelectMany, AggregateBy.

\- Easy to mock database collections with in-memory collections for testing.

------
miguelrochefort
Xamarin. It lets you build native mobile apps on Android and iOS using C# or
F#.

------
herbst
It's relatively easy to setup on windows compared to other dev stacks.

~~~
jenkstom
Having recently moved to Visual Studio 2015, I can't say I agree. Especially
compared to something like PyCharm with Django. Visual Studio wasn't _too_ bad
(Ok, it really was for an installer), but getting up to speed is just a
nightmare. I've been trying to get identity to work on PostgreSQL for weeks,
where it "just works" in Django.

Granted, if I completely stuck with the Microsoft stack I wouldn't have this
problem. But if I stuck with the Microsoft stack I'd be deploying Silverlight
apps too...

Microsoft is making efforts with .net core to move past the infamous lock-in
effect. But they aren't there yet.

Don't get me wrong, I write an awful lot of c# code. But I write a lot of
extra code making things work that should be easy. Ever tried to integrate
Entity Framework into an IBM iSeries? If you figure that out, please let me
know. Please let everybody know.

~~~
kamau
Would it have been easier if you had tried to make Django talk to SQL Server
or Active Directory? In other words is this just the MS stack making things
difficult for you or just a general impedance mismatch of tools that weren't
designed with each other in mind?

------
d0lph
LINQ and Visual Studio are pretty nice.

