362 points · by pjmlp · 5y ago · 252 comments
But like everybody has said, the desktop UI story is garbage. Fingers crossed Maui turns out to be useful because winforms and UWP are hot garbage. Such a shame from the guys who revolutionised gui development with Visual Basic.
There is some "experimental" support for code based UI composition in MAUI, but since XAML is it's primary focus, XAML probably leads design decisions.
I don't even understand why you say "hung up on", XAML is probably the only compiles-to-code UI API I've ever used that actually does what it says it does; I've used similar tools for other UI toolkits (Glade comes to mind), and they're trainwrecks, and I'd rather just use the API straight.
UI development tools aren't for programmers, they're for UI designers: UI designers are generally are bad programmers but good designers, but need to program somehow as part of their job, and UI design tools allow them to be part of the team without having to feel like they're second-class citizens.
You know what happens when we don't have working UI toolsets? UI designers do insane stuff like slap together some HTML, CSS, and JS, and don't care that the usability of that from either the end-user perspective or the programming perspective is absolutely awful.
Would you rather use Electron or would you rather use XAML? At least with XAML, it works, and when it doesn't work, it can be made to work. Electron is eternally unfixable.
IMO, UI development tools are often not good for anybody. Designers are much more productive using specialized UI design applications like Sketch, Figma, Adobe XD etc. Who is responsible implementing the design depends on the company/workflow.
> XAML is just a tool to allow you to describe UI API calls using XML in a way that flows well for both humans and external tooling.
Not in my experience. XML feels very unnatural to me. XML being natural for humans was a hype from twenty years ago that was never particularly true in practice. XML feels less natural (to me) than using a normal programming language to make same API calls. XML based UI development tools are also often very unreliable and clumsy.
Maybe HTML?
I like it because it's relatively easy to make half-decent-looking UI's that have excellent functionality. If you need bigger guns, there's some powerful libraries you can use for more polished UI's or you can roll your own with a lot of effort and a long learning curve. For corporate in-house apps, it's hard to beat WPF/XAML.
The same is simply NOT true for anything web-based. I see it is getting better with CSS grid. At least layout is becoming sane-r than the days of tables, flex-box, and bootstrap-everything. But you still have house-of-cards javascript library dependencies on a boat-load of complexity. I realize that the folks who do web-apps day-in-day-out see it differently.
I also remember the winform days when people could make ridiculously elaborate high-function UI's with breath-taking speed. These would look ugly and dated by today's standards (especially on today's high-resolution monitors), but that development speed, the ability to just execute what you want quickly, is sadly missing today. WPF/XAML comes close but that winforms speed is just gone. Unless you want to do winforms-- which you CAN if you really want to, along with wearing double-knit polyester pants with bell-bottoms.
Issues with XAML:
- verbose
- static (not good fit for dynamic UIs)
- templating is unnecessarily complex
- contains code-like constructs (behaviors, convertors)
- being a separate language forces constant mental context switching when developing, which is bad for productivity. Tooling is more complex and breaks more often (like Intellisense issues)
The only good thing that XAML does is separates UI from the model, but you really don't need a separate language to do that.
What would you say are the benefits of XAML that warrant using another language for UI?
I think the XAML stuff relates more to trying to make things move between devices more easily by using generic ideas like stretching, grid layouts, flows etc. I guess MS are still holding onto the write-once use anywhere ideal which has never made it particularly well in any stack.
Have to agree with the desktop development chaos, look like not wanting to take an hard decision.
Forms and WPF continue, because they are the golden eggs, the ones that most .NET desktop devs actually care about.
WinUI looks like last attempt to rescue UWP, while at the same time in typical Microsoft fashion ignoring the tooling issues surrounding .NET Native and C++/WinRT.
MAUI, well they have to do something with Xamarin, and .NET still lacks an official cross platform so Xamarin be it. On macOS they are basing the backend on Catalyst, what I find completely insane, as most iOS devs know Catalyst apps don't feel at home in macOS.
JetPack Compose was created by React devs, and Swift UI still pales in capabilities to AppKit. Listen to this week rant on Apple's UI Frameworks at ATP podcast.
No it is not, how is that going to work on Mac? It is it's own thing, and on Windows it will use WinUI not UWP.
WinUI is UWP stack, that is what Reunion is all about, merging both worlds with WinUI on top.
Plenty of blog posts where to find such information.
Avalonia is also a very compelling secondary solution.
.NET 6 will have some convenient ways to do this in WinForms, WPF, and MAUI. But if you're willing to go off the beaten path a bit, it's not too hard to assemble the bits on your own (serve up Blazor on a background thread, consume it in your web view control of choice).
I think this is the only criticisms I can level at Microsoft, their branding is just a complete mess!
Core has been dropped from .NET naming but we still have ASP.NET Core MVC (I think?) and we still have EF Core.
"ASP.NET Core MVC" is such a mouthful.
Strange, I find WinForms very similar to Visual Basic 6.
The UI designers are very similar. The API is very similar. C# is just a much better language than VB 6.
I personally really like WinForms, but I haven't done anything in it in about a decade.
MAUI is similar to old Xamarin, it exposes whatever native controls are available on the platform.
Useless for me because I sometimes develop GUI for embedded platforms which don’t have any native controls at all.
Even ignoring the embedded use case, I believe that’s not the right approach overall. Native controls are too different across platforms. Commercial success of Electron demonstrates people don’t give a crap about native controls, they want good UX identical across the platforms, in large part because it saves development costs for cross-platform stuff.
My biggest issue with .NET has always been how slow it is compared to <insert any popular server side scripting language here>.
Is there hope?
lol
C# is blazing fast, but there's plenty of ways to write boneheaded-slow code.
Microsoft is marketing .NET 6 as the replacement for .NET Framework but you still cannot properly do desktop UI with it. I honestly don't understand why they are pushing more and more features when they cannot complete the ones they started years ago. Not to mention that porting WinForms from .NET Framework to .NET 6 requires a rewrite for anything more complex than a Hello World.
WinForms was fine / great / amazing. 90% of business / line apps could be handled with it. I have no idea how / why it's taken them so long and they STILL have not gotten their replacement story straight for it and they regressed the designer in .NET.
Did they just lose their minds there? Hire a bunch of idiots caught up in fads instead of folks who've been around for a bit.
It honestly is mind blowing. By now they could have had a cross platform WinForms story or something. The new WinForms designer is so annoying at times. "Oh, we support winforms" - no you don't.
And pretty much the stuff after it has been garbage.
Exactly, was a core strength. They saw the writing on the wall though, SaaS and cloud was where the money was and is at the moment, and that's where .NET now excels.
When Sinosfky and his team, brought .NET ideas to COM via WinRT, which was kind of Ext-VOS revival anyway, I bet they fired everyone on Forms and WPF, or moved to other teams.
Otherwise how to justify they had to ramp up Forms and WPF teams again, and we have already seen several PMs take ownership of the projects since Core started.
I don't see much difference between UIs of today and 20 years ago. Actually, I think UIs are nowadays less complex (more screen space available; and you have to worry less about CPU consumption). One would except that was enough time to figure out component design.
But also, all these moving parts are why a lot of developers chose to go with Web techs for their UI, for better or worse.
No, they just took the focus off the Windows UI.
They went cross-platform with .Net Core, which enables it to run in the cloud on Linux boxes. This was the focus.
I hope they come back around to a proper .Net WinForms designer under .Net Core, but for now the full framework can be run and will be supported. There are a massive number of WinForm applications in use. I was recently maintaining a massive 20-year-old .Net WinForms application, it still runs fine.
WPF I found to be constantly irritating and produces weird looking GUI apps, but maybe others have a better experience.
Has MS basically released anything sustainable on the UI side since MFC?
It feels like they’ve constantly provided a new new replacement every few years that replaced the new replacement from a few years ago since then.
My company has been using WinForms on .NET Framework for over 10 years now and it's working really, really well. Microsoft even added HiDPI support to it.
When Microsoft announced they wanted to bring WinForms to .NET Core 3, we were initially very happy as it meant we could switch to .NET Core. But then they did all kinds of shenanigans with it and completely rewrote the designer for .NET Core in Visual Studio, which is now riddled with bugs and crashes constantly. You cannot even load your own custom controls into it. I mean, you can, just get Microsoft to let you sign an NDA to get access to the APIs...
So that's a twenty-year old codebase, perhaps on both ends (Windows Forms Designer and Visual Studio alike) that now somehow has to be moved to different processes and different runtimes.
Perhaps you have more luck with JetBrains Rider, although from what I've seen they simply host the very same designer in pretty much the same way as Visual Studio and thus are unlikely to fare any better here.
The other option is the still-recommended workaround of keeping the .NET Framework project files around and do designer stuff with those. Also annoying, admittedly, but that's what I've been doing for now (well, for other reasons as well, as we sell a .NET UI component that still has to work in .NET Framework as well).
Despite WPF being preferred amongst developers, WinForms solves most use-cases well.
I’ve not really kept up with Microsoft UI developments but I’d be interested in seeing any cross-platform UI toolkits they develop now or in the future just as an alternative to gtk/qt
Take a look at what happened to silverlight or UWP.
You just happen to be working in the one tech they actually carried on supporting.
MFC is nothing more that a C++ GUI library wrapping the Windows Win32 GUI layer.
The problem with that Win32 GUI is it has not changed for several decades, which is why any application using that Windows GUI layer looks old and outdated on modern Windows.
Since Microsoft is not updating the Win32 GUI layer, it is basically obsolete.
However so many Windows applications still use that GUI layer and that then makes the Windows UI a complete mess.
Is WinForms really something that is outdated? Or is this new thing one just their attempt at unifying OS and Mobile UIs? I think Windows 10 uses this new framework and I absolutely dislike what I see, specially the entire new configuration system Windows has, compared to Windows 7.
However, there's also WPF. Which is also kinda in the same spot in terms of support and future development, but it's a lot more modern and flexible compared to WinForms.
As for MFC, the main reason why it's such a pain is because it's a relatively thin abstraction layer over Win32, and it doesn't even try to hide most of that underlying complexity (or limitations)
Borland C++ and Delphi/Turbo Pascal frameworks have always been top notch, and Qt follows their way.
MFC was re-created too low level, because the C guys at Redmond wouldn't use it, the Afx prefix comes from that first attempt.
I do like Forms and WPF a lot, so I fail to see what is broken about them, other than the missing love from doubling down on WinRT since Windows 8.
Ironically, MFC is the best framework for doing C++ GUI on Microsoft stack.
With C++/CX they could have had a C++ Builder like experience, instead politics made C++/WinRT replace it, while whoever is in charge doesn't care about Visual Studio tooling.
So using C++/WinRT is akin to being back in Visual C++ 6 alongside ATL, editing IDL files with a Notepad like experience.
It was wonderful and runs an all desktops (and I guess theoretically mobile through Gluon). None of that Electron lag. There is a bit of a learning curve - esp if like me you've never done any react
Very Clojure-y, quite low coupling and very composeable
I now treat UI stuff from Microsoft the same way I treat services from Google, something to be avoided because it will probably be abandoned within a short period.
It’s still very young v2 only came out a couple of months ago so it’s not entirely without issues at the moment but there are a LOT of apps that I think could easily use Flutter in production across all platforms today and that story is only getting better.
Or for all its faults on macOS, SwiftUI on the iPhone is pretty good.
And depending on your angle of view, depending on the kinds of UI you're attempting to make, you could argue that the UI story of HTML5 is able to not suck if you have the self-discipline to avoid the sucky things.
Outside of JavaScript, what other (good) multi platform UI frameworks are out there? And I’m hesitant to call JS good, with the amount of slow, laggy, resource intensive apps I’ve come across.
Not that I would not agree that the Windows UI space is a mess but it is rarely about the tech but the management of it.
Xamarin is also still a thing, MAUI will be a thing in the future, Uno is another option, Avalon too. There is a lot of options for .Net GUI, most of them are mature and maintained.
It feels like desktop teams are running into all possible solutions to see what sticks, instead of fixing what we had.
It's a complete mess and the whole thing feels direction-less but I cannot agree that no good tool exist to implement GUI.
I'm still confused by their React Native for Windows. Very happy to see development in this area, React Native is a fantastic framework, but I cannot understand if it is a toy or something they actually want to commit too. Blazor Desktop is also really confusing and makes no sense IMHO.
We sell a fairly complex custom control, both for Windows Forms and WPF. There were zero changes necessary for the migration to .NET Core 3 back then. We still build both .NET Framework and .NET Core assemblies from exactly the same source.
Depending on how many 3rd-party dependencies are used and what other weirdnesses one does in code there may well be projects that are impossible or really hard to convert. But overall my experience was that for a lot of applications there are few, if any, changes necessary.
I don't care if my UI ultimately gets rendered by a browser engine, but as things currently stand UIs that were relatively easy to build in WinForms/WPF/UWP are a bit of a pain with Blazor and friends.
(and yes, I'm aware of F# and SAFE but every time I try to get started with F# I run into too many tooling issues)
Then you now have Blazor trying to be everywhere, with Xamarin being redone as MAUI (you are expected to rewrite your Xamarin code).
So not so rosy for the time being.
I suspect it’s less “not a priority” and more “building a good cross-platform UI framework is a colossal amount of work”.
There are lots of complexities, but in short... .NET 5 gave it a 4% speed boost across the board, going up to 20% [!] in some cases. Mainly that was ascribable to the intersection of GC improvements and kinda-degenerate cases in the model.
For this particular codebase, very little in that article will be that significant [the VB.NET code uses a pretty limited set of stuff in the core libraries]. But their trajectory, and a million tiny improvements, really gives me a lot of optimism.
What I originally considered a pretty cynical stab at Oracle when they released .NET's source has really turned into a wonderful, performant, developer-friendly, and pleasantly-cross-platform ecosystem.
The language is ... ehhhhh. I don't love it, but I don't hate it either. There are things I like, but occasional items that are awful. Sometimes at the same time.
shrug I've been doing this too long to get worked up about language. Of the tools I own nowadays, VB.NET is somewhere in the middle of the pack.
This is how you know you're really working with something :)
A really great article by a friend of mine (and ex-VB.NET PM) is here. Really cool to go through it from time to time: https://anthonydgreen.net/2019/02/12/exhausting-list-of-diff...
Being able to work on a webapp that rapidly reloads in under a second is huge. It allows me to maintain the state of flow as I'm bringing something to life.
I had a unique use case wherein I had a separate worker thread that also needed reloading with the hotreload. I was able to hook into the hot reloading via "[assembly: System.Reflection.Metadata.MetadataUpdateHandler(typeof(MyHotreloadClass))]" and quickly solve my issue. I was pretty surprised to be able to modify that so easily.
The focus on performance and programming ergonomic makes me optimistic about the future of the platform. As someone who deploys to linux and is generally way outside of MS' ecosystem, this seems like a pretty big deal.
Does this work, for example, to reload method changes and so on? I miss this coming from JVM.
Method signature changes, class hierarchy, all of it.
He wasn’t a sun employee at the time and the sun folks kept telling him what he was doing was impossible. We ended up using his stuff, the dcevm, internally for a long time.
He was eventually hired by sun/oracle to work on other stuff and Java still doesn’t have proper hotswap.
That’s the tech world for you.
They say, that java on graal should have full hotswap. https://www.graalvm.org/reference-manual/java-on-truffle/hot...
"dotnet watch" and go. It watches your C# files for changes and reloads when it notices on save.
I use VSCode not visual studio which has some deeper integrations there I guess. But it's still fine.
It's only available in 6, though, as far as I know for real sub-second hot reloads. As it's a preview release right now, it's not as fun to set up but it's not too bad.
5 and below has reloading on code change that isn't quite instant (takes maybe a few seconds) but still works with the same command.
IIRC, that required a debug build that didn’t run very fast and was a bit fickle. Managed languages maki it a lot easier to implement this kind of features.
/gets housecoat, pipe and slippers :)
These days, you can run .NET entirely on Linux, without ever touching Windows or Visual Studio.
(Founder here) At Amezmo [0], we've supported .NET for sometime now, and recently added .NET 6 as an option for our managed app hosting platform.
Only the .NET Framework (for Windows) or Mono (for Mac and Linux) was required to run .NET apps. Since the early 2000s, development could be done with SharpDevelop (Windows) or its fork MonoDevelop (Mac/Linux) instead of Visual Studio as well.
csc.exe /out:HelloWorld.exe /target:exe Program.csHasn't Mono existed since 2004? Any Unity game has been running C# on many platforms by using Mono.
I'd recommend it to a Windows dev who wants to go crossplatform, but never to a crossplatform dev.
It's confusing if you have to deal with legacy applications running old versions of the frame I concur, but if you're on a greenfield project working with dotnet 5+ the experience is pretty good.
I work with vscode on nixos which is probably one of the most challenging Linux environments, and have experienced no blocks. I have had to install mono manually to work around some bugs and write a couple of patches as vscode can't write things where it wants to the read-only nature of nixos, but this is just part of the usual nixos experience.
TLDR: For me, if you're using linux and you wanna give dotnet a go, try it, you might also be pleasantly surprised.
I have always loved .NET and it keeps getting better and better.
They have shown remarkable flexibility to throw away ideas that don't work and have modernized.
A large part of that is due to active involvement of the community.
This could be a new model moving forwards, a software worlds equivalent of "the customer is always right".
Docs of course aren’t all up to date and are some times contradictory. Maybe it's better today but I've had plenty of 404s on official docs as well.
It’s way worse than React in this regard (if not only by its sheer size and larger scope)
The rapid changing allows them to do good stuff like you say, but it’s like the only way to write modern .NET properly is to have throughly read every release notes since about v4....
But now that MS is largely over that hump, I think they’ve been doing a really good job.
FWIW, I've used React for 18 months now. Except Java and classic core PHP it is one of the most stable platforms I've developed on.
So, in my view being less stable than React isn't a big problem.
I'm sure it's a completely different game these days.
Especially I recall that with lifecycle methods, previously idiomatic patterns would be deprecated with stern runtime warning within a year. Like this: https://reactjs.org/blog/2018/03/27/update-on-async-renderin...
Granted React team has been way more effective at communicating than the .NET team, again facilitated by a much smaller scope.
As for the ecosystem:
Anyone else remembers when react-saga was The One Way To Manage Effects? Or going through all the major versions of react-router?
All the stuff people expect to use around react, on the other hand. That sees huge amounts of churn.
I understand your pain but I think most of the recent changes are necessary for the long-term health of the ecosystem, and I would not expect the breakneck pace of the last 5 years to continue forever.
Can anyone who has successfully migrated WPF apps to .NET core, in production, chime in on what was the experience like? Any major pitfalls or pros/cons to consider?
I have a prospective client, running a WPF app in a soon to be deprecated windows embedded machine. They have a lot of domain knowledge in the app so are unwilling to re-write or port.
I was thinking if it is feasible at all to migrate this WPF app to .NET core and then migrating the target to a higher longevity Linux machine.
https://github.com/dotnet/wpf/issues/48
Thanks for clarifying.
Would you rather have an A language/runtime with a D open source ecosystem or a B for both?
They wrote a gRPC library [1],and a high performance JSON library [2]. Granted, these are .NET libraries, but still.
[1] https://github.com/grpc/grpc-dotnet [2] https://docs.microsoft.com/en-us/dotnet/standard/serializati...
Long-term they need people to make good contributions to the ecosystem and I imagine it would be hard for third parties to sustain interest if it was a known risk that MS would rewrite whatever they were contributing.
I think you're spot on about the ecosystem being as important (or even more important?) than the core technology, and I'd love to hear peoples' thoughts on how to encourage such an ecosystem.
.NET is so incredibly underrated...
My sense is that things are improving though.
IdentityServer4 is still open-source and available. There's a new version by Duende with commercial licensing, or various alternatives like OpenIddict [1]. OAuth/OIDC is a well-supported standard so you can also use servers in other languages like Ory [2].
Microsoft's team did consider making their own token server but there was considerable pushback from the community because it would have a negative effect on open-source, and wouldn't add anything new compared to existing projects while taking resources from other framework features.
1. https://github.com/openiddict/openiddict-core 2. https://www.ory.sh/open-source
My impression from reading the code and GitHub issues is that they're not maintained by real ".NET people" who are plugged in to all the fine details and best practices of the framework and the runtime.
StackExchange.Redis is a good example of one that is independent of MS but still very high quality.
I agree with your impression that developers of the other library don't seem to be "plugged in to" the .NET ecosystem. As an independent developer (not affiliated with Oracle or Microsoft), I've been able to influence GitHub PRs that shape the ADO.NET API for .NET 6.0, just by showing up and contributing; I haven't seen anyone from the Oracle MySQL team participating. Meanwhile, they violate basic principles of the .NET Framework Design Guidelines that have been around for over a decade (https://docs.microsoft.com/en-us/dotnet/standard/design-guid...), which makes their library feel alien to a .NET programmer (regardless of the quality issues it might have).
I don't know of many ecosystems where backwards compatibility is this good while also providing tons of upside on the future path.
We are definitely getting more out of the Microsoft stack today than we thought we would 8 years ago when we started this journey.
If you told me our product would magically become cross platform capable while we were still sitting on 3.5 I would have laughed you out of the room. Granted, the conversion to .net core wasn't entirely painless, but it wasn't bad either.
There might also be significant performance improvements to gain by chnging to Linux, especially on startup time (this is true for Java and Node as well and in my limited tests it was absolutely true for dot net core a couple of years ago.)
OTOH things get dicier the further you get away from the core .NET libraries, and some of the enabling technologies are so new that they haven’t seen much adoption yet (example: the venerable COM interop system vs the new ComWrappers).
If you’d like to keep up to date on NativeAOT, Andrey Kurdyumov is doing some top-notch work in the area: https://codevision.medium.com/
namespace Honlsoft;
and that's it.
The performance improvements on each release are trully impressive, but I think at this point the focus should go towards a better development experience.
Developing on VS Code is such a hurdle thanks to the Omnisharp language server that constantly crashes, and the project does not seems to be among MS top priorities for .NET platform.
Restarting the IDE every few minutes is very frustrating and hardly justifiable from a productivity point of view.
It would definitely be nice if more resources were put towards making Omnisharp smarter and more stable, especially as it seems to be the premier implementation of an LSP server.
-no sum types, Java 17, kotlin, scala, f#, typescript, rust, Swift, nim, ocaml etc all can modeling types better than C# - no option, no result, exceptions are invisible for caller (ex. Tracking effects in nim)
-NRT doesn't resolve all problems, "required" is better, but I don't know if c# 10 will get it
- no let/val like kotlin, scala, rust. only readonly
- no expression based like kotlin/scala (or required initialization like in rust)
- no exhausting pattern matching
- most community are consumers of Microsoft libraries. Want small rest API framework? use asp.net core, want full stack? Use asp.net core. No other framework, even for rails is Sinatra.
- i would like to see better documentation frameworks with top level comments, doc tests, runnable examples like in rust, nim, d, and unit framework like in d or rust.
- no free functions, top level for only one file in project is too restrictive.
- no easy repl based work ( or community accepted)
From my newbie perspective c# is still good for few things, enormous resources for everything, only java from 'application' languages have more, generics, records, value types etc
It hasn't been updated in 10 years and IIRC, Microsoft even hired the creator of IronRuby.
Is anyone running a Ruby on Rails app on .NET Core? If so, are you using IronRuby or something else? The folks at https://www.discourse.org know .NET super well from there StackExchange days - is Discourse a vanilla RoR app are they using the .NET runtime?
[1] https://devblogs.microsoft.com/dotnet/azure-active-directory... [2] https://devblogs.microsoft.com/dotnet/bing-com-runs-on-net-c... [3] https://devblogs.microsoft.com/dotnet/migration-of-bings-wor...
Yes, Java is more verbose to write, but it's easier to read. E.g., == in Java is always built-in equality. In C# it can be overloaded. Equality in C# is a mess (IEquatable, IEqualityComparer, the obscure way in which generic collections "discover" equality on the type...)
Then async/await hack and how it interoperates with Task infrastructure. It's so badly documented it's not even funny. An often-asked question is how to synchronously wait on an async method. The usual answer is "don't do it" like it solves anything. But async methods return a Task and the official examples for tasks tell you explicitly to use Wait() method to wait on a task. Which gives?? (A long story about synchronization context.) Java and Project Loom are doing it right, IMO.
Nullable reference types are another hack. I tried to convert a project to NRTs and gave up, reverted everything. I haven't seen a NRE in years :p NRTs introduce a lot of edge cases, with a lot of syntactic noise to cover them and still guarantees nothing (unlike a proper Optional type would).
Java takes longer time to push out features, but my impression is that when they do, the features are better thought out than their counter-parts in C#.
So right now the only thing I'm unhappy with in Java is streams not supporting checked exceptions. I actually _like_ them and Oracle should have invested in making them more usable in some way. What they did with streams kind of signals that they want to deprecate them in the long run. It's a missed innovation opportunity.
Days of work to try and get projects to BUILD. Do I have to use Gradle, Maven, or something else? Which IDE to use? The IDE isn't working with whatever version of Gradle or Maven I'm using. Dependency hell. Restarting my IDE repeatedly, re-downloading dependencies, trawling through the horrible Maven site trying to work out what version of a certain dependency I need. Keeping massive amounts of notes because I'm sure in two weeks I'm going to forget which arcane command I need to keep my Java build environment working.
The horrible verbosity of Java making it way harder to read then C#. Realising that there's no standard equivalent of tasks and async and I have to work out which of the 10 3rd party implementations is the "good one" and then realising that the recommended one is again verbose, ugly, and more complex to write and understand than Tasks and Async in .Net.
Having to work out which Java runtime environment I need. Having to register on the Oracle website to download their runtime, then finding out that maybe an open source runtime is better, then finding out nothing is supported for ARM macs. Then realising that this runtime means my IDE ends up breaking. Multiply all these problems if you decide to write Scala instead.
The Java and JRE environment in general is a huge mess in comparison to Microsoft's .Net platform. .Net "just works." There is no confusion of how to build, what IDE to use, what package manager, everything works together seamlessly. I can get a new engineer setup to write and deploy .Net in minutes. Our company literally has to have three engineers gather around someone's computer for half a day to get a Java or Scala environment working correctly and often it ends up working seemingly by magic, i.e. we can't deterministically understand why it ended up working.
Java was actually my first programming language in college but Oracle has radically mismanaged it. I would not recommend it unless you really need some specific library that only exists in the Java ecosystem.
Most of this just sounds like complaints from someone who doesn't know the ecosystem and doesn't want to learn it. Someone who thinks your choice of IDE matters for a project, when in fact it doesn't.
> Keeping massive amounts of notes because I'm sure in two weeks I'm going to forget which arcane command I need to keep my Java build environment working.
gradle build
mvn package
> Having to work out which Java runtime environment I needDo you not have to figure out which version of .net core, .net framework, .net whatever for each project?
> Having to register on the Oracle website to download their runtime,
brew install openjdk@<YOUR_VERSION>
> I can get a new engineer setup to write and deploy .Net in minutesHere's what I do, and it takes 3 minutes:
my_package_manager install openjdk_version_i_need
my_package_manager install maven
my_package_manager install vscode
code --install-extension vscjava.vscode-java-pack
code /path/to/the/project
> recommended one is again verbose, ugly, and more complex to write and understand than Tasks and Async in .Net.This is probably your only valid criticism until Loom is launched.
> Realising that there's no standard equivalent of tasks and async
There is: Executor and CompletableFuture.
This is mostly the fault of the TPL documentation being written eons ago. I'd recommend David Fowler's async guidance for a modern take: https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/b...
`.GetAwaiter().GetResult()` is generally considered the best way to do it if you must do sync over async, but in modern code it should almost never be required.
> I tried to convert a project to NRTs and gave up, reverted everything. I haven't seen a NRE in years :p NRTs introduce a lot of edge cases, with a lot of syntactic noise to cover them and still guarantees nothing (unlike a proper Optional type would).
I've been working on updating a number of libraries to support NRTs with success. I find it's a good for developer ergonomics so you know what can return/be null and what cannot without needing it laid out within xml comments or documentation. ASP.NET Core 5+ will also automatically validate request payloads depending on a type being nullable or not. NRTs will be enabled in project templates by default with .NET 6.
Yeah, you should add to that `ConfigureAwait(false)`.
That you need a long webpage about `async` and that the official documentation on Task doesn't apply kind of drives the point home. They've botched the design of async. Yes, it works "well enough" in 95% of cases, but the remaining 5% is a mine-field.
I know it only confirms your point, but Rider highlights the overloaded operators so you spot them right away.
After working with dotnet for pretty long time and coming to Java world (mostly Spring with Kotlin), I was extremely disappointed to find there's no real alternative to LINQ. What's your solution to this common problem: you have a table (HTML table) with 30 different filters, you need to apply all of them if they're set. Some filters require simple field comparisons, and some filters add very complex conditions.
With LINQ and EF, it's very easy to do, and the result is clean and easy to read. I don't think there's any alternative in Java that does not require adding yet another library and re-implementing data access layer, or writing a lot of boilerplate.
I know of LINQ, but what's EF?
Do they? They kept evolving the Stream API after Java 8 well into Java 16 (Stream::multiMap, Stream::toList, etc.), it doesn't really seem to me like this is true.
- .NET website (https://dot.net) - High level info on different workloads, 5 minute in-browser tutorials, links to live shows and community
- MS Learn (https://aka.ms/mslearn-dotnet) - Interactive tutorials with learning paths built from 30ish minute learning tutorials
- Docs (https://aka.ms/msdocs-dotnet) - More in-depth documentation on specific tasks and features, e.g. API documentation, performance optimization, security guidance, etc.
While you can go directly to any of them, the dot.net site will link you to Learn modules that will link you to docs, so hopefully you can start on the dot.net site and it will help you find the right place.
One thing I really like (and I'm totally biased because I've helped set it up) is https://live.dot.net. Those are all our live shows with the PM and dev teams. We've got a show every day of the week, and there's always really good Q&A in the chat.
I guess this is as good of a chance as I'm gonna get - the docs experience in non-anglosphere countries is dreadful, the website keeps pushing a localized version with absolutely garbled machine translations which are never going to be even passable for technical documentation. It's just a completely miserable experience without the "FFS MSDN" browser extension.[1][2]
At least that was the situation a year or so ago - all my computers are now 100% English locale so I have no quick way to check.
Just let us use the website in English.
[1]: https://addons.mozilla.org/en-US/firefox/addon/ffs-msdn-in-e...
[2]: https://chrome.google.com/webstore/detail/ffs-msdn-in-englis...
Indeed ridiculously annoying though. For some reason, Google also started to show the titles of English-language YouTube videos in machine translated German for me, usually completely garbling the meaning - and the video is in English anyway! It's not like I could watch it if I didn't already understand the original title!
Who would have thought that managers in primarily monolingual cultures (i.e. the US) don't understand the actual needs of an international, polyglot audience? The techbro-ism behind these decisions is palatable. "That's a technological solution to what I, without actually asking any of the people affected, imagine to be a problem, so it must be good, right? I mean, it has ML?"
If you like functional languages or would like to try it, give it a whirl!
https://dotnet.microsoft.com/learn/languages/fsharp-hello-wo...
If you use vscode, highly suggest to use Ionide extension. You’ll be quickly amazed at how smooth it all works.
Then later learn F# because it's absolutely kick ass :)
Joe Albahari has had to work with just about every feature in C# (he's the author of LINQPad) and it really shows in the book.
This YouTube channel is pretty good.
Or you could make some kind of REST API with ASP.NET Core or gRPC.