https://kotlinlang.org logo
#announcements
Title
# announcements
a

Andrew Gazelka

07/02/2019, 4:07 AM
looking for opinions… is Kotlin actually useful for writing JavaScript or does it make more sense at the current point in time to just use plain JS?
h

hallvard

07/02/2019, 5:10 AM
I'm not a «native js speaker», and for me, it is a tremendous help for using types and scopes without having to wonder about what I actually do... So my opinion: very, very useful!
n

napperley

07/02/2019, 7:19 AM
Will heavily depend on what you are trying to achieve. If it is to develop a web front-end then JS would be a better option since it is more established on the web front-end side, and is quicker/easier to bootstrap projects. On the other hand if it is to develop a full stack web app then Kotlin is a better option due to its explicit nature (eg more errors caught during compile time) unlike JS where magical development is the norm, and the fact that it is easier to develop APIs using a statically typed language (very important for the back-end). Also Kotlin makes it easier to develop modules, and share common code (eg domain models, business logic) via MPP ( Multi Platform Projects - https://kotlinlang.org/docs/reference/multiplatform.html ) which is a good system to use with a full stack project.
s

spand

07/02/2019, 7:22 AM
It is quite useful and we use it for everything new. Worst part is defining types for third party modules
u

U75957

07/02/2019, 8:40 AM
It's not useful if you need interact with JS/TS libs a lot. Use TypeScript instead. Also not useful for frontend(browser), because of too large runtime lib and coroutines lib (even with DCE). I actively use Kotlin/JS. And stumble on bugs every day.
y

Yan Pujante

07/02/2019, 2:16 PM
I would say it depends on your level of knowledge of javascript. I am very familiar with Kotlin (and have been writing java for 10+ years...) and only know javascript cursorily. So it is a no brainer for me to want to use the language I know the best with the features I know how to use (SYNTAX, classes, inheritances, lambdas, static typing...) instead of having to google every 5s: "how do I do this in javascript?".
👍 1