Earlier quoted context omitted.
I'm a big fan of C#, but to be fair nothing else you've named is really aiming for the same niche. The better comparison would be Swift, Go, Java/Kotlin, stuff like that. But yeah I think C# is often unfairly viewed as a boring enterprise-y language when it's actually become a very comfy swiss army knife.
If it wasn't so linux distribution unfriendly…
Official proposal for Type Unions in C#
141–150 of 315 posts
Re: Official proposal for Type Unions in C#
#142Every time the question of preferred programming languages comes up, I'm usually in the extreme minority with my preferences being Rust (for small/fast) and C# (for productive and easy, where GC is acceptable), a combination that doesn't seem to appeal to too many people. But for the projects that fall right about in the middle where it could go either way and I could see either language working, I almost always pick…
I've been writing C, C++, C# and some js/sql/ts/python for money. Lua for lulz. And *nothing* gets even fucking close in terms of productivity to C#. Great language, mature and robust ecosystem with sane compilation times and great tooling: package manager, test runner, strong debugger, one CLI with almost all tools needed. I wish C++ was half as enjoyable as C# is.
Re: Official proposal for Type Unions in C#
#143If this feature were implemented, it would take C# to a top contender for a daily driver language for me, and would make me feel a lot more confident in choosing it for projects where the C# ecosystem is already present, such Godot's C# version.
I'm really excited about this proposal, and I don't know anything about C#'s development pace, but I'll be watching from the sidelines hoping I can use union types in production in 2025 or so.
Re: Official proposal for Type Unions in C#
#144Earlier quoted context omitted.
> but its in the hands of microsoft and microsoft didn't really care much about building a community or getting it to work natively in other OSes/toolchains. That statement was true - until 2016. Times change, Microsoft changed.
Yeah, really. I'm distributing a .NET 8 app across Windows, macOS, Linux and x64/arm.
Re: Official proposal for Type Unions in C#
#145Earlier quoted context omitted.
I'm a big fan of C#, but to be fair nothing else you've named is really aiming for the same niche. The better comparison would be Swift, Go, Java/Kotlin, stuff like that. But yeah I think C# is often unfairly viewed as a boring enterprise-y language when it's actually become a very comfy swiss army knife.
If it wasn't so linux distribution unfriendly…
Re: Official proposal for Type Unions in C#
#146Earlier quoted context omitted.
The language itself is nice, the code bases that companies produce with it is not, and sadly that reputation plays into your decision to choose a career stack. You're going to have patterns from the .NET Framework era being ported to .NET Core projects. It works, but you'll have two paradigms of doing things mixed into your project. I envy people who only do hobbyist C# so get to work on code bases that have all the…
Out of interest, what "patterns from the .NET framework era" do you think don't work well in .Net core? ( I'm someone who deals all day with legacy .Net framework projects, mixed with the kind of mix of .Net core 3, .Net 6, .net standard 2.0, and .Net 8 projects that you'd expect from a 20+ year old company with 260+ projects. And yes, I too envy hobbyists at time. )
Overriding equals to do memberwise comparisons on POCOs
Any checking of types where pattern matching would be better
Old-style tuples without names (old style is tuple.Item1, tuple.Item2, etc.)
Checking of multiple tuple values at once without pattern matching
Any code that could be refactored with the new LINQ methods
Long ifs/switches that could be replaced by pattern matching
Concatenate a lot of strings (one per line) so there wasn't a ton of horizontal scroll, particularly for SQL in C# code
using statements still needing a level of nesting
Re: Official proposal for Type Unions in C#
#147Earlier quoted context omitted.
I've been writing C, C++, C# and some js/sql/ts/python for money. Lua for lulz. And *nothing* gets even fucking close in terms of productivity to C#. Great language, mature and robust ecosystem with sane compilation times and great tooling: package manager, test runner, strong debugger, one CLI with almost all tools needed. I wish C++ was half as enjoyable as C# is.
> And nothing gets even fucking close in terms of productivity to C#. C# gets compared to java a lot for a good reason, and yet the languages and ecosystems have since diverged in their priorities and abilities. This gets even more complicated when considering F# and Scala. Do you think Java would offer similar productivity, or are there aspects to the C# that are—in your personal experience—uniquely productive?
Re: Official proposal for Type Unions in C#
#148Earlier quoted context omitted.
I'm a big fan of C#, but to be fair nothing else you've named is really aiming for the same niche. The better comparison would be Swift, Go, Java/Kotlin, stuff like that. But yeah I think C# is often unfairly viewed as a boring enterprise-y language when it's actually become a very comfy swiss army knife.
If it wasn't so linux distribution unfriendly…
Re: Official proposal for Type Unions in C#
#149Every time the question of preferred programming languages comes up, I'm usually in the extreme minority with my preferences being Rust (for small/fast) and C# (for productive and easy, where GC is acceptable), a combination that doesn't seem to appeal to too many people. But for the projects that fall right about in the middle where it could go either way and I could see either language working, I almost always pick…
You must really hate REPLs. You cling to your ADTs, I cling to my REPLs.
Re: Official proposal for Type Unions in C#
#150Every time the question of preferred programming languages comes up, I'm usually in the extreme minority with my preferences being Rust (for small/fast) and C# (for productive and easy, where GC is acceptable), a combination that doesn't seem to appeal to too many people. But for the projects that fall right about in the middle where it could go either way and I could see either language working, I almost always pick…
What I’d love to see is a hybrid between C# and Rust that has the capabilities of both languages in “layers”.
So business logic would be written in a simple GC variant of the language that feels like C# but the underlying standard library and low-level packages could use Rust-like semantics.
This is already the direction that C# is moving in: it’s getting more and more features related to “ref” and other low-level primitives.
Sadly Rust and C# have fundamental incompatibilities such as different string encodings, so they can’t be directly merged.