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.
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.
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...
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.
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.
Even if you aren't using .NET Core yet, I also think Azure's web hosting is comparable enough in price to other similar offerings that there's isn't as big of a deal about a "windows tax" for website hosting as many think. Even with something like AWS Elastic Compute while there is an extra cost to Windows VMs it is not that much more expensive if you'd prefer to use the .NET stack.
(That said, I've wound up using Node a lot more than .NET for websites lately for conveniences having nothing to do with cost such as isomorphic development.)
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.
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.
Moreover, Visual Studio is great even if a bit buggy. hope this helps
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.
- 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.
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.