9 ms·
This might be more appealing to programmers outside the Java ecosystem if it didn't depend on Gradle.
by skybrian 5y ago
This might be more appealing to programmers outside the Java ecosystem if it didn't depend on Gradle.
- teg4n_ 5y agoYeah. I’ve tried to get into Kotlin multiple times and the tools used for building like Gradle are inscrutable to me.
- InsaneOstrich 5y agoGradle and Maven are both a million times better than whatever constantly changing collection of random stuff you have to use to build a contemporary node project.
- giveupitscrazy 5y agoYou don't need anything to build a node.js app. If you use typescript then yes you'll want typescript, but honestly the experience out of the box in node is pretty fantastic that you don't need anything else, as far as build goes. Granted if you are talking frontend browser code then sure webpack, but that tool has been around and stable for many years now. Added bonus too is browser adoption is way better than ever so you don't really need a transpile either, typescript being the exception.
- skinnymuch 5y agoDeno is making Node seem like exactly what it is. Node being mediocre and something a person made over a decade before Deno.
- root_axis 5y agoNah. Gradle has its advantages but it's way more complex than building a node project. The Gradle DSL is utterly incomprehensible to anyone that isn't a seasoned Java dev. Honestly, I struggle to think of a language with a more complex build system than Gradle, besides building cpp apps.
- Aeolun 5y agoI dunno, I understand building cpp apps much better than building a Java one. And I have basically zero experience with both.
- ohgodplsno 5y agoSeasoned Java/Kotlin dev: Nah, Gradle is a fucking mess no matter what. If you don't absolutely understand the gradle life cycle, how to avoid task configuration, keeping everything lazy, avoid cross configuration, understand that buildSrc is shit, gradle will be hell.
- matsemann 5y agoAgreed. Maven is boring, but for most stuff it just works. Hard to customize, but before doing that, ask yourself why you're doing something different than millions of other projects. Go with the defaults and things will work. Gradle feels to me like trying to set up a webpack project. Loads of magic configuration no one dares to touch after it happens to somewhat work correctly.
- kaba0 5y agoI’m not a big fan of kotlin, but gradle does have a kotlin dsl as well which is in my opinion much more readable and explicit.
- weego 5y agoSBT is in another tier of incomprehensible stupidity
- vips7L 5y agoNothing is a bigger time killer than sbt and scalac!
- nsonha 5y agoyou can write gradle in kotlin script, the same language as your code if it's kotlin.
- pjmlp 5y agoMaven yes, Gradle is just Ant in disguise.
- zmmmmm 5y agoHonestly I just wish it had stopped at gant [1]. That was truly Ant in disguise and it was glorious. [1] https://github.com/Gant/Gant https://github.com/Gant/Gant
- lenkite 5y agoLet's not compare Maven to Gradle. One is a stable, rock-solid, decades old declarative build tool with reasonable performance and excellent backward compatibility - the other is a configuration, semantic and maintenance nightmare.
- p2detar 5y agoGradle has actually saved my build. About 3x faster than my old Maven setup. Also, my build files are much less bloated. The only problem I find is the API updates between major versions. Still, I’m never going back to Maven. Love Gradle. Building embedded server apps, many sub projects, single Java/Kotlin codebase.
- lenkite 5y agoThe only reason Gradle is faster is because it uses a daemon for build caching and leverage JVM code optimization. Once you apply that same strategy to Maven, it actually tends to beat Gradle in performance too. See Maven Daemon: https://github.com/apache/maven-mvnd https://github.com/apache/maven-mvnd
- ptx 5y agoAnd if you build from inside IntelliJ, I think it already does essentially the same thing (unless you tell it not to) by importing the Maven project into its internal build system and using a compiler daemon: https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#delegate_to_maven https://www.jetbrains.com/help/idea/delegate-build-and-run-a...
- InsaneOstrich 5y agoGradle also has the ability to skip things it has already done. It won't recompile code that hasn't changed, won't run tests that haven't changed, etc
- p2detar 5y ago> actually tends to beat Gradle in performance too. Mvnd seems somewhat recent compared to Gradle’s daemon feature. Are there any measurements that confirm this statement? I don’t find any in the repo?
- IshKebab 5y agoNot sure I agree. NPM as a technology is actually pretty decent and fast. The biggest issue is that package.json doesn't allow comments. Webpack is shit. But there are good alternatives to it now - primarily esbuild. I'd take that build system over Java's dog slow build systems any day. Just a shame about the JS ecosystem itself. Too many badly written libraries not written in Typescript (inexcusable these days) with a gazillion dependencies.
- kaba0 5y agoHow is Java’s build tool slow? The single frontend compile step is literally the slowest in a badly architected project we use, even though it goddamn deploys to wildfly! Java literally compiles as fast as it gets, while npm chews through the same files multiple passes, and goddamn barely does anything yet takes eons of time.
- InsaneOstrich 5y agoYeah, I have no idea what that person is talking about. I'm in the same situation as you; we can compile hundreds of thousands of lines of Java code in dozens of different jars in less time than it takes for one of our frontend javascript builds to run.
- toastal 5y agoThere's a lot of garbage TypeScript libraries too. I think a lot of this just comes down to size. Smaller languages tend to focus together on maintaining and contributing just one package that does the thing. TypeScript and JavaScript as lowest common denominator languages for many scenarios means there's a lot more options for better and worse. What hurts both as well is they are multi-paradigm while the broader communities are general pushing very hard into a single paradigm which necessitates more libraries and ecosystems. Loving FP and admiring `fp-ts`'s work, I can't help but think our communities would be better off doing FP in FP languages instead of writing unergonomic and idiomatic code to much of the splintered TypeScript community. Yet, we'll writing things this way because it feels like the correct way to do software, meanwhile a bootcamper would find it incomprehensible; this same person would find an FP language more approachable because there's only one way to code it.
- skybrian 5y agoWell, don't start from node then. I like how Go does things, but I don't know if it makes sense for web development. Is Deno good?
- tored 5y agoThe problem isn’t necessarily the quality of gradle or maven but rather that you get one more build dependency, thus increasing complexity of the project.
- anotherhue 5y agoThis is a feature, Gradle is decades ahead of node build tooling.
- lostcolony 5y agoI like how, last I checked anyway, there was no way to say "install this package" with Gradle; I had to go get the URL first. There might have been a way to do it after first manually adding a repository (maven central or whatever), but I couldn't figure it out quickly. And then to upgrade to the latest I had to manually go figure out what the latest was, and manually change the line number to the latest version. I did see there's a separate plugin you can install to now add it though, built by a third party, but still. Decades.
- stickfigure 5y agoI don't understand your first bit, "install this package" isn't a thing in the java world. There are just dependencies, you don't "install" them. But this: > And then to upgrade to the latest I had to manually go figure out what the latest was Yeah, in the java world you write code against specific known dependency versions. That's why when you try to build it again in a couple months, it still works. I sure wish the JS community would learn this old trick.
- egeozcan 5y agoNPM has had package locking since what feels like a million releases. I wish the Java community (which I'm actually also a part of) would stop rejecting everything that's not "the Java/enterprise way" and be humbled by exploring better alternatives, or alternatives with different tradeoffs for once.
- catdog 5y agohttps://docs.gradle.org/current/userguide/dependency_locking.html https://docs.gradle.org/current/userguide/dependency_locking...
- lf-non 5y agoYup, gradle is a huge barrier to entry - esp. with the whole disparity between kotlin dsl and gradle dsl. At its core, gradle as a task runner is pretty neat. But the layers of abstraction built upon it often make things superhard when you need to deviate from the setup offered by the starters. While the official docs have started to show examples in both, almost always a stackoverflow answer or online blog post you find while googling is in the other dsl and converting between them is non-trivial.
- jpgvm 5y agoAll examples in the official docs (bar a few things like custom plugin development) are in Kotlin now. Also the support for the Kotlin build scripts in IDEA itself is a ton better now, it used to break all the time and desync etc but no more. Gradle certainly isn't great but it's crappiness is overblown especially when comparing it to stuff like npm + webpack.
- winter_blue 5y agoI've found Gradle to be very straightforward, intuitive, and easy to use. I switched one of my projects from Maven over to Gradle, and coming from Maven XML, the Grade configuration language/DSL was amazing and a breath of fresh air.
- lolinder 5y agoMaven to Gradle is a huge improvement, but I think a lot of people here are coming from the JS world. Package.json is incredibly simple compared to Gradle.
- kaba0 5y agoIs it? Where does my special css file go, what option is valid in this context, do I need babel, or this other 1000 package? It does tell you something that literally every framework will generate you a file, while you can easily write your build script by hand for even large java projects.
- matsemann 5y agoDisagree, maven to gradle is a downgrade. Yes, xml is boring, but it's still incredible simple, almost just a verbose package.json. And it's convention over configuration, if you do stuff like everyone else, it just works. Gradle however, is a dsl in a language almost no java devs use. All gradle files are different, so copying an example from somewhere else probably won't work in your context etc.
- foverzar 5y ago> Gradle however, is a dsl in a language almost no java devs use Gradle with Groovy sometimes gets kinda hard to comprehend Gradle with Kotlin is entirely different experience, largely due to proper typing.
- vips7L 5y agoI’m going to have to really disagree. While XML might be verbose, it’s dead simple and maven is extremely well documented. Gradle on the other hand is cryptic, relies on stack overflow to document it, and breaks your build scripts every release.
- underdeserver 5y agoYou can build Kotlin (including Kotlin.js) with Bazel: https://github.com/bazelbuild/rules_kotlin https://github.com/bazelbuild/rules_kotlin
- pjmlp 5y agoEven on the Java ecosystem, Gradle is only appealing for those that never had to fix Ant builds.
- ptx 5y agoKotlin/JS actually does work with Maven [1] – it's just all the MPP and Kotlin/Native stuff that is heavily Gradle-focused. I hope they eventually get to updating the Maven plugins once the multiplatform features stabilize. [1] https://kotlinlang.org/docs/maven.html#attributes-specific-to-js https://kotlinlang.org/docs/maven.html#attributes-specific-t...
- jillesvangurp 5y agoTechnically it might work but you are fighting an uphill battle in terms of documentation, stuff that's just not supported at all, bugs, etc. With Kotlin-js especially, I would strongly recommend to not bother with maven. It's a bit cutting edge and you'll have an easier time doing what everybody else is doing. If you go the gradle route, of course use the Kotlin Script variety. Gradle is a bit complex and having your build logic written in Kotlin seems like it is the right thing to do.
- ptx 5y ago> having your build logic written in Kotlin seems like it is the right thing to do Yes, in the abstract it does, but the but way Gradle actually does that (evaluating different parts of the program in different special and magical ways) is extremely confusing. And I don't understand how it could possible require the vast amounts of memory it does. Maven is horrifically verbose, but at least its model makes sense after learning a few key concepts and the IDE can help you work with that model without setting fire to the CPU.
- jillesvangurp 5y agoIMHO maven is not something that is actively supported by many people using Kotlin. If it works at all, good for you. Otherwise, you are on your own. I'd advice against using that with Kotlin. I have plenty of experience with maven and with ant before that. No project I've touched in the last six years used either of those other than a few conservative and, frankly, clueless/hopeless customers that I've helped out in some of my freelancing projects. I don't get pedantic about persuading customers that maven is dead as a door nail but there is a pattern of behavior of mostly elderly (i.e. my age) slightly out of their depth CTOs insisting that maven is the way to do things because that's all they know. I'm experienced enough to not fix what ain't broken. A build system either works or it doesn't. And it's not worth my hourly rate arguing against it. Anyway, it's not that hard to get them working regardless of what you use. I'm old enough to remember DOS batch files being an acceptable solution. Actually wasn't that hard to do either. I love bash shell scripts for the same reason. People get hung up on build systems performing magic that they don't understand. Maven is mostly just a really convoluted way to compile Java code which isn't even all that hard when you understand what it does. Having done that with batch files I both appreciate what maven. gradle, etc. do and recognize that it doesn't matter much at all. Gradle does most of the same things as maven with less fuss. I'm still well capable doing the same with just bash and a compiler. But it's not worth my time. These days, I spend more time on figuring out github actions than on gradle. The stuff that gradle does is only a tiny part of the business of doing CI/CD these days. Gradle is the easy part.