The effects of those issues are amplified by misuses of the exception handling mechanisms provided by Java, which are documented frequently among Android developers . These method calls are very crucial, and frequent operations are executed every time the components of the application screen are instantiated. Such a link is obtained utilizing the very commonly used setContentView and findViewById methods. #KATLIN OR JAVA FOR ANDROID STUDIO CODE#NPEs can also happen – as Payet and Spoto report – in the link between the XML layouts and explicit application code casts . The authors also underline the difficulty in protecting the code against those exceptions, especially when the app does not have access to third-party source code. report that near 30% of all stack traces collected upon the Android app crash contained NPEs as their root causes . Several studies in the literature report the prominent role of NullPointerExceptions among the reasons for Android application to crash. In the Java language, without the usage of specific checks, the handling of null values can lead to NullPointerExceptions (NPE). One of the main design guidelines that led to the development of the Kotlin language is a better handling of null values. regarding the number of StackOverflow questions about Kotlin programming for Android and GitHub repositories with Kotlin . Similar trends have been reported by Oliveira et al. In a previous study, we mined all Android apps hosted on the F-Droid platform and updated after October 2017: we found that nearly one-fifth of them featured Kotlin code, with 2/3 of those projects featuring more Kotlin than Java code . #KATLIN OR JAVA FOR ANDROID STUDIO SOFTWARE#Many pieces of evidence are available in the literature underlining that Kotlin is gaining traction among Android software developers. Kotlin is a modern programming language, appeared in 2011, which represents an alternative to Java, with which it can seamlessly coexist. Evidence suggests that the effort in transitioning to Kotlin can provide some advantages to Java developers, especially regarding code conciseness.Our results may serve as the basis for further investigations on the properties of the language. Conclusions:Some of the promises of Kotlin to be a ”better Java” have been confirmed by our empirical assessment. Finally, the IDE support was deemed better for Java than Kotlin. On the other hand, no significant difference was found in the occurrence of other common Java pitfalls. Concerning ease of development, the frequency of NullPointerExceptions reported by the subjects was significantly lower when developing in Kotlin. Results:We did not observe any significant difference in terms of maintainability between the two languages.We found a significant difference regarding the amount of code written, which constitutes evidence of better conciseness of Kotlin. In addition to the number of fixed defects, effort, and code size, we collected, though a questionnaire, the participants’ perceptions about the avoidance of known pitfalls. Method: Our experiment involved 27 teams of 4 people each that completed a set of maintenance tasks (both defect correction and feature addition) on Android apps written in either Java or Kotlin. known Java’s limitations, in terms of development effectiveness, maintainability, and ease of development. Goal: We planned to empirically assess a few typical promises of Kotlin w.r.t. Recent surveys show that Kotlin achieved a relevant diffusion among Java developers. Kotlin is advertised as capable to solve several known limitations of Java. Context: Kotlin is a new programming language representing an alternative to Java they both target the same JVM and can safely coexist in the same application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |