Giter Club home page Giter Club logo

Comments (6)

Chainfire avatar Chainfire commented on August 21, 2024

I understand the title, but I'm not following the description. I have barely done any Kotlin, please elaborate on the problem.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 21, 2024

@Chainfire The "?" on Kotlin means about the same as the annotation "Nullable".

from libsuperuser.

Chainfire avatar Chainfire commented on August 21, 2024

I've added the annotations (push soon) but I haven't used them before so I hope they're correct :)

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 21, 2024

Well, if you used Kotlin, you'd be forced to use them ( nothing in case it's non-nullable, and "?" in case it's nullable), and then you could see in both build time (errors might appear) or during runtime (crashes in case it doesn't match).

Of course, Kotlin has its own annoyances, some don't exist on Java...

from libsuperuser.

Chainfire avatar Chainfire commented on August 21, 2024

Yes, I understand. Unfortunately I'm currently not working in either Java or Kotlin myself. Kotlin was on the to-do list for my next project, so I went through all the tutorials to get started last year, but my job suddenly went in the Python+C direction so I haven't gotten a chance to do anything real with Kotlin yet. I don't remember enough to do anything in it quickly right now, and I don't have the time right now to get back into it.

I mean, the annotations are probably correct, they're not that complicated after all, but please let me know how they work out for you.

from libsuperuser.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 21, 2024

Kotlin is very similar to Java in various ways.
And, I got to learn much from it by just converting existing code via the IDE tool itself.
The most common issue with conversion from Java to Kotlin is nullability, so before converting it's very recommended to add nullability annotations, so that the converted will know what to do (it's quite stupid in this matter, no matter how many clues there are about nullable stuff there are there).

I made a task to myself, to convert most (or entirely) of the files on my spare time apps to Kotlin. This week I've finished it, with just one class in one of my apps that I failed to convert (it's quite a messy class, which I'm not really the one who made it originally).

I try it at work too, but this is a much larger task, because the app we work on has at least 1000 of Java files ...

Usually code in Kotlin is shorter than on Java, and there is a chance that it will run better than Java starting from Android P in some cases (here and here) .

from libsuperuser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.