News for hackers. Stuff that matters.
Re:When XML Beats JSON: UI Layouts by marcosdumay on Wednesday October 30, 2019 @03:45PM (#21401736)
There are languages and languages here, and your mileage will actually vary by orders of magnitude.

As people already pointed, code isn't inherently declarative or non-verbose. Some of the most popular languages for creating GUIs (Java, JS, C#) aren't either.

> It does not lend itself well to reuse

There isn't any inherent feature for code that will enable the kind of reuse you need when declaring a GUI either. You'll get it naturally in Lisp, you may be able to hack something in Haskell, and you can create a hacky DSP in in Python or Ruby, but if your GUI is in Java, CS, or JS you are out of luck.

> silly typos that won't be caught at compile time

That's a tooling issue. At Python, Ruby or JS you it is inherently more an issue than on XML, at Lisp it will vary with the actual idiom.

> At some point you will need to access your user interface from your application code

> You essentially have to learn two different sets of APIs

Well, that's bad design. There's nothing (except well, a lot of work) stopping a library from making the entire interface manipulation by actions made over XML. Granted, that is much easier and more natural in a DSL or in declarative reflexive code, so you do have a point, but it can be fixed by a lot of polishing over the worse fundamentals.

Re:When XML Beats JSON: UI Layouts by nodamage on Wednesday October 30, 2019 @09:12PM (#21404750)
Yes I agree that building declarative UIs in code does require language support and some languages are not well suited to it. But I think this is an area where we could see real improvement and we should want our tooling to evolve to better handle these problems.
Re:When XML Beats JSON: UI Layouts by marcosdumay on Thursday October 31, 2019 @11:51AM (#21410084)
Oh, I completely agree that UI declared by code has much more potential than a frozen approach like UI declared in XML. It's only that presently, it's not a clear win.