Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is exactly the kind of thing that is unnecessarily hard in non-React-like UI frameworks. XML definitely does not do this well!

In React Native or Flutter I can just declaratively go from an array to rows of UI. It will be a few lines of code and will be incredibly clear (and easy to change).

In Android or iOS I can either do something procedural (which is messy, hard to reason about etc) or do something horrifyingly boilerplate-y (as you suggest), spreading things across multiple files and greatly increasing cognitive load.

I've worked with native Android, native iOS, React Native and (a tiny bit) with Flutter. I really wouldn't use vanilla native Android or iOS (even for a single platform app) unless there were some particular requirements around perf or whatever; so much more tedious, slower and (this one is subtle and will be missed by simple comparisons) so, so much harder to go back and make changes or additions to.

SwiftUI and Jetpack compose look promising for the future. But neither are ready for mainstream (enterprise?) use today.



I mean if you want 3 identical rows to just statically be at the bottom of a view you can always define the row in XML then put it in a vertical LinearLayout at the bottom using the <include> tag. You maintain modularity without cumbersome code to deal with.

This has the added benefit of being able to see the views without having to compile your code.


Please try out one of Flutter or React Native. I think you’ll be surprised how much nicer they are for anything like this. The code is certainly not cumbersome when compared to the equivalent XML.

Also, in Flutter and React Native you don’t (typically) have to wait for your code to compile as they do hot reload.


You, and everyone else who makes this argument seems to blatantly dismiss the tooling around Android, specifically Android Studio and the layout preview panel. The person you are responding to is talking about editing UI layouts in XML, using the preview panel, without building the project at all.

Everyone loves to talk about "hot reloading" and obsess over reducing build times incrementally as if that's the only way to develop anything faster. No matter how fast your "hot reload" is, it'll never beat the layout preview panel in Android Studio, which is directly rendering your xml in real time, without compiling or building anything.


For static layouts this can work pretty well. I think it is still typically a bit slower/more awkward. And often harder to change. (I actually have most experience with native Android.)


Android Native also has hot reload, what on earth are you on about?

You get both with Android Native, layout preview and hot reloading.


I was addressing the comment and in no way claimed Android doesn’t have a hot reload solution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: