https://kotlinlang.org logo
l

louiscad

06/03/2019, 9:23 AM
@Antanas A. HTML and CSS are not desirable. Just look at the massively inconsistent ecosystem of WEB UI frameworks and helpers. We don't want to be lost in a jungle of solutions that all have unsatisfying drawbacks. The cascading nature of CSS leads to many display bugs where some style is often applied to elements that were not designed for it. HTML is more verbose than what Kotlin can bring us, and lacks any logic. That's why there's "magic" frameworks or things like JSX. There are plenty of other reasons, but I think that's enough to justify trying to make something better, without the decades of legacy HTML and CSS have.
2
👎 2
👍 1
@jw May I know what you disagree on in this slightly lengthy message? Maybe I'll agree on your disagreement.
j

jw

06/03/2019, 7:30 PM
Most of the points don't resonate or make no sense
All rendering lacks logic and requires moving that to a declarative layer
It's why there's a million frameworks and why there's a million ways to do the same awful thing in Android and iOS
Lots of platitudes without concrete examples. "inconsistent ecosystem?" what is inconsistent and why is consistency desired and what about the consistency of web components "unsatisfying drawbacks?" such as? what about all the ridiculous benefits afforded therein?
if you think JSX is magic, then i have bad news about literally every language ever. it's all just lexers, parsers, and compilers aallllll the way down the stack.
what do you think compose is that JSX is not?
they're both forks of a language implemented as a compiler plugin doing IR-based transformation
l

louiscad

06/03/2019, 7:33 PM
Like you can't mix Vue with JSX and React that easily.
j

jw

06/03/2019, 7:35 PM
Encapsulate each in a web component and they'll compose well
l

louiscad

06/03/2019, 7:45 PM
I was thinking interop with multiple ways of doing things. I meant it's not so much better as Android's current situation in a way that just having web technologies of 2019 to make UIs on Android would be a satisfying improvement. It's been a long time I did HTML and CSS though, like 4+ years ago. I was lost as I was seeing the rise of web components with Polymer and AngularJS OTOH made by the same company, and vanilla HTML/CSS. Having to use JS (dynamic types, tooling) was what made me lose the train as I was starting Android Dev in apprenticeship. Nowadays, there's a gazillion ways (maybe not literally) of doing UI on the web, and sure, you can heavy load your app with web components composition from multiple frameworks if you change your mind down the road because of a "gazillion" possible reasons.
I didn't call JSX magic (mind the "or). What I meant by magic was the html non-standard attributes that are recognized by JS code, or by a pre-processor (but not always handled by tooling correctly or smoothly, at least 4 years ago). Example:
ng-repeat
. You can tell how similar it is to a programming language, but those don't give me the same dev experience as a plain function call or loop in Kotlin that IDE and compiler recognize and check.
j

jw

06/03/2019, 7:53 PM
You're conflating a cherry-picked set of things and packaging them as an argument. It's trivial to do that same with Android or iOS or Kotlin or just about anything because you either are using ng-repeat or a simple for loop in JSX, not both at the same time.
l

louiscad

06/03/2019, 8:11 PM
You can see it this way. Anyway, I think we all want UI development to be simpler. Personally, I don't look for more options, but for a straightforward choice because there's only one good option. The WEB ecosystem for UI dev doesn't seems to be that to me. That's why I cherry picked what I had at the top of my mind among the massive amount of thoughts that and confusion I have about WEB dev. And I can do the same for Android where it's hard to pick between Drawable(s), Canvas, "composing" Views, with a bit of inheritance… adding transitions and animations, along with manual way with coroutines… Yes, Android UI is a struggle too, and as I started iOS recently with full Kotlin/Native it felt almost worst with the constraints system I didn't get yet, with multiple APIs for it. Isn't that a few reasons wht we are all looking towards Compose (and SwiftUI)?
j

jw

06/03/2019, 8:14 PM
Nothing about those things are intrinsic to the web
Libraries like Svelte are just compose and swiftui for the web. Anko layouts are just your bad web frameworks for Android.
😂 3
l

louiscad

06/03/2019, 8:57 PM
HTML is quite intrisic to the web as of 2019, and HTML alone is only declarative, unlike Kotlin or Swift which can take advantage of higher order functions, control flow, and <drop><this><kind><of><little> <repetitive>noise.</repetitive></little></of></kind></this></drop> that adds up and makes readability a little harder. With such a base that you can't really circumvent, I think it's hard to make something as satisfying as Compose or SwiftUI (opinion based on the snippets and comments I read about it). JS is also intrisic to the WEB as of 2019 (although there are ways to avoid it somehow), but let's not debate all the wrongs and opinions about JS.