Live data from Hacker News

Welcome to C# 10

devblogs.microsoft.com

11–20 of 59 posts

Re: Welcome to C# 10

#11

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…

I do not like that "global using" as well. I wonder why they added it.

It's an easy way to do a config without a full importer and complexity in passing config around / looking it up.

I like it. This goes way back. They give the example of a globalusings file.

That's a cheap / easy way to do a config file (at least one use case).

Re: Welcome to C# 10

#12
Dumb questions: why does it seem like languages always continually add features?

Can a language not become "feature complete", while still improving over time?

Re: Welcome to C# 10

#13

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.

Does that make Java the C of managed languages?

The great thing about C#/kotlin throwing the kitchen sink at stuff is the good stuff eventually makes it's way into Java.

Re: Welcome to C# 10

#14

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.

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.

Re: Welcome to C# 10

#15

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.

Does that make Java the C of managed languages? The great thing about C#/kotlin throwing the kitchen sink at stuff is the good stuff eventually makes it's way into Java.

(For me at least) life is too short to wait for the best features to trickle down. I mean, most of the interesting Java 17 stuff was surpassed by OCaml in 1995! That’s a 35 year lag!

Re: Welcome to C# 10

#16

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.

Does that make Java the C of managed languages? The great thing about C#/kotlin throwing the kitchen sink at stuff is the good stuff eventually makes it's way into Java.

I find Java's features to be very well balanced, and only make it into the language after they've been vetted and tested in the wild by other languages.

e.g. see their take on concurrency by means of project Loom. No need for async/await and providing separate APIs for sync vs async operations. It has records and sealed types and pattern matching, and is getting destructuring soon.

Re: Welcome to C# 10

#17

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…

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.

Re: Welcome to C# 10

#18

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…

I do not like that "global using" as well. I wonder why they added it.

Because most files in C# start with:

using System; using System.Collections.Generic;

and a few more lines like that. Think of this part of the BCL as the prelude in Haskell.

Re: Welcome to C# 10

#19

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…

I do not like that "global using" as well. I wonder why they added it.

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, and I'm tired of needing to add the basic SDK usings to every source file.

So the ideal is to enable .Net's implicit usings, then to use an analyzer to "ban" adding more global usings directly from your solution/project. Best of both worlds that way. Alternatively just make them a no-pass item for code reviews.

[0] https://docs.microsoft.com/en-us/dotnet/core/compatibility/s...

Re: Welcome to C# 10

#20
post #12

Dumb questions: why does it seem like languages always continually add features? Can a language not become "feature complete", while still improving over time?

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 code bases better? Will it make them worse? Do we even have a way to quantify better or worse?

What looks like is happening to me is that general purpose languages are all slowly migrating to look a lot like ML with some sort of existential mechanism. So that is static type system with generics, lambdas, algebraic data types, pattern matching. The existential part is typically expressed with interfaces, but it looks like there's a few options floating around.

Meanwhile, low level programming language designers are all going crazy trying to find a way to replace c / c++. Rust, Odin, Zig, Jai (if it ever actually gets released), etc. That probably won't look like ML or at least it will need to have some other stuff to handle the domain without driving developers crazy.

I'm sure other domains will slowly figure out that they can cheat the triumvirate of engineering (fast, cheap, good) by developing languages that suit their domain.

But I suspect we're looking at 50-100 years before we really start to see any progress that lets us have "feature complete" languages.

Post reply on HN