51 comments

[ 3.5 ms ] story [ 15.8 ms ] thread
You should definitely like if you want telemetry auto-reported to Microsoft for every app you make! It doesn't get any better, folks. You don't even have to consent for it. See https://news.ycombinator.com/item?id=15439001
1. It's the CLI tool that is spying, not the binaries you are generating.

2. `set DOTNET_CLI_TELEMETRY_OPTOUT=true` to disable spying.

One of the things myself and others maintain about Python's Flask is that it's very easy to get up and running. I think ASP.NET Core really has nailed that same sort of streamlined approach. It's less confusing where things plug in and are extendable vs ASP.NET MVC (which I've had the fortune of using since version 3). The idioms make a lot more sense than they used to -- and it's great to see ASP.NET Core idioms expand to other .NET web technologies (e.g. Giraffe).
Lots of good points, but one thing still keeps me off this particular train:

.NET does not (yet?) have the same level of availability of high quality free libraries that other major platforms do. Things like image processing, database DSLs, etc. I think this is in part because Microsoft provides such a comprehensive stack that it kind of discourages the kind of diversity that leads to the proliferation of libraries.

I love C# but I would start new projects on Java exactly for that reason. As soon as you need something special it's most likely available on Java but often not on C#.
There are a lot of ways outside of the C# sandbox so you can always just call Java code if you need it.
How?
Call a Web service, call a console application, read/save a file to disk, use a database, SOAP, etc etc.
Sure. Not sure if it's worth going through that effort though. Especially if you need a tight integration with the Java library.
Yea, if you need to heavily leverage library X then use whatever it's written for. However, if you simply need a way to generate a few simple PDF's or something then that's a different story.

Personally, I prefer to use the most productive language for a project I can get away with because the largest risk is you are simply never going to finish it.

JNI bindings work and allow C#/.NET to call into Java libraries without a problem. It's a standardized interface for Java interop, a good example is how Apache Ignite runs in the .NET version which launches a JVM process and communicates with it from the CLR.
> As soon as you need something special it's most likely available on Java but often not on C#

Like what? Care to elaborate?

I did a project where full text search was the main feature. At that time Lucene was the number one project for that. There was a C# version but totally outdated. It was a really difficult situation with no good choices: Port the Java code myself? Wrap in into some kind of server? Move to Java?

My conclusion was that next time I'd be better off learning Java. C# seems better but there is a lot of cool stuff written in Java so it's probably not that bad. When I look at machine learning and AI it seems Python and Java also are the best options with everything else way behind.

SQL server has that, I think it was even the vanilla free version. And it was fast. Going from 10 second queries to instant again. Can't tell you how it compares to Lucene.
My project was a little more involved than what SQL Server functionality provides. For most use cases SQL Server full text or SOLR would be sufficient but this was very researchy with writing custom analyzers and scorers (not sure if I get the terminology still right).
> At that time Lucene was the number one project for that

Ha. I remember this. My co-worker was trying to do the same in .Net, but while he was looking the Lucene port to .net was well underway, so you were probably 6 months to a year ahead of him.

I guess all I can say is that you are a pioneer. Most of the special things in Java eventually get ported to .Net.

Excellent point, I have developed in asp.net mvc for quite a while, but I am currently doing a asp.net core project, and it is a nightmare, there is absolutely nothing but the most basic libraries ported to core, even entity framework itself doesn't have lazy loading yet, which is the most basic feature anyone would want from ef. My current dragon to slay is doing things with pdfs and reporting on asp.net core, there is nothing truly open source.
The Full .NET Framework are fully supported and not going anywhere, why don't you just continue using them? Do you need a cross-platform runtime?
We tried actually, but the oddest thing happened to us, we could not connect to our database that way. I even created a brand new .net core app and changed to target 4.7 as soon as the change is made we lose connection to database
VS 2017 has a template that lets you create a ASP.Net Core project using the .Net 4.6 Framework. You get all of the goodness of .Net Core Asp.Net and the compatibility of .Net 4.6
Their NuGet ecosystem is extremely rich. For example, see https://www.nuget.org/packages?q=image+processing

My experience is that LINQ pretty much beats every other way of interacting with a database I've ever seen.

Core is likely a more restrictive right now - EF Core for example is still in a very weak state, but things are improving and in a few versions I fully expect it to be a solid product.

Entity Framework is a pretty fantastic ORM. The only thing that's ever come close for me is SQLAlchemy.
EF6, yes, it really is the best thing going. But EF Core right now has some major issues with lazy loading and not supporting group by on the DB-side last I checked. I believe those are both scheduled to be fixed.
Yeah, I wasn't referring to Core -- last time I checked, it wasn't quite there yet. I don't think it ought to be much longer, though.
LINQ to SQL is pretty poor in my opinion, plus it's no longer maintained and bugs aren't fixed[0].

[0]: http://www.aidanjryan.com/blog/2012/08/25/sqlmetal-bug-with-...

Entity Framework replaced LINQ to SQL years ago - it’s had multiple major revisions, and two major revs of the .NET Core version.

The initial version in 2008 was a total mess. It wasn’t until a few years later that the XML definition and code generation junk was removed and it became useable.

LINQ to SQL has been abandoned for a long time (since they introduced Entity Framework) but there are a ton of other ORM/DB access tools like Dapper, Massive, PetaPoco, linq2db, nHibernate, Insight.Database, OrmLite, LLBLGen Pro, etc.
> My experience is that LINQ pretty much beats every other way of interacting with a database I've ever seen.

Until you're going to do more complex queries over multiple tables.

If you want to interact with the database, in my experience Dapper and real actual SQL statements beat it hands down (both readability and performance). I love utilizing LINQ aside from that (e.g. creating custom comparison methods/classes and using it's baked in set operations for comparing/contrasting multiple collections).
There are many high-quality libraries that can do pretty much everything you need. Is there a specific example of something you're missing?

Also you're right that the standard framework libraries are very comprehensive, which in fact lessens the need for 3rd party dependencies in the first place. Stuff like LINQ and await/async is incredibly productive and unmatched elsewhere. Why rely on various outside libraries when you already have what you need?

When was the last time you checked out the open-source lib situation in .NET? I haven't had an issue with this in a long time (check out https://www.nuget.org).

On your second point, isn't that a good thing?

I would argue quite the opposite.

.NET has the most comprehensive set of high quality paid libraries i have worked with so far. Yes they can be expensive, but you get long term support and professional documentation. For a commercial product this is worth a lot.

.NET Core feels very much simplified and has a lot of really wonderful Front End templates, specifically JavaScriptServices for their React + Redux, Vue, and Angular starter projects. They feel very much like a Node and React + Redux project but with a C# backend and TypeScript. I've found it to be really enjoyable having a type checker, server side rendering, webpack, and a great deployment story. All out of the box.

You can see an example of something similar here: https://aspnet-core.azurewebsites.net/ and https://github.com/kriasoft/aspnet-starter-kit

.NET documentation used to be top quality, but not anymore. Quality of MSDN articles has declined a lot, going from full, explicit documentation with examples, to just placeholders in many cases.

PS: criticism of MS or .NET in HN even in reasonable terms is guaranteed -6 karma. But I have karma to spend.

You get downvoted to hell if you post something negative about MSFT after around 17:00 UTC. It’s open season between 09:00-17:00 UTC because they’re all in bed or commuting.

Incidentally I agree with you although MSDN has been difficult to find the content in for a few years as the auto generated stuff takes precedence.

I would have like 100 additional karma or more if it wasn't for MS related downvotes.

update: Downvoting started already.

This keeps annoying me whenever I go looking for .NET classes reference. The documentation at docs.microsoft.com is severely lacking compared to msdn.microsoft.com. It lacks the detailed samples and insights usually present in the "Remarks" section on MSDN. The information it does have I can usually discover using IntelliSense and by navigating to the assembly metadata.
* .NET Standard is a set of APIs that all .NET platforms have to implement. This unifies the .NET platforms and prevents future fragmentation.

* .NET Standard 2.0 is implemented by .NET Framework, .NET Core, and Xamarin. For .NET Core, this added many of the existing APIs that have been requested.

This seems to support the narrative that windows is really fickle in what is 'the thing we are definitely going to support from now on'.

How so exactly? If anything it's the opposite. The .NET Full Framework is not going anywhere, it'll be supported for a very long time from now.
I recall the criticism from yesterday's comments regarding the dropping of windows phone. There was a thread that harped pretty hard on the fragmentation of the Microsoft frameworks.

I personally have no experience with any of this, so am just going of second hand information.

I'm a junior dev and I have been meaning to master a framework really well. I really like the concept of .net core, I have decided to stick with it. But the documentation is scattered, it doesn't feel consistent.

I wish they made that documentation as pleasant and well put together as Django's documentation.

As a junior dev good docs are the biggest thing for me.

It's been a constantly moving target for the last two years. In theory, it should be getting more stable now with v2 of Core and hopefully all the docs and various tutorials/blogs/videos/etc will follow suit over the coming months. In the meantime, you'll probably want to filter out anything prior to 2017.
Why not master django then? If you don't want to put up with BS, then python ecosystem is the way to go.
We've hopped on the AspNetCore train a few weeks ago and its been a blast ever since. Just having working Swagger API documentation generation OOTB has been worth it for us.

It has the perfect storm of REST API & SPA web app hosting framework features in my mind:

- Annotation and convention based controllers. Binding of headers, body, and query params is so damn easy now.

- Annotation-based Swagger API documentation. It just works if you follow the directions. No need to define metadata classes or any other nonsense. Response types, content types, headers, required properties, etc - its all annotations and its all easy.

- Much better hosting of static content. We love how easy it is to build out a RiotJS SPA web app and backing RESTful JSON API service in one quick stack.

- Flexibility with HTTP hosting: HttpSys, IIS, Kestrel, Roll Your Own, etc.

- Pipeline and extension items are very easy to write now. We actually found it easier and faster to just hand-roll our token authentication pipeline item than to configure an existing provider.

- DI is some intersection of magical and simple. Microsoft's built-in DI provider kicks ass.

- Leverages open-source libraries where obviously appropriate by default. E.g. Newtonsoft.Json as it's the best JSON serializer ever written for .NET (or any language for that matter IMO).

- Can host on Windows directly through full 4.6.x framework for access to DirectoryServices and Drawing or host on top of dot net core for cross platform (sacrificing windows-specific capabilities).

- Windows service hosting features built-in (used to have to resort to TopShelf).

I had to hack in a few things that we liked from the Nancy project (e.g. automatic URLACL setup for HttpSys hosting), but these were very minor QOL items.

I think that every .NET/C# shop should take a VERY HARD look at this stack for any new development. Keep in mind that even though cross platform is marketed as a large part of this, you can reap 100% of the benefits on full 4.6 framework if you still need to operate in that domain.

Sounds like stuff we have had on the JVM (without MS lock in) since ages ago http://www.dropwizard.io/1.2.0/docs/getting-started.html And if you want terser code https://kotlinlang.org
It's a very nicely integrated stack though, and there's no MS lock-in anymore: it's all open-source, you can use VSCode or 3rd-party IDEs to code, and you can run it on Linux.
I develop in both. Used to like .Net better before Kotlin. Kotlin came in and converted me to Java.

But now, I'm a .net core junkie. The build tools, VS Code, C# itself. I just find it has the perfect mix of features for speedy development.

I don't dislike coding in java ever since kotlin, but even with IDEA I just prefer the .net core ecosystem overall.

I'm a long-time Java programmer, but I have to admit that .NET Core development is fun.

I like it best on RHEL, or better yet on OpenShift for instant Kubernetes goodness.

The Java guys better up their game, pronto. .NET Core 2.0 is capable, miles ahead of 1.0. If 3.0 jumps that much, it'll be a compelling platform.

The .net core platform is miles better than the old .net platform, so for everyone used to the old one, that's a major improvement. But it's still not good enough platform compared to many others and not interesting enough in others cases like compared to elixir.