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


Firefox 1.0 Released 20 Years Ago
10/11/2024

A news item with the headline "Firefox browser takes on Microsoft" from 20 years ago has attracted renewed attention. It was originally published on the BBC News website on November 9th, 2004 rec [ ... ]



Rust And C++ Should Be Friends?
20/11/2024

The Rust Foundation has just released a statement on Rust and C++ interoperability and Google is ponying up $1000,000 to see that it gets done.


More News

espbook

 

Comments




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

 

 

 

Last Updated ( Wednesday, 20 April 2022 )