back to article Meta met a programming language it likes better than Java

Meta, parent of Facebook, is in the midst of migrating its Android app Java code to Kotlin, a younger programming language that also relies on the Java Virtual Machine, or JVM. Created by software tool maker JetBrains, Kotlin debuted in 2011 and by 2016 had reached its 1.0 release. The following year, it was adopted by Google …

  1. Sampler

    PWA

    Facebook doesn't do anything a PWA can't support, even Instagram - from a users perspective they would do better to wrap their codebase as a PWA, then they'd have a website, mobile web and multiplatform app that gave a consistent user experience.

    But, as we all know, it's not about the platform users, it's about the real users, selling platform users data so they need a native app to steal as much device data as they can get their grubby mits on.

    (which is the only excuse as to why the mobile web version is such a piss poor implementation for a company that can afford to blow $10b on vr)

  2. Yet Another Anonymous coward Silver badge

    10 million lines of Kotlin code

    For a wrapper around facebook.com in a browser, a chat client and a video uploader ?

    Am I so out of touch? Do mobile platforms not do anything and you have to write everything from font renderer to protocol stack yourself in your app?

    1. Anonymous Coward
      Anonymous Coward

      Re: 10 million lines of Kotlin code

      Required abstraction templates, mandatory use of inappropriate tooling, restricted features, architecture from blogs... Implementations bloat to 40x larger than an ordinary and correct solution. That quantity of code is completely unmaintainable so updates can only be applied as new layers over the old code. Now you're at something like 200x bloat and it's a dead-end. The obvious escape route is to declare that you're switching to a better language!

      AC because I'm living this hell

    2. DrXym

      Re: 10 million lines of Kotlin code

      I remember reading a long time ago that FB were bitching that they tried to wrap their website up in a thin app and it didn't behave natively so changed tack and wrote a thick client. Have to assume that includes a chunk of the backend too.

  3. DrXym

    The real reason

    Android supports Java 1.6 with some support for 8. It's just getting long in the tooth and it's probably the case over time that it becomes harder to maintain & develop code, especially code with external dependencies or a desire to use new Google APIs.

    Kotlin itself is more terse, more declarative, safer (e.g. adding null safety), more functional than Java. It is also available on iOS and other platforms so for someone like Facebook it probably represents a way to consolidate code. There is even a native (compiled) version of the language.

    I think if Oracle hadn't tried to strong arm Google, then the platform would probably still be using Java but they didn't. It's kind of weird that Google didn't choose go for their replacement but perhaps it wasn't seen as a viable migration path.

  4. Androgynous Cupboard Silver badge

    Wow

    Rewriting 10 million lines of code for no speed benefit, with the only measurable metric being 11% less source code? My conclusion from this project is Meta have too much money.

    1. sw guy

      Re: Wow

      Possible benefit: Less snafu count for application ? (see non-nullable types)

      1. richardcox13

        Re: Wow

        Given the long history of analyses of bugs shows close to constant bugs/LoC code rates, any reduction in LoC is likely to lead to fewer bugs.

        This is why the whole "C was good enough for me three decades ago" crowd are missing the point.

      2. matjaggard

        Re: Wow

        Non-nullable types really give you very little over static analysis that IntelliJ/Android studio already do in Java. Some, yes but not that much especially if you use annotations to specify nullability.

    2. Julz

      Re: Wow

      You forgot the 'benefit' of not using any potentially Oracle IP :)

  5. Alan_Peery

    Other major users of Kotlin?

    OK, so Metafacebook has jumped in at the deep end -- who else has done so?

  6. breakfast

    Surprising

    This quite surprised me, I had kind of assumed that as Meta were responsible for React that they'd be using React Native for this kind of stuff.

    Either way the usability on their facebook apps is excruciating, especially on the business side. I feel like getting some usability teams in would be a bigger benefit than any amount of shoving things around in terms of language.

  7. F. Frederick Skitty Silver badge

    I've found Kotlin a bit of a mixed bag. The equivalent of Java's collections interfaces are immutable by default, which I like a lot as it encourages immutable classes that can be passed around without fear of them being unexpectedly modified.

    However, on the functional side of things I feel that Java caught up with version 11 and overhauled Kotlin with version 17. I also dislike the more "scripting language" like style of Kotlin, having experienced the awfulness of Groovy - the JVM based language that feels like Kotlin's spiritual ancestor.

    1. matjaggard

      Agreed. I use Java and Kotlin extensively (neither for Android) and once you get to recent versions there's not so much benefit of migration especially if you use Lombok to cut down on pointless boilerplate (even then Java records work better)

      Immutable collections are now the "default" on Java too. See List.of and similar which are equivalent to the Kotlin collections.

  8. 9Rune5

    DSL

    I thought domain specific languages went out of fashion decades ago?

    1. matjaggard

      Re: DSL

      If only. I still use and hate Groovy for Jenkins and for Gradle use. Kotlin is marginally better but still needles in eyes are preferable.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like