0
$\begingroup$

I'm teaching a course on Mobile App Development. I was thinking of ditching XML and doing Jetpack Compose for UI development. I find compose more intuitive and productive. XML has a larger market share / legacy code but Compose is the new big thing.

What do you think? Teaching Compose instead of XML to beginner students (who already know programming btw) is a good idea?

$\endgroup$
2
  • 1
    $\begingroup$ What do you mean by "know programming"? $\endgroup$
    – Buffy
    Sep 12, 2022 at 10:17
  • $\begingroup$ @Buffy: Meaning they know how to program, know about variables, loops, data structures, can design object oriented systems etc. $\endgroup$
    – fakhir
    Sep 12, 2022 at 11:17

1 Answer 1

2
$\begingroup$

Jetpack Compose is absolutely amazing. It has a great community (kotlinlang slack - compose channel), a huge power behind it and there already is quite a number of very decent tutorials on it.

On one hand one may argue that XMLs are simpler. I would say that this is pretty much never the case - they are more familiar. Jetpack Compose seems to be successor of Android (at least1) UI development, so students may find it very motivating that they are being taught the new thing that may as well be the norm in the future. While some of the concerns regarding usefulness of teaching (potentially) outdated tools are inherently wrong, one must remember that students' motivation plays a big role in courses.

Additionally, there is an advantage to Compose that cannot be overlooked - it uses Kotlin. The very language used for expressing parts of the system (mobile application) matters. A lot. So now, instead of learning Kotlin, learning XML and learning how to bind the two, students can... simply learn Kotlin. Yes, they need to learn which functions to invoke in Compose, but they would've had to do it with XML too. Just with tags, not functions.

It would seem like Compose is the clear winner here, but (in my opinion - unfortunately) it is not the case. Compose is a very young framework. Its adaptation will take a long time and, if your goal is to prepare your students for being able to work with mobile development as soon as possible, learning XML will be way more beneficial to them.

If it was up to me, I wouldn't focus on aiming to make the students employable as quickly as possible. I would show them things that are more powerful, simpler, more elegant and easier to integrate. I would show them Compose.


1I say at least, because I have been using Compose for things like Desktop development too. It's a little lacking there, but apart from it being a little incomplete (makes sense, since it's a fairly young framework), it is the best GUI library I have ever touched.

$\endgroup$
3
  • $\begingroup$ I did what you advised. Can you kindly provide some feedback for the following course outline I designed? docs.google.com/spreadsheets/d/… $\endgroup$
    – fakhir
    Sep 27, 2022 at 6:33
  • $\begingroup$ @fakhir I am not sure whether the comment section would be the appropriate place for such discussion, but after a quick glance I can say that it looks rather promising. Could you share the expected level of expertise of the students that join your course? Additionally, I think it would be a good idea to touch on Android's means of communication with the app, like Broadcast Receivers and Services. $\endgroup$
    – Fureeish
    Sep 27, 2022 at 10:32
  • $\begingroup$ Oh yes, that's an important topic. Thanks. $\endgroup$
    – fakhir
    Sep 27, 2022 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.