Twitter Commits To Jetpack Compose
Written by Mike James   
Wednesday, 20 April 2022

If you are an Android developer Jetpack Compose is likely to be something that worries you. Unless of course you have the freedom to simply adopt the latest exciting tech - and it seems Twitter has done just that.

composetwit

The problem with evaluating Jetpack Compose as a new, and perhaps better, way of constructing an Android UI is that people compare it to XML. Over many years I have discovered that many professionals handcraft XML ab initio to create the exact UI they require. Me, I use the drag-and-drop editor and then tweak the XML if necessary.

Why the difference? 

I've never been 100% sure, but I'm sure if you're an XML writer you have already switched off after deciding that I'm not serious about UIs. Perhaps I'm not, but I can create a MVP (minimal viable product, not most valued professional) in no time at all using a drag-and-drop UI editor, not so much using manually written XML. I also make mistakes more easily while editing XML and those mistakes are often hard to fix.

You can also show a customer a mock-up of the UI and, with very little training, you can show them how to adjust the position and size of things. The great promise of one of the first declarative UI design languages, XAML was that you could split off UI design to non-coders using an interactive design program - this really was a breakthrough and a separation of concerns that paid off.

I also teach Android programming and for this the ease of getting started with a drag-and-drop editor is worth a lot. You can also use the tangible objects, e.g. buttons, to explain a lot of the ideas of object-oriented programming and it makes events a less theoretical concept. Yet drag-and-drop UI editors are generally scorned by the cognoscenti. 

jetpackicon

I have long had a suspicion that the aversion to drag-and-drop editors is the UI equivalent of the more general "IDEs are for script-kiddies and real programmers use emacs". And, yes, I'm an IDE fan as well. Why any programmer would choose to ignore tools that make the most difficult job easier has always been a mystery to me, and so it is with easy ways to build a UI.

So you will find lots of zealots comparing Jetpack Compose with XML - not so many comparing it with the easier and more sophisticated approach using a drag-and-drop editor and the constraint layout grid. It also raises the question of why the Android team spent so much time on the editor and the new, amazingly sophisticated, layout grid only to drop them in favour of something proclaimed "better".

Now we have the news that the Twitter dev team has swallowed the bait and are re-implementing its UI with the new tech. Here's a video justifying it:

Yes the video is mostly empty assertions that things are better when you compose, but the last few words are telling - I'd never have to touch XML again.... See what I mean.

The idea that Compose is declarative and hence something new and amazing is also crazy. Compose isn't declarative - XML is declaritive and so is XAML and similar. Compose is coding the UI and as such is as old as it gets.

My best guess is that we are once again the victim of fashion and Twitter really should know better.

composetwiticon

More Information

Twitter going all in on Jetpack Compose for feature development: greater productivity, less bugs

Related Articles

Jetpack Compose Is 1.0 And Ready For Use

Android Jetpack Confusion As V1 Approaches

Android Jetpack Compose Is Welcome, But What About The Churn?

Android Development - Constant Churn

JetPack And Android Studio 3.2 - Not Much New

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


Google Announces AlloyDB To Free Users From Legacy Databases
12/05/2022

Google has announced a preview of AlloyDB for PostgreSQL at Google I/O. The announcement describes the fully-managed, PostgreSQL-compatible database service as providing a powerful option for moderniz [ ... ]



Docker Adds Extensions
16/05/2022

The Docker team has announced two major improvements at DockerCon; Docker Extensions and Docker Desktop for Linux.


More News

pythondata

 



 

Comments




or email your comment to: comments@i-programmer.info

 

 

 

Last Updated ( Wednesday, 20 April 2022 )