Live data from Hacker News

Welcome to C# 10

devblogs.microsoft.com

51–59 of 59 posts

Re: Welcome to C# 10

#51

Earlier quoted context omitted.

I agree in a sense but I would do it another way. Either change to the Rust edition equivalent, or simply drop old stuff and keep in the newer bits.

There is a Rust edition equivalent in C#…kindof. The csproj file has a property to specify which version of the language you want to use. So if you set it to 9, the compiler won’t allow features from 10 (supposedly; I haven’t tested it).

I'm aware of on the csproj but it's opt in system. You opt into the features of the version you want. It never disables anything of the prior versions.

Re: Welcome to C# 10

#52
post #50
post #49

Earlier quoted context omitted.

I don't think F# did that by choice. The reference compiler implementation is simply too complicated, which makes it hard to add new features. It is, ironically, also written in F#.

From what I have seen, Don Syme is a very pragmatic language designer and doesn't want to include features just to add them, and he holds .NET interoperability extremely high on the priority list, which further limits adding more functional programming features. I imagine the compiler implementation is complicated, and I would guess it is due to the .NET interoperability.

You can just check out Roslyn code and compare it with FSC code. Trust me, compiler code quality/complexity is the main cause.

Re: Welcome to C# 10

#53

Oh wow. I do not like that "global using". It harkens to the auto-loading issues I've had with Rails. "Where was this defined? I dunno! It probably works here, though!!1" I generally don't like a random file impacting several other files. Extension methods are ... tolerated and ... "fine" but I still feel unpleasant using them. File-Scoped namespaces seem like someone's really, really tired of having nested folders a…

[deleted]

Re: Welcome to C# 10

#54

Earlier quoted context omitted.

Looks like they added global usings to support their implicit usings functionality. Essentially they want to save people having to put using System, System.Linq, System.Collections.Generic, and others[0] at the top of nearly every C# file. I'm of two minds: - I think they're an anti-pattern, because it creates a global scope that can get messy/annoying. - It makes a ton of sense for the implicit usings functionality,…

It's literally the same as Rust's prelude system and I don't see anyone complaining so much about this.

Rust doesn't have anywhere near the following of C#, so there probably aren't enough opinionated people in the community to mention it on an HN post

Re: Welcome to C# 10

#55

C# is becoming the C++ of managed languages. I wish they would stick to a smaller set of more powerful features… like an earlier C# with hygienic macros or something.

This release in particular feels like they are scratching around to find new features to add.

Re: Welcome to C# 10

#56

Earlier quoted context omitted.

There is a Rust edition equivalent in C#…kindof. The csproj file has a property to specify which version of the language you want to use. So if you set it to 9, the compiler won’t allow features from 10 (supposedly; I haven’t tested it).

I'm aware of on the csproj but it's opt in system. You opt into the features of the version you want. It never disables anything of the prior versions.

What do you mean “disabling” things from the prior versions?

Re: Welcome to C# 10

#57
post #26
post #20

Earlier quoted context omitted.

We don't know how to make languages. We're in the Kepler stage of software development. Everyone has a different 'cosmology' to explain what's going on, we don't yet have the technology to understand what's going on, we don't have the math yet to explain what's going on, and we're just in the very beginning stages of even being able to take measurements of anything worth while. "Here's a feature" Now, will it makes c…

I wonder if there is any parallels of programming languages to spoken languages. Every year, new words are constantly added to official dictionaries ... while old words continually fall out of favor/use. And concepts in one language (e.g. "English" or "Rust") then get adopted/imported into another language (e.g. "French" or "Go").

Spoken languages are constantly evolving and mostly evolve at the keyword / reserved level and sometimes when interacting with neighboring languages through necessity you’ll get pidgins and creoles (think of them as external DSLs). But because spoken languages are so fluid there is a massive amount of ambiguity over time. It’s not like we can read Middle English very well now (we need scholars oftentimes) and another problem with human languages is the entity knowledge problem with idioms oftentimes being computationally “AI complete” (requiring general AI to comprehend semantically).

In this respect x86 is the English of the computing world moreso than even C, Java, etc because these are different cultures. And as someone that was in ESL I can’t express how much waste and cruft is in the language that makes me think it’s Perl or Ruby (note that Larry Wall is a linguist and wrote Perl to be more like a human language - we can see now why it was not a great idea).

Also seriously, human languages are entirely defined by its user base (language pedantic folks have very little influence empirically such as the flawed academic rule of not ending English sentences with a preposition which was a bad port of a rule from Latin) and given the trends of each programming language community I’m doubtful giving language control to users is what helps keep a language ecosystem alive and thriving. In fact, human languages are essentially a secondary map of imperialism, genocide, and suffering across all of human history moreso than trade and integration with consent.

Re: Welcome to C# 10

#58

Earlier quoted context omitted.

Doesn't really bother me, so long as the global usings are only kept to a single file. Intellisense will tell you the full namespace, then you can just see if you've got that namespace in the file you're in or in your dedicated global usings file.

> so long as the global usings are only kept to a single file Here's where the mess starts. It seems far too easy to sneak a global import statement in to random files and then have the entire codebase polluted by it. I feel like this is too foot-gun'y, myself.

Yeah, there should definitely be a way to have the compiler enforce global usings in only a specific file.

Re: Welcome to C# 10

#59

The most interesting feature here (though included only as a preview) is static abstract members on interfaces, which will make things like generic math possible.

This is a great ability actually.

That said, I think I'd prefer the addition of structural inheritance to the existing nominal inheritance. Also, algebraic types.

Post reply on HN