Live data from Hacker News

.NET 5.0

devblogs.microsoft.com

441–450 of 466 posts

Re: .NET 5.0

#441

Earlier quoted context omitted.

* Structural types rather than nominal * Type unions and intersections * Type guards * `keyof` operator * String and number literal types See https://www.typescriptlang.org/docs/handbook/advanced-types.... for more. There are a lot of utility types in the standard library that could not be expressed in C# as well. Reflection is very different. It kind of still exists, but in a very different way.

It isn’t really more advanced as it is different. What typescript achieves with structural typing it loses in terms of good error messages and the encapsulation benefits of nominal typing. I’ve gotten used to typescript, but I still enjoy using C#. Some things I really miss in C# (limited operator overloading) that will never come to typescript (not because of the type system, but because of javascript source compati…

Some things like conditional types and string template literal types start to get way out into abstract type land that is certainly more advanced than C#'s type system. Typescript is inching closer and closer to the Haskell-ish land of turing complete type systems where the type system itself is nearly it's own meta-programming language with each version.

(A recent example was the "SQL engine" written using string template literal types to type safe "query" an in-memory database. That's quite more advanced than anything C# is capable of, albeit a strange hack and unlikely to be specifically something useful in production anytime soon, though still built out of things that make Typescript useful to some JS projects.)

Re: .NET 5.0

#442
post #377

Earlier quoted context omitted.

Go might care about their own API stability, but it took them years to stop doing direct syscalls on macOS (where it is not a stable ABI ); and last I checked, they were still doing that on BSDs. As for technical improvements, well... it's a language that took, what, almost a decade to add generics? And that's because the designers were claiming that everybody else is doing them wrong, and they want to figure out how…

You have to do direct syscalls if your lowest level is not C. I don’t see your point. Perhaps vendors should have stable ABIs?

Vendors do have stable ABIs: libc. You don't have to be writing in C to make calls into C libraries, and it would be rather strange for a language to be unable to use the C ABI, yet claim to be a systems programming language. You might notice that no other language has this problem.

Besides, Go does use libc on macOS (now), and always used Win32 API calls on Windows, so it clearly can be done. It's just that for a while, they've decided that being fast on macOS was more important than respecting the ABI stability guarantees from the OS.

Re: .NET 5.0

#443

Earlier quoted context omitted.

> Azure will win you over from AWS every time. Going to have to disagree here. That might be the case if Azure was not literally a tire-fire. I have been using Azure for work and it's the most frustrating, inconsistent, often-broken, confusing and stress-inducing cloud service that my teammates and I have ever been subjected to. It left such a bad taste that I am quite certain I would flat-out refuse to use it again…

Gee.. Sounds like you have had an awful time of it. Any chance you could speak more of some of the issues you encountered? We are looking at cloud providers and was kinda leaning towards Azure.

For what it is worth, I have been migrating from AWS to Azure for a few projects over the past year and have had nothing but good things to say about Azure. Documentation is superb, as is support and experience consistency.

AWS is still great, I just happen to like Azure more.

Re: .NET 5.0

#444

Earlier quoted context omitted.

Gee.. Sounds like you have had an awful time of it. Any chance you could speak more of some of the issues you encountered? We are looking at cloud providers and was kinda leaning towards Azure.

My advice, stay the f*ck away from Azure as far as you can. It’s the biggest clusterfuck I have ever had to deal with. Unless you are a Microsoft Gold Partner and you simply buy every shit which your Microsoft Account Manager tells you then you have no reason to use Azure. Unlike the Google Cloud or AWS, Azure has not a single service which is unique or good in any particular way. On the other side, they have many se…

Oh my god Azure functions. What a pain they were, nevermind getting them running locally.

AWS Lambda: run the code, because it’s easy to write code to be fully independent of lambda specifics.

Azure functions: oh no you need to run this thing to simulate stuff. Oh you’re not on Windows? Uhhhh too bad, that doesn’t work. You’ll have to use this other, random beta software. Oh it failed to run now, because you didn’t provide it with some arcane set of azure credentials which are inexplicably required to run it locally.

Storage-especially on Kubernetes is Alpha quality at best. The amount of pain we had was wild considering it is a fairly basic requirement.

Re: .NET 5.0

#445

Earlier quoted context omitted.

> Azure will win you over from AWS every time. Going to have to disagree here. That might be the case if Azure was not literally a tire-fire. I have been using Azure for work and it's the most frustrating, inconsistent, often-broken, confusing and stress-inducing cloud service that my teammates and I have ever been subjected to. It left such a bad taste that I am quite certain I would flat-out refuse to use it again…

Wow! Hot take. What Azure services were you using?

Front door, firewalls, LB’s, AKS, Azure Functions, Azure Disk (in AKS), scale sets and file-share storage accounts.

All of it was painful. There docs were lacking or sent you in circles. The documentation for their firewall product is three-quarters known issues and errors. Azure functions were painful to run locally, good forbid you’re not using Windows. Azure would take ages to attach a node on K8’s. Like, over an hour. It consistently had issues moving Azure disks between nodes in K8s: “can’t mount disk, attached to another host” in comparison AWS will speedily and happily re-attach an EBS disk to a new machine.

Permissions were opaque and distributed across the whole interface.

It silently deprecated keys underneath us, broke a number of services (couldn’t write to attached disks in K8s, couldn’t move them), didn’t inform us that this happened, we only figured it out by trawling through GitHub issues.

Storage Account explorer application breaks/stops consistently.

“Alert but permit” mode on firewalls doesn’t do what it’s supposed to: it will permit, but totally fails to alert you.

Scale sets operate weirdly, I didn’t personally deal with this too much, but my teammates had consistent issues with strange caching issues and more or less machines being spun up than should have.

Until we fixed it, every Azure PoP was health-checking our web app 2-3 times a minute: our logs and servers were being flooded with literally thousands of pointless requests.

If you have an AKS cluster with n machines currently in it, with a minimum and maximum of (n, m) machines, and you want to say, increase the minimum number, you cannot: it will refuse and tell you “the minimum number of nodes must include the current number”, so rather than just automatically adding a new node (a la AWS, and I presume GCP), you have to force the cluster to scale up to the new number of machines by throwing workload at it, then make the change.

AWS has a single Python package called “Boto3”, from which you can do pretty much everything. Microsoft in their infinite wisdom has a separate Python package for every service, and sometimes subset of service. Do you know whether you need the package for Storage Accounts, File Share, Share Accounts, Object Store or whatever else they had? Also, authenticating against these was a pain: sometimes you need a key provided by the service (let’s hope your permissions let you see that), sometimes you need to generate a service principal for your app (unless there is already one? In which case it’s listed in the UI, but nowhere you’ll find it, and certainly not under “service principals”, and you probably won’t have the permissions to see the information you need anyways) and then sometimes you need both!

Azure let us spin up a K8s cluster on a version of 1.18, but then didn’t let us scale the cluster a few weeks later, because apparently that version just didn’t exist, so we should either use 1.17, or update to a newer version of 1.18, but you can’t skip point-releases, so you’re going to have to update everything in your cluster before you can have another node.

Re: .NET 5.0

#446
post #344

Earlier quoted context omitted.

Making software harder to read, write, and maintain in the name of making unit tests easier to read, write, and maintain is putting the cart in front of the horse.

Indeed it would be but making unit tests easier to read, write, and maintain should force you to make the application easier to write and maintain. I agree that readability can suffer somewhat if you’re not careful though.

This is simply a dogma, if you want to follow that dogma, fine, but there's no reason to be forcing everyone else to.

Re: .NET 5.0

#447

Earlier quoted context omitted.

Why does something 5 layers down need all the config values?

Not necessarily all options, but just maybe settings for connection to some 3rd party server. You will need the configs.

Why wouldn't you implement a service for the 3rd party that itself requires the config, then? If a caller of the service needs to know how it's configured for some reason, you should probably be exposing it as a property of the service, not sharing the config directly.

Re: .NET 5.0

#448
post #418

Earlier quoted context omitted.

The age old TDD dilemma, that treats the test suite as first class, rather than the end user's experience.

The end user being the programmer? I find it humorous that so many programmers still can't see past the end of their nose when it comes to designing code for application testing. An application is deliverable. That means testable and deployable with a consistent, repeatable process. Anything short of that is not an application, it's a prototype. Yes, it takes longer to deliver up front, but it removes the long tail o…

What utter nonsense.

Re: .NET 5.0

#449
post #300

Earlier quoted context omitted.

if this can be used to make a type checker for SQL strings like https://github.com/MedFlyt/mfsqlchecker or https://github.com/codemix/ts-sql but for C# I will be stoked!

The closest thing is https://github.com/rspeele/Rezoom.SQL which once compiled in your F# project, can be used in C# by referencing the generated assembly. Although this is nothing to do with string interpolation, the "typed string interpolation" refer to the F# printf format specifiers. You could also build such tool separately using FSharp.Compiler.Service (possibly using the analyzer infrastructure for ionide: htt…

this is a nice looking project, I actually starred it in the past and had been meaning to check it out - thanks for reminding me!

Re: .NET 5.0

#450

Earlier quoted context omitted.

Stack traces were massively improved in 2.1. Using a good IDE (Rider or Visual Studio), debugging async/await code works as expected. Are you doing interop or calling unmanaged code?

Thanks, I will make sure to check this out. Does anyone have any articles or documentation on this?

Stacktrace improvements in .NET Core 2.1: Intelligible stack traces for async, iterators and Dictionary (key not found)

https://www.ageofascent.com/2018/01/26/stack-trace-for-excep...

Post reply on HN