News for hackers. Stuff that matters.
Re:The Worst API Ever Made by lelanthran on Tuesday August 01, 2023 @08:54AM (#36955345)
Could simply be that my understanding of declarative I a wrong.

AIUI, declarative is listing what you want, while imperative is listing the steps to get what you want. Naturally, I feel that extending a declaration with conditionals or looping constructs make that not-declarative anymore.

That's because, I feel, a conditional is a sequence of steps, not a declaration.

Hence I regard (perhaps incorrectly) that declarative syntax with support for conditionals is "hacky".

Re:The Worst API Ever Made by zogrodea on Tuesday August 01, 2023 @09:10AM (#36955492)
I can understand that point of view. It seems likely that UI-as-code variants (like Flutter and Elm) are more imperative (even if they have a declarative API) than separate markup languages like HTML and XAML since you have the ful power of a programming language to express what you want.

(The XAML way of expressing conditionals and loops does feel hacky to me since you need the code and markup to communicate with each other instead of expressing directly in code.)

Edit:

Here is a well-considered blog post from one of the Uno Platform contributors about UI-as-code vs markup if any are interested. https://platform.uno/blog/markup-vs-code-for-ui-angled-brack...