News for hackers. Stuff that matters.
Re:Why you should not develop apps for Windows 10 by userbinator on Wednesday January 20, 2016 @07:07AM (#10937497)
Once you understand what the equivalent would be in a pure Win32 application, XAML starts to make much less sense... making a window resizeable involves setting one bit in the window styles and responsive just means a loop over the contents to move them to the right places when WM_SIZE message is received.

Declarative UIs in XML are more verbose and less flexible than just putting the appropriate expressions in a simple resize-recalc table, which is what the Win32 equivalent would be.

Re:Why you should not develop apps for Windows 10 by exDM69 on Wednesday January 20, 2016 @07:42AM (#10937646)
Without addressing the XAML mess, Window resizing in WINAPI is a complete mess too. You toggle whether a window is resizable by setting the window style (wtf!) with WS_THICKFRAME. When resizing windows, you need to handle three different messages (WM_ENTERSIZEMOVE, WM_EXITSIZEMOVE, WM_SIZE). To set minimum/maximum size, you respond to a WM_GETMINMAXINFO message.

All I wanted was SetWindowMinMaxSize(hwnd, min_size, max_size) and an event to tell me the window has resized. That's it.

This complexity allows apps to misbehave in various ways, either unintentionally, on purpose or maliciously. Windows programming is so darn complicated that it doesn't make any sense.

Re:Why you should not develop apps for Windows 10 by imtringued on Wednesday January 20, 2016 @07:57AM (#10937706)
>responsive just means a loop over the contents to move them to the right places when WM_SIZE message is received.

So you're suggesting I should handroll my own layout manager? That sounds several orders of magnitude more complicated.

Re:Why you should not develop apps for Windows 10 by vesinisa on Wednesday January 20, 2016 @07:24AM (#10937577)
Well, essentially your re-layout loop would probably end up applying some specific pattern in code. Declarative UI is basically a way of doing that in a way that other developers have a better chance of understanding, and is less prone to bugs.

Not that you couldn't go the hard way and write the responsive UI with code only. A XAML file is essentially just a recipe for creating the hierarchy of objects in your UI, that the framework then goes on to draw. Everything that is done in XAML can just as well be done with code.