News for hackers. Stuff that matters.
Re:.NET for Beginners (2020) by andi999 on Wednesday April 21, 2021 @02:14AM (#26885971)
At least until last year, I think the community used mostly winforms if it is for Windows operating system. MS is not too happy about that.
Re:.NET for Beginners (2020) by cosmodisk on Wednesday April 21, 2021 @07:24AM (#26888116)
Winforms is easy to use and understand, everything is pretty much there and I can get started with no issues. WPF,on the other hand,is a clusterfuck, not even sure who managed to come up with it.
Re:.NET for Beginners (2020) by valdiorn on Wednesday April 21, 2021 @12:22PM (#26891723)
There are a lot of great ideas in WPF, but sadly the implementation of those ideas is really, really clunky.

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.

Re:.NET for Beginners (2020) by ethbr0 on Wednesday April 21, 2021 @03:24PM (#26894265)
Seriously. Microsoft is one of the few companies with enough historical successes that teams can have "not invented here"isms about first party products.

Maybe start with why people are still using a 19 year old UI framework.

Re:.NET for Beginners (2020) by Traubenfuchs on Wednesday April 21, 2021 @06:49AM (#26887798)
Because winforms is an incredibly easy and solid technology. It's a joy to work with.
Re:.NET for Beginners (2020) by kaba0 on Wednesday April 21, 2021 @07:03AM (#26887901)
CPU rendering should not be a thing in 2021
Re:.NET for Beginners (2020) by jiggawatts on Wednesday April 21, 2021 @07:16AM (#26888035)
When WPF was first released, toy applications would make both my CPU and GPU fan spin up to gas turbine levels.

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.

Re:.NET for Beginners (2020) by citrin_ru on Thursday April 22, 2021 @07:12AM (#26901392)
CPU GUI rendering was reasonably fast for Win32 apps on Pentium III. Modern CPU many times faster and I expect GUI rendering to use negligible fraction of CPU resources. Why this is not the case? Display resolution nowadays is higher, but the difference in pixel numbers is smaller than difference in CPU performance.
Re:.NET for Beginners (2020) by kaba0 on Thursday April 22, 2021 @07:41AM (#26901596)
Older graphics were much more simpler, like draw a line here and here, where you have to iterate through like 400px per line of a window border. Also, smaller resolution.

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.

Re:.NET for Beginners (2020) by citrin_ru on Thursday April 22, 2021 @10:37AM (#26903239)
> smaller resolution

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.

Re:.NET for Beginners (2020) by kaba0 on Thursday April 22, 2021 @11:12AM (#26903649)
Well, drawing GUIs one pixel (okay with SIMD 4-8) at a time on a CPU core is still way too big of an overkill, especially that for display it usually gets through a GPU, so it gets written to memory and then copied over vs being generated into video memory itself. A CPU core is way too expensive for these “easy” calculation, like paint it black.

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.

Re:.NET for Beginners (2020) by t-writescode on Wednesday April 21, 2021 @01:05PM (#26892356)
CPU rendering is an implementation detail for the majority of WinForms. Unless you're running the paint component command yourself, that could be offloaded elsewhere.
Re:.NET for Beginners (2020) by kaba0 on Wednesday April 21, 2021 @02:35PM (#26893687)
It is an implementation detail, but we are talking about a concrete framework with one implementation, not an open spec API. And as far as I know it visibly flickers on any window that has like more than 3 input forms.