Is it too early to start talking about a compose s...
# compose
e
Is it too early to start talking about a compose style guide? Or should I check back in 6 months? 🧌
s
It's never to early to start talking about it, IMO, but it might also change a fair amount in the future. 😉
e
Yeah that's totally understandable. A style guide will evolve to match. Only mentioning it because the compose snippets I see looks like the wild west now in terms of style.
👍 1
a
What are you thinking about in particular?
e
Normal kotlin codestyles might not work for instance I’ve noticed putting
) {
on its own line in compose adds a lot of noise so it should be put in front of the last argument on the same line like
text = "Stuff") {
, also attributes (method arguments) should be on same line if short or each attribute on their own line with indent 2, while children (within the lambdas) should have indent 4 (or attribute indent x2) In actuality, the post above was a troll post but this is what I was thinking at the time
And style can get away with putting attributes and children on the same indent level (2) because children are discernable from method arguments with their names being capitalized and probably separated by a blank line.