| ▲ | jdw64 4 hours ago |
| C# is my strongest and favorite language. That said, it's frustrating that the C# framework ecosystem lacks solid options. MAUI is especially half-baked, and I'm really starting to doubt whether I should continue using XAML |
|
| ▲ | mynameisash 4 hours ago | parent | next [-] |
| C# used to be my favorite language, but having spent a lot of time in Rust using its algebraic data types + match statements + Option & Result types, then returning to C# to build a few moderately involved libraries, I'm horrified by the enums and null & error handling that I used to deal with all the time. I knew that enums were really just named integer values and nothing more, but I had forgotten than you can build a perfectly legal enum from an integer out of the bounds of the enum's range. And a switch statement is non-exhaustive. (As I said, it had been a while since I used C# extensively.) What would have been a few lines of code in Rust turned into dozens to try to exhaustively protect against invalid input. I know C# is a mature language that has been around for decades, but how janky everything feels comparatively really shocked me. I only very briefly played with F# about a decade ago, but my guess is that I could try to pick that up and call F# from C#, getting much better ergonomics with a combination of the two. |
| |
| ▲ | electroly 3 hours ago | parent | next [-] | | > I had forgotten than you can build a perfectly legal enum from an integer out of the bounds of the enum's range. And a switch statement is non-exhaustive These are solved by the new feature described in the article that we're commenting on right now. They're giving us unions and exhaustive switch. Ctrl+F "canonical way to work with unions" in the article to see an example. One of the best parts about C# is they never stop bringing useful features from other languages back home to us in C#. It makes for a large language with a lot of features, but if we really want something, we'll eventually get it in C#. | |
| ▲ | at_compile_time an hour ago | parent | prev | next [-] | | Learning Rust really ruined C# for me. The explicitness saves you from so much defensive programming. | |
| ▲ | jdw64 4 hours ago | parent | prev [-] | | [dead] |
|
|
| ▲ | bob1029 4 hours ago | parent | prev | next [-] |
| Winforms is better than ever. You can use it with .NET10 and WebView2 is a thing now. |
|
| ▲ | makotech221 4 hours ago | parent | prev [-] |
| Winforms, wpf, blazor, maui, avalonia, what are you talking about |
| |
| ▲ | Salgat 4 hours ago | parent | next [-] | | What I don't get is why Java doesn't get dogged for desktop UI like C# does. | | |
| ▲ | blanched 4 hours ago | parent [-] | | Because Microsoft pushes C#/dotnet as the preferred way to write UI on Windows. |
| |
| ▲ | jdw64 4 hours ago | parent | prev | next [-] | | Alright. I'm actually fine with WinForms and WPF since my factory floor codes depend on them. But the reality is they aren't expressive enough for modern UIs. XAML is an issue, and WPF is boilerplate hell. But then Blazor is too heavy, MAUI is broken and buggy, Avalonia is underwhelming, and WinUI 3 is an absolute nightmare. | | |
| ▲ | Rohansi an hour ago | parent | next [-] | | > But the reality is they aren't expressive enough for modern UIs Other than web tech, what actually is expressive enough? | |
| ▲ | sedatk 4 hours ago | parent | prev [-] | | > Avalonia is underwhelming How? Can you elaborate? | | |
| ▲ | vitally3643 3 hours ago | parent | next [-] | | Not OP, but I've found Avalonia to be pretty much a direct replacement for WinForms. I mean that both as a compliment and a deserved insult. It's not the WinForms we wanted, but it is the one we deserve. More seriously, it has all the strengths and weaknesses of WinForms and feels about exactly as unfinished and rough as WinForms. I still have to implement custom widgets that i would have expected to be included out of the box. It's nice that it's cross-platform, though with all the rough edges that cross-platform .net still has. It really, truly feels exactly like every C# UI framework I've ever used in the last 20 years: almost good, not quite finished, and takes an amount of effort that is just unreasonable compared to any other language/framework of any age. I've been a C# dev for most of my career. I have more fun writing UIs from scratch by drawing individual pixels in C++ than any C# UI. | | |
| ▲ | sedatk 3 hours ago | parent [-] | | I'm truly surprised that it feels that underdeveloped. They market Avalonia as a direct replacement for WPF too. So, I'd expect it at least match WPF to be fair. | | |
| ▲ | vitally3643 3 hours ago | parent [-] | | I would argue quite fervently that WinForms is more than a match for WPF. The only thing worse than WPF is UWP. We don't talk about UWP. |
|
| |
| ▲ | jdw64 4 hours ago | parent | prev [-] | | [dead] |
|
| |
| ▲ | ethin 17 minutes ago | parent | prev [-] | | Eto.forms too... |
|