Part of the problem is with web development, complicated as it is, the tutorials at least get you to a complete, working example. The windows tutorials seem to be very piecemeal where you start with a mostly complete app and fill in a couple things, but never get the whole picture.
And like in your first link, click on "Desktop". Ok, I want to make a desktop app. Now there are four options WPF, WinForms, UWP and Xamarin. Ok...Why are there four options? What are the differences? Are one or more of them about to be deprecated? What do I need to consider in order to choose one over the others?
I could go on. The windows developer website did point to some helpful C# tutorials and the language is actually pretty nice to work with, but figuring out how to do basic things like -- how do I store state in the application, has been very confusing.
All of them are.
Not officially, of course, but practically speaking all of them are dead-ends.
MAUI is the "new hotness", which means that it'll only become obvious that it is also a dead end in about a year and a half.
I wish I was joking.
If you're experienced with WPF you can build very complex applications quickly, but the learning curve is very steep. There's also a million gotchas when it comes to performance, and when things go wrong, they go wrong bad, and you end up spending many hours trying to figure out why you're getting a stack overflow exception :)
WinForms is a joy, though, and making custom GDI+ components is easy. I just wish they made WinForms 2, called it DotNetForms, made it cross-platform and high-DPI aware.
Maybe start with why people are still using a 19 year old UI framework.
Now only WPF applications that try to show more than a dozen controls at a time make the GPU fan spin up, a huge improvement. I suppose this explains the new "flat" style with huge amounts of white space. It's not about elegance, or style -- it's the only way to keep fan speeds tolerable.
CPUs are fast, and rendering could be multithreaded, but 4-16 very fast cores will still be slower than the very very wide SIMD of GPUs that can simultaneously operate on many many pixels. GPUs can also change to a different “lane” to compute while it waits on IO like some graphics. You also got gradients, transparency and the like, so you basically always have to do a full pass over every pixel, so on the order of 1000*1000 pixels. So GUI rendering definitely doesn’t use negligible CPU resources. It is the canonical example for a task that can be parallelized, so it only makes sense to do so.
In early 2000s I've used a PC with 800x600px CRT monitor and one of early Intel Celerons. My memory is fuzzy, but at best it was cheapest Coppermine Celeron (more likely Mendocino). Nowadays I use notebook with Intel Core i5 2540M (quite old) and the biggest display I use has 2560x1440 pixels (much newer than notebook).
Now I have at most (2560x1440)/(800x600) ~ 8 times more pixels. I didn't find numbers from the same benchmark for Coppermine and i5 2540M, but I expect 2540M to be at least 10 times faster than slowest Coppermine.
So I think modern CPU are fast enough to render GUI at least as fast as 15-20 years ago. GPU of course can do this much faster, cannot argue with this.
> You also got gradients, transparency and the like
I wonder if users really want this or we have it for other reasons (like developers want to show-off and companies want to sell new OS/App). For me the peak GUI was around Windows 2000 - most of what come next was not really an improvement for me. I'm not representative (and mostly use i3 WM, not Windows), but the fact that Widnows XP was used well beyond official support ended and many users around the world still use Windows 7 tells that many users don't really want to follow the latest GUI trends, but instead they are forced to.
And I’m not sure about the dates, but iGPUs have been around for quite some time now. Also, Windows 7 (I think the change happened at Vista) most definitely uses a compositor, so there is no CPU rendering at that level.
I miss the days of writing desktop software, it was nice :)
Wait, I thought that Blazor Desktop was the "new hotness" this week?
This is why people just stick with winforms.
What?! This wasn’t even on the list!
You're most likely best of picking WinForms. It's old school, but it seems like it's going to be the one Microsoft will have the hardest time killing.
WPF, UWP and Xamarin fine frameworks, but for the 0.9X developer who just want a window, with a few input and some buttons, you can't beat WinForms in ease of use.
My reasoning is that most of the developers who saw WPF and jumped on that, are the same who will more easily jump to UWP, and from there to what ever comes next. The WinForms developer aren't moving.
That sounds like talking it down, but I'm not actually.
Good for things like the sales guy wants something that pulls data out of a company database and sticks it in a excel file. And wants it tomorrow.
That's pretty fantastic. Stealing this!
My favorite platform is Lazarus/Free Pascal. The documentation is a bit sketchy, but the IDE and the applications it outputs seem solid. I'd prefer Delphi, but they priced themselves out of my world 20 years ago.
And they have a community edition...but if you make $5k or more as a consultant, -even if it's not using Delphi-, you can't use it.
I can’t speak for all of the challenges you might be dealing with, but this one in particular seems like something specific to native development. You have a wealth of options, and at the same time because of that fact there is are fewer defaults compared to web dev and you have to do more work to make the decision. Personally I default to two options unless performance requires otherwise: SQLite or JSON stored in files.
However you can just use Electron if you want to reuse web UI skills on desktop (although HN hates that). Likewise you can solve the state problem the same as a web backend. Use an external database, or a local database, write to a file, just keep it in memory, or use any of the OS-specific options. I recommend starting with EntityFramework (an ORM) and using the Sqlite provider: https://docs.microsoft.com/en-us/ef/core/get-started/overvie...
No it isn't. WinRT, UWP and WinUI are all later than WPF.
You will always be unhappy with any choice of UI framework, on any platform :)
Problem is, the past will remain with us in every book, code example or stackoverflow answer. As a beginner you need to understand the difference between .net framework and .net core because any blog post or tutorial will reference one or the other. Now people start calling it .net 5 or .net 6 instead of core, but you have to understand that this is incompatible with ".net framework" or ".net 4".
Or neither, if it was written before Core (in which case it's Framework).
Although F#-the-language is top-notch, the surrounding bits - editor experience, documentation, libraries, tooling - just don't get the investment they need to be on par with the sibling languages.
What I mean to say is, don't judge .NET just by your experience with F#. C# is the happy path.
Installing .NET 5 should be easy on macOS as they even provide an installer.
# Start fresh alpine
docker run -it alpine
# install tools and .NET 5.0
apk update && apk add wget bash vim icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib
wget https://download.visualstudio.microsoft.com/download/pr/21fdb75c-4eb5-476d-a8b8-1d096e4b7b14/c1f853410a58713cf5a56518ceeb87e8/dotnet-sdk-5.0.202-linux-musl-x64.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-5.0.202-linux-musl-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
# create f# project
mkdir my-fsharp-demo && cd my-fsharp-demo
dotnet new console -lang f#
# run project, it will show "Hello world from F#"
dotnet run
Or did you have issues with the IDE?Sure, there's a bunch of other languages that run on the CLR - but for the most part, the broadest, most well tested, path is doing stuff in C#.
Also like the others say, F# on dotnet is like Groovy for the JVM. It's nowhere near the popularity. Any reason you didn't try C# instead?
If you're just getting used to the platform, you're shooting yourself in the foot by going with niche setups. Try C# first to figure out your way around the platform and then branch out, not the other way around.
Nonsense all you have to do is install the dotnet sdk and run a single line in your terminal.
dotnet new console -lang "F#" -o "project"I think there was a Microsoft article that summed it up nicely: there are millions of C# developers (ergo the focus), tens of thousands if not low hundreds of thousands of VB.Net developers (ergo the life support) and maybe hundreds or low thousands of F# developers (ergo the fact that Microsoft offers some integration points but expects the already small community to develop and polish the actual implementation).
It took F# several years to fully get supported on .NET Core (type providers and such). I know, because I was watching the Github issue for it for at least 2 years).
Trying to use .NET on Linux with Visual Studio Code is pain: .NET developers expect you to learn APIs through intellisense and don't publish API docs, Windows tutorials assume you're running Visual Studio, and a lot of MS's own API docs are bewildering with .NET jargon that you won't understand.
.NET on Linux with Jetbrains Rider, is a far better experience than Windows and Visual Studio.
VSCode isn't worth looking at for .NET Development.
My point is not that experience is easy or hard, just that when comparing the two side by side, the experience of being a .NET developer on linux is good, and I would argue with jetbrains rider, is better than being on Windows with Visual Studio.
For me, even simple things like getting C# aliases working was a pain. I would not recommend a Linux developer to be picking up C# to do cross-platform development anytime soon. The only nice benefit I've seen is the amount of batteries included with .NET - but that's a solvable problem in other languages.
So just fired up a VM with a clean install of Ubuntu.
No VSCode, No Rider.
> wget https://packages.microsoft.com/config/ubuntu/20.10/packages-... -O packages-microsoft-prod.deb
> sudo dpkg -i packages-microsoft-prod.deb
> sudo apt update && sudo apt install apt-transport-https dotnet-sdk-5.0 -y
> mkdir test
> cd test
> dotnet new console --output sample1
> dotnet run --project sample1
This is all on the MS Docs website for getting started.
So I'm really not sure what part you find difficult. Getting hello world is no more difficult than me getting hello world working for golang, nodejs, python.
> For me, even simple things like getting C# aliases working was a pain.
Aliases for what?!?
EDIT: Simplified the commands cos I can't format in comments.
Aliases: https://docs.microsoft.com/en-us/dotnet/csharp/language-refe.... Support for those was only added in the last year or so to the dotnet/nuget/roslyn/whatever it is needed things to make it work. Microsoft's own documentation only documents how to use it for Visual Studio: too bad if you're using another IDE or the command line like you did above.
In terms of building a real world application. What are you struggling with? The code is no different regardless of IDE you use. VSCode, Visual Studio, and Rider all have a debugger and can step through code.
Right now it sounds like you’re just trying to make .net sound bad.
I suppose you mean using-aliases for types/namespaces? This is a C# language concept, not a very complicated one, and totally independent of the operating system
My advice after having tried it seriously - .NET does work crossplatform, I've seen it, but you need to be a Windows dev to tap into that. Would not recommend a mac/linux dev who's looking to do cross-platform work to pick .NET as the foundation.
I don't understand what you dislike about the API documentation Microsoft provides with .NET, it's not always perfect, but I would say it has nearly 100% coverage: https://docs.microsoft.com/en-us/dotnet/api/
And because .NET used to be Windows only there are a lot of Windows tutorials. But you can anyway skip them, as they mostly describe the old .NET 4.x. Find newer .NET Core tutorials. Even if they provide you screenshots of Visual Studio on Windows, you can do all of it with any text editor. Some scaffolding you maybe need to do on the command line.
And I haven't said anything about building GUIs here yet, which is another world of pain on .NET.
I work in a small shop and most of the developers use Visual Studio with Linux or a Mac. Most of the developers that don't bother with anything outside of Windows won't be open sourcing their libs or documenting their stuff anyways.
This may have been true back in 2016/7 when .NET Core first turned up but it just isn't true anymore.
> Trying to use .NET on Linux with Visual Studio Code is pain: .NET developers expect you to learn APIs through intellisense and don't publish API docs,
I've used VS Code for small projects fine on my Mac. However I can see it being a pain on larger projects and you will need a large IDE. However the same could be said for a large Java project.
> Windows tutorials assume you're running Visual Studio, and a lot of MS's own API docs are bewildering with .NET jargon that you won't understand.
I don't want to sound like a dick, but yes the Windows tutorials will expect you to use Visual Studio as that is the IDE that primary IDE of people using Windows.
As for complaints about jargon. As a C# developer that now transitioning to Python. The Python docs having lot of Python Jargon you won't understand (at first). Every language has its own jargon.
> Windows tutorials will expect you to use Visual Studio as that is the IDE that primary IDE of people using Windows.
Yep, hence the bubble. Python doesn't have this problem, for example.
Almost all the projects I use with .NET have sufficient docs on their sites. MSDN has the full docs on their site. If there are specific projects that are a problem that are outside of that. Well that is a problem with their project, go and complain to them.
> Yep, hence the bubble. Python doesn't have this problem, for example.
Yes Python does have similar problems. A lot of time people assume you are using a *nix machine and if you aren't then you normally have to faff with some work around. Go has the same problem a lot of things just don't work properly on Windows (at the least the last time I bothered). The same is true with Java, Go, Ruby etc.
As for the tutorials. I've just gone on the ASP.NET site and there is a tutorial for Windows, Linux and MacOS in the tabs on the site.
The expansive standard library, web/desktop/mobile/gaming output, Visual Studio (Code) IDEs, fantastic in-depth guides and documentation [1], dev evangelists like Scott Hanselman [2], and constant stream of content from MS team and community [3] makes it not only easy to get started but also continue until you're an expert.
I find it strange to complain about a 12 year old stackoverflow answer when other environments like nodejs are a nightmare once you get past the toy project stage. Anyone can write a simple tutorial for a to-do app, but it's how well you can grow that to a real complex system that determines how well-designed and productive an environment really is. And I've yet to find anything better.
1. https://dotnet.microsoft.com/ 2. https://www.hanselman.com/ 3. https://dotnet.microsoft.com/platform/community