Ever since its inception
in 1996, Java has been no stranger to criticism. Nevertheless, it’s popularity
has only continued to grow in recent years. A lot of this recent growth is due
to the widespread usage of the Android platform. Before Android, Java’s verbosity
was a favorite among project managers because it made it look like people were
getting a lot of work done. In its early days, Java even had a purpose, to
provide somewhat-secure, cross-platform web apps. But is the Sun (pun intended)
about to set on the Java empire? Recent trends show that more programmers are
turning away from this twenty-year-old behemoth named after a coffee bean.
In 2016 alone, we’ve
seen fewer web apps using Java, JetBrains releasing the Kotlin language for
JVM, and there are even rumors of Swift for Android. We don’t have any word
from the project managers yet but we can reasonably expect them to migrate from
Java by the time the aliens return.
While we wait for
that day to come, we as developers can take a stand. While I’ll likely be using
Java for the remainder of my Udacity projects, personal projects are a
different story. But why exactly is choosing a Java alternative so appealing
when building an Android app? Here are my main reasons.
Verbosity:
Project managers
aside, no one needs verbose code. Unfortunately, Java has a lot of these
problems. We need to reference a class name at least twice in order to
initialize it. This is even worse than it sounds, given that Java class names
are notoriously long. Many modern languages are still statically typed, but
have proper type inference, which fixes this problem. What about parentheses
after conditional and loop conditions? Most modern languages don’t need those
either. Add in other features like the “new” keyword and a semicolon after
every line, and you’re sure to have a mess of code.
Closures:
When first
learning Groovy to write Gradle scripts, I couldn’t help but applaud the use of
closures. This excellent feature from Swift has already taken the iOS community
by storm, and Groovy closures should really be doing the same for Android. Ever
used AsyncTask or Runnable? You may have noticed that only static properties
(from the class calling it) can be used in their methods. Closures, on the
other hand, are methods that don’t need to belong to a class. You can use any variable
from the class that’s using it. We could finally see a proper completion
handler pattern for Android, which would make networking code and long running
tasks much more readable.
Protocols:
While Swift for
Android is still a long wait away, Swift-like features such as protocol oriented
programming could be very handy in Android apps. Protocols are much more
flexible than java interfaces, with features such as optional methods. The
ability to use protocols would allow for much cleaner MVC design.
Typing Time:
This goes without
saying, having previously mentioned Java’s verbosity. All this unneeded syntax wastes
a lot of typing time. In an age where compiled languages that read like scripting
languages are common, it’s hard to make an argument in favor of the old
conventions. Building software is supposed to be about productivity. Unless you’re
in a workplace that measures lines of code, using a Java replacement is
something to consider.
NullPointerException:
Even the
experienced programmer encounters some of these. While no magical new
programming language can eliminate null pointers, there are many better ways of
handling these cases. In java, before using a class that may be equal to null,
you need to check if it’s “!= null” or use “instanceof”. In many cases, this is
necessary simply to call a single method. Instead, if you use Kotlin or Groovy,
there are special operators that can handle null pointer exceptions for you,
without needing to add an extra level of indenting.
The Future:
It took Apple 30
years to finally do something about Objective-C, so Java still has a good 10
years to live. But if you have the choice, the advantages of using an
alternative are clear. From saving time to advanced features, Java replacements
can greatly improve your Android development productivity. For me personally, I’ll
soon be porting an iOS app I wrote over to Android. I don’t intend to use a
single line of Java. The only question is: who’s it gonna be?
Kotlin, Groovy, or something else? Let me know in the comments and I'll keep you posted when I start porting the app.
Kotlin, Groovy, or something else? Let me know in the comments and I'll keep you posted when I start porting the app.
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai
Great Article android based projects
DeleteJava Training in Chennai
Project Center in Chennai
Java Training in Chennai
projects for cse
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
The ability to have the same online gaming experience, regardless of the computer hardware that you have, has been made possible through the creation and continued development of Flash and Java Script - which are both programming languages.
ReplyDeleteStartPoint
This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post. Techomash
ReplyDeletegood information on JAVA for android..
ReplyDeletereaver apk
screen recorder apk no root
Newest Movie HD apk
best radar detector
Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. Download UC browser mini
ReplyDeleteI have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! 9apps
ReplyDeleteJava is a good language but better go with other languages for android programming than going with Java!
ReplyDeleteHack Summoners War
Looking to get the best Hack Tool for Battle Cats? We have made a working one that can add unlimited resources for free!
ReplyDeleteVisit - Hack Now
If you are always on the look for brand new games to download, worry no more with the easy access to Android games. COC Free Gems
ReplyDeleteMost of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! ACMarket
ReplyDeleteGreat write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. Snapchat++
ReplyDeleteThanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. Emus4u
ReplyDeleteReally a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene.
ReplyDeleteHappy mothers day Quotes
This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine. AirShou iOS 10
ReplyDeleteThis is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine. AntiRevoke iOS 11
ReplyDeleteExcellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Cydia iOS 11.3
ReplyDeleteGreat post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article. download 9apps
ReplyDelete4th of july 2018
ReplyDeletethanks for the tips and information..i really appreciate it.. sword man monster hack
ReplyDeleteYou have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. Learn more on our website
ReplyDeletedownload ludo star game
ReplyDeleteludo star for pc download
ludo star for windows 10
ludo star download for laptop
ludo star for windows 7
ludo star for pc windows 7
ludo star for pc free download
ludo star download for windows 7
bluestacks ludo
ludo star download
download ludo star game
download ludo game full version for pc
ludo star pc online
zedge for laptop
download ludo star 2017 old version
ludo game for pc filehippo
ludo star private server apk
ludo star hack for pc
ludo star mod apk 1.0 27
ludo game free download for windows 8 laptop
ludo game for pc windows
ludo game computer download
This is the type of information I’ve long been trying to find. Thank you for writing this information. vidmate download
ReplyDeletemerry christmas qoutes
ReplyDeletemerry christmas qoutes and sayings
ReplyDeletethanks for this usefull article, waiting for this article like this again. gta vice city apk obb
ReplyDeleteI have found the latest version of Clash of clans mod Apk on the site they always update the game,
ReplyDeleteGot big winnings at once? Then come to us and get even more. best slot casino Win more with us.
ReplyDeleteThis is a blog you can get useful information and better stuff right here click here
ReplyDeleteDas Rooting ermöglicht es dem Gerät, die Installation einer Vielzahl von Drittanbieteranwendungen einschließlich Spionageprogrammen zu akzeptieren. whatsapp gruppe hacken Oder nutzen Sie das Telefon als Wi-Fi-Hotspot für Ihren Laptop zu Hause.
ReplyDelete
ReplyDeleteThanks for watching this video, if you want to download the latest version of this software.
SO the link is given below!!!
piratelink.org
Ludo Star MOD Crack
A very delightful article that you have shared here. Your blog is a valuable and engaging article for us, and also I will share it with my companions who need this info, Responsive web application development services Thankful to you for sharing an article like this.
ReplyDelete