News for hackers. Stuff that matters.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by gvb on Thursday March 23, 2017 @12:33PM (#13941318)
The abstraction layer has only remained the same visually, and only for a loose definition of "visually."

In the "good old days" the user interface was 640px x 480px (original VGA[1], skipping past the original MDA, CGA, and Hercules graphics cards[2] since they predated "modern" GUIs). Then it was expanded to 800x600, etc. The programs of those days were hard-coded to the graphics adapter resolution. If a program did not support the graphics adapter you had, you had to run your GUI in lower resolution compatibility mode. Sometimes it didn't work at all.

In lower resolution compatibility mode, the program's display got uglier and uglier as the screen resolution went up.

The abstraction layer today is adaptive and high DPI. Since the abstraction layer abstracts away the actual display resolution, programs (generally) can take advantage of the resolution that is available on a given display without change, allowing a program to run on small hardware displays (phone/tablet form factor) up to mega 4K++ displays, looking better and better as the screen resolution goes up.

[1] https://en.wikipedia.org/wiki/Vga

[2] https://en.wikipedia.org/wiki/Hercules_Graphics_Card

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by pcwalton on Thursday March 23, 2017 @01:14PM (#13941760)
Precisely. And even Win32, which is being touted in this thread as somehow far superior to the Web stack, was never designed for high DPI apps. It's far worse than the Web stack, with exact pixel hardcoding everywhere. That's why the HiDPI situation on Windows is such an inconsistent mess. Meanwhile, the Web scaled up to HiDPI so seamlessly that most people never even noticed any friction. This is the benefit of the declarative model of CSS.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by kayamon on Thursday March 23, 2017 @05:05PM (#13944266)
Win32 was designed around DPI-independence from day one. That's why things like GetSystemMetrics exist. Unfortunately, the app developers chose not to use them.

GDI was originally designed to run on printers as well as screens, where the DPI values are completely different.

The declarative model of CSS has nothing to do with it. You can specify pixel values in CSS if you like.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Sharlin on Friday March 24, 2017 @02:30AM (#13947089)
> You can specify pixel values in CSS if you like.

And many (most?) do... leading to the reinterpretation of what "pixel" means in the CSS spec. Yes, CSS pixel does not mean a physical pixel on the screen.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by pcwalton on Friday March 24, 2017 @02:39PM (#13951153)
> Win32 was designed around DPI-independence from day one. That's why things like GetSystemMetrics exist. Unfortunately, the app developers chose not to use them.

Integer pixel coordinates are right there in the most fundamental functions:

    HWND WINAPI CreateWindow(LPCTSTR lpClassName,
                             LPCTSTR lpWindowName,
                             DWORD dwStyle,
                             int x,
                             int y,
                             int nWidth,
                             int nHeight,
                             HWND hWndParent,
                             HMENU hMenu,
                             HINSTANCE hInstance,
                             LPVOID lpParam);
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by revelation on Thursday March 23, 2017 @02:18PM (#13942512)
WPF is perfectly fine for high DPI apps and still beats all this web stuff by orders of magnitude.

CSS people still think a grid is a choice of "small" "medium" and "large" columns/rows. Haha.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by pcwalton on Thursday March 23, 2017 @02:55PM (#13942952)
> WPF is perfectly fine for high DPI apps and still beats all this web stuff by orders of magnitude.

> CSS people still think a grid is a choice of "small" "medium" and "large" columns/rows. Haha.

CSS Grid is literally Microsoft taking the WPF grid layout and porting it to the Web!

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by revelation on Thursday March 23, 2017 @03:05PM (#13943064)
Yes, that is what I'm saying. They are not porting it because previous solutions have been just as capable.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by pcwalton on Thursday March 23, 2017 @03:10PM (#13943124)
But they did port it. That's why CSS Grid exists…
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by coldtea on Thursday March 23, 2017 @03:53PM (#13943587)
Yes, but his point is that for ages it didn't exist. Like, for 2 decades and something, was first tables, then "floats" BS.

And even now it's still not mature and supported in all browsers.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by smitherfield on Thursday March 23, 2017 @01:59PM (#13942285)
Isn't this a false dichotomy? Why not create more modern, declarative native APIs and libraries, or use them where they already exist?
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by posterboy on Thursday March 23, 2017 @04:24PM (#13943897)
> the old stuff worked just fine

> we don't need the new stuff

> how about we throw both away to shut everyone up, would that make either side happy?

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by khedoros1 on Thursday March 23, 2017 @05:14PM (#13944356)
How about: Take what we learn from new development so that we can improve the older, lower-level stuff, and strip away some unnecessary levels of abstraction?
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by josephg on Thursday March 23, 2017 @07:45PM (#13945387)
Yep. I did some swift development recently and while I absolutely loved the language I was struck with how much worse the uikit APIs are compared to react.

There's nothing special about javascript the language. The nice thing about web development is that the really fast framework iteration cycles. And everyone complains about them, but as a result we have some fantastic APIs for UI development in javascript land now. (Eg, react.)

What I want to see is someone port those lovely abstractions across to native languages. For example, a port of choo[1] to swift on top of uikit would be gloriously fast, efficient, small and easy to work with.

[1] https://github.com/yoshuawuyts/choo

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by pcwalton on Thursday March 23, 2017 @02:11PM (#13942419)
Because it's less effort and more likely to be successful to just improve Web implementations.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by smitherfield on Thursday March 23, 2017 @02:14PM (#13942463)
Sure, but it's also more likely to make my laptop with 16 gigs of RAM, 8 simultaneous threads and SSD feel more sluggish than the one I had 10 years ago.

Edit: I'll add, I frequently see people say that Windows XP was the best OS ever made. Why the rose-tinted glasses? It was the tail end of the era when hardware was getting faster, faster than software was getting slower.