IMPORTANT FEEDBACK Coming from a javascript and p...
# language-evolution
d
IMPORTANT FEEDBACK Coming from a javascript and python background, I am facing great difficulty in using Kotlin. The same for my friends too. For getting good at Kotlin, the environment is kind of like "You must know java or c++ like language if you want to learn Kotlin". Also, I love using the terminal for most of my work. But Kotlin tries to force you to use IntelliJ. I want to mention that I love the language really and I don't want to leave this language behind. But it has been more than a month or two, and I still cannot figure out how to create an executable using Kotlin. And also, I and sick of using IntelliJ. No offense, but using the IDE for a simple program is not worth it. For this, I don't even feel like writing some coding with Kotlin in my daily life. But I am still not leaving it, as I love the language at its core. So, can anyone help me with this? I can be thinking in the wrong way; in which case guide me in the right direction.
j
Also, I love using the terminal for most of my work. But Kotlin tries to force you to use IntelliJ.
If you are using Gradle that is not true as you can run any Gradle command from the terminal. When you create a project from IntelliJ, select Gradle. I think Gradle has a init command to create projects too but I haven't tried for a while.
I want to mention that I love the language really and I don't want to leave this language behind. But it has been more than a month or two, and I still cannot figure out how to create an executable using Kotlin.
That depends on which build tool you are using. You should Google about Gradle which is the main pushed build tool for Kotlin.
m
Have you looked at this guide? https://kotlinlang.org/docs/command-line.html
j
Personally I think starting with that guide with no Kotlin or Java background is not a good idea as almost "nobody" uses that and you will not find a lot of examples.
d
so what can be done?
j
As I have said, check Kotlin Gradle guides
m
Afaik there is an existing kotlin language server implementation. It doesn't provide the same experience as IntelliJ in terms of analysis, but it should give you completion etc. for editors supporting LSP.
d
I want to learn languages like C++, Java, and Kotlin. I chose Kotlin to get started. Should I learn Java/C++ before learning Kotlin?
j
No, you can start with Kotlin
d
I am having trouble with
building
as I don't have any prior familiarity with this. I am using
Gradle
When I go through any Kotlin, I have never come across the concept of
building
I don't know why. But it seems pretty important though.
p
To be honest, if you're not fond of working with an Integrated Development Environment (IDE), then Kotlin may not be the best choice for you. The major benefit of a statically-typed language is its ability to be statically analyzed, and this is where an IDE can be extremely useful, especially for beginners who require guidance. When studying a new language, I suggest embracing the ecosystem's behavior. If everyone uses an IDE, that's a compelling reason to do so as well. I advise investigating alternative routes, such as not using an IDE or utilizing alternative build systems, after you have mastered the language to better comprehend the decision to do so.
a
In order to guide you in the right direction, I advice you to get confortable with basic gradle. With gradle, everything can be done on the terminal. So you need to learn • Basic gradle concepts (i.e. running and configuring tasks, adding dependencies, setting gradle plugins and configuring them) • Kotlin gradle plugin (KGP). Learn what kotlin plugins are available (start with the
kotlin("jvm")
plugin. as it is more mature and need minimal configuration compared to other plugins, then you can work your way up
kotlin("native")
,
kotlin("js")
and then finally
kotlin("multiplatform")
• Use your above knowledge now, to build, run, test and publish/distribute your kotlin code without the help of any IDE