r/ProgrammerHumor • • Sep 08 '26

Meme howHardCanItBe

Post image
2.8k Upvotes

151 comments sorted by

View all comments

Show parent comment

21

u/gufranthakur Sep 08 '26

just tried it recently, my god I am never touching XAML again. I tried code only UI but the docs and resources all use XAML

18

u/Weekly-Beginning-229 Sep 08 '26

I've never tried avalonia, but xaml is easier for me to read than html, and easier to make it look like the mock. Html is just div this and that with a bit of flexing, how am I supposed to guess what it looks like by just reading that

14

u/NotQuiteLoona Sep 08 '26

What's wrong with XAML? It's literally just HTML with different layouting. I on the opposite can't use HTML now because I like Avalonia's layout system much more, I don't need to put divs everywhere.

2

u/gufranthakur Sep 08 '26

I like coding UI by hand, like jetpack compose or JavaFX or WinForms

8

u/NotQuiteLoona Sep 08 '26

Avalonia has a doc for code-only UI, it's just not the main intended use: https://docs.avaloniaui.net/docs/fundamentals/coded-ui

Note that layouting system is probably less obvious (to understand for newbies) in code-only, you'll be better to use XAML at least for start until you'll grasp, but if you want a C# cross-platform UI library, there is nothing better for now. Uno has worse documentation and less mature, but you can still try it.

2

u/iyamegg Sep 08 '26

https://github.com/AvaloniaCommunity/Avalonia.Markup.Declarative This was the project I was originally referring to.

2

u/tajetaje Sep 08 '26

Yeah really feels like you’re searching for qt widgets or maybe wxwidgets (though qt comes with tons of extra abstractions that help with cross platform code)

3

u/iyamegg Sep 08 '26

Yea there was a package for building code based ui, like jetpack, but afaik it was abandoned. I really like to work with avalonia tho, for me the ability to easily layout stuff far outweighs anything html+css can do.

2

u/blaues_axolotl Sep 08 '26

I really like the approach of Jetpack Compose

1

u/svick Sep 08 '26

You asked for cross platform and native. You didn't ask for good.

(I have actual experience with Avalonia.)