4 ms·
My problem with this is that it’s absolutely unclear to me how to even get started. The whole Java landscape is full of magic to me. Getting started with node
by Aeolun 5y ago
My problem with this is that it’s absolutely unclear to me how to even get started. The whole Java landscape is full of magic to me.
Getting started with node is a matter of downloading a single binary, writing one js file, and executing it with said binary.
Upgrading that to Typescript is a matter of downloading another binary, and running the two in sequence.
Conversely, Java feels like I have to develop a whole program just to get my program to run.
- paxys 5y agoStep 1 is to buy an IntelliJ IDEA license.
- jpgvm 5y agoCommunity build is completely fine for writing Kotlin. You probably only need an IntelliJ license if you want a bunch of the non-Kotlin plugins.
- jillesvangurp 5y agoExactly, it's what I use currently for Kotlin frontend and backend development. I've also used the opensource community edition it for Java and Python development. There are a few things that you would have to pay up for that might be worth the money depending on what you are doing. I think their C/C++ IDE (CLion) costs money for example and they have an alternative to XCode called AppCode that does not have a community edition. And they have a few other things that might be worth the cash. But simple Kotlin development works great without that. Everything you need comes with the community edition. You do need a fast computer to run it. It's a resource hog.
- listenallyall 5y agoThis is a terrible suggestion. IntelliJ Community Edition is enormously powerful and more than sufficient for getting started with Kotlin. I've been coding in Kotlin for years and still don't have a reason to pay for IntelliJ (sorry JetBrains!)
- Aeolun 5y agoI completed that step a loooong time ago :)
- jpgvm 5y agoIt's really not that bad. I would start with downloading IDEA and then following the steps to select a Kotlin/Gradle project (make sure to select Kotlin Build Script) which will spit out a "Hello World" basic setup for you. From there add a dependency by editing build.gradle.kts and you will be doing OK in no time.
- Aeolun 5y agoYeah, but I can not do that without a using the whole project template. Half of all the options in the build file mean nothing to me, much less why they’d need to be there in my starter project.
- jpgvm 5y agoI don't buy that. The minimal project Gradle build script does exactly 4 things. 1. Enable the Kotlin Plugin 2. Set the package metadata (group and version) 3. Add Maven Central as a repository (equivalent of say npmjs.com) 4. Add the Kotlin Stdlib as a dependency. You may have accidentally enabled extra stuff through the new project wizard which is admittedly more complex than it should be (especially if you are using IDEA Ultimate with many plugins enabled). I suggest the following flow: New Project -> Select Gradle on the side panel -> Check the Kotlin Build Script box -> Select only Kotlin/JVM. This should set you up with a very minimal project with exactly 3 files (build.gradle.kts, gradle.properties, settings.gradle.kts). From here you can either create a package i.e go for the src/main/kotlin/com/example/main.kt route or just create main.kt in the top level without a package.
- innocenat 5y agoIncidentally, that's how I feel about the JS ecosystem with webpack/etc.
- deepsun 5y ago1. Write a file `HelloWorld.java`. 2. Compile it to bytecode (.class file): `javac HelloWorld.java`. 3. Run it: `java HelloWorld.class`. If you want to use other libraries, add `-cp` parameter ("cp" stands for "classpath"). If you want to package your code as a library, run `jar HelloWorld.class` (.jar is basically .zip renamed).
- laurent92 5y agoAnd if you want a webapp, use SpringBoot.
- kaba0 5y agoHell, you don’t even have to compile it anymore — java HelloWorld.java just does the thing you wrote. Also note that `java HelloWorld` looks for classes, so if you are in the same directory as the classfile, .class is not required.
- lokedhs 5y agoThis is exactly opposite to my experience. Doing anything in JS requires so many dependencies, and specialised knowledge about what frameworks to use. I think we can conclude that if you have so prior knowledge, getting it working is much easier.
- saltmeister 5y ago
- Viliam1234 5y ago> Java feels like I have to develop a whole program just to get my program to run. Is this about the "pom.xml" files? In the simplest case, they just contain the name and version of the program, the version of Java you want to use, and the names and versions of the libraries you want to use. You would need to specify this somewhere in any language. And yes, sometimes it gets more complicated, if people want to do more complicated things. It's either this, or having a dialog somewhere in IDE that does the same. People often overcomplicate things, but it usually doesn't need to be so. As an example of a simple Java code, see this: https://gitlab.com/kittenlord/image https://gitlab.com/kittenlord/image