4 ms·
> Scala is a beast and the package manager + build tools were giving me headaches. Ignore them and use maven. It's much better documented, consistent, and back
by lmm 6y ago
> Scala is a beast and the package manager + build tools were giving me headaches.
Ignore them and use maven. It's much better documented, consistent, and backwards-compatible. I struggle to understand why SBT ever gained any popularity, and it should certainly have never been recommended to newcomers.
- BossingAround 6y agoPersonally, I wouldn't recommend Maven to beginners. I would recommend beginners to learn Maven as it is one of the de-facto standards in JVM dependency management, but the documentation is highly confusing and the learning curve is very steep. Beginners will likely struggle with Maven concepts.
- lmm 6y agoI very much disagree; the only people I've known to have trouble with Maven are experienced developers who expected their build tool to work in a very specific way (i.e. that they would define a bunch of commands for it to execute and tell it what to do). For a beginner who comes to it with no preconceptions, maven is very easy: you fill in the parts your XML editor tells you to, list your dependencies, and then run one of their short list of phases for what you want to do: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#a-build-lifecycle-is-made-up-of-phases https://maven.apache.org/guides/introduction/introduction-to... . What could be simpler?
- JackFr 6y agoThe things I want to do, are they ‘goals’, ‘tasks’, ‘phases’ or ‘executions’? And do I manage my dependencies in ‘dependencies’ or ‘dependencyManagement’? And how is it that none of the ‘dependency’ goals can tell me the origin of the version - I have to use ‘help:effectivePom’? Maven is powerful and people forget how innovative it was. But it’s not easy.
- lmm 6y ago> The things I want to do, are they ‘goals’, ‘tasks’, ‘phases’ or ‘executions’? The page I linked to is pretty clear about which is which and what they do. > And do I manage my dependencies in ‘dependencies’ or ‘dependencyManagement’? You list your dependencies in dependencies, you manage them in dependencyManagement. But it's clear in the documentation, and if you're looking at a tutorial from 10 years ago then it'll still be accurate. There are confusing things in maven. But documentation and backward-compatibility go a long way, and I really think the fixed build lifecycle puts it head and shoulders above a lot of alternatives; the cost/benefit of each project having a slightly different set of build commands just doesn't stack up.
- vvillena 6y agoSBT is easy to use at the beginning, simply because the build files are 1/10 the length of a Maven XML build description, the console output looks better, the build REPL has lots of commands that make things easier, and the simple projects just work fine. Once you start to dig deeper, you find out that setting multimodule projects is still easier in SBT. And if you decide to dig deep and really learn the build tool, it doesn't really matter which one you choose. But devs that chose SBT as their Scala build tool will probably keep using it.
- lmm 6y ago> SBT is easy to use at the beginning, simply because the build files are 1/10 the length of a Maven XML build description, the console output looks better, the build REPL has lots of commands that make things easier, and the simple projects just work fine. The build REPL has lots of commands that aren't documented, and when you search for tutorials the commands have changed (e.g. runMain is apparently now run-main, and if you write runMain you get the wonderfully helpful error "Expected ';'"). There's nothing so simple as Maven's list of phases https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#a-build-lifecycle-is-made-up-of-phases https://maven.apache.org/guides/introduction/introduction-to... ; instead each project has its own slightly different set of build commands. > Once you start to dig deeper, you find out that setting multimodule projects is still easier in SBT. And if you decide to dig deep and really learn the build tool, it doesn't really matter which one you choose. Disagree. Maven multimodule projects are very simple: you can have a module that contains a list of submodules to build and... that's it. Importantly, every submodule acts exactly like a normal top-level project, so if you only ever want to work on one module you don't have to understand anything about the bigger project. And moving between single-module and multi-module projects isn't a big conceptual leap. SBT multimodule projects are not only their own unique thing, they make the above problem even more confusing, because each project has its own slightly different set of build commands, and each module has a slightly different subset of them that works. And even if you really learn it in detail, SBT is still awful on multiple levels. https://www.lihaoyi.com/post/SowhatswrongwithSBT.html https://www.lihaoyi.com/post/SowhatswrongwithSBT.html talks about the deeper problems.
- 6y ago
- aphexairlines 6y agoor gradle, or bazel. Scala doesn't require sbt, and the other build tools work well for mixed codebases (scala, java, kotlin, javascript).
- bchallenor 6y agoBazel is a nice build tool, but AFAIK it still doesn't support Scala 2.13, released mid-2019: https://github.com/bazelbuild/rules_scala/issues/809 https://github.com/bazelbuild/rules_scala/issues/809
- hocuspocus 6y agoI think Lucid (the charts, not EVs) use these internally: https://github.com/higherkindness/rules_scala https://github.com/higherkindness/rules_scala And they support Scala 2.13
- bchallenor 6y agoInteresting. Here is a comparison of the two rules_scala implementations: https://github.com/higherkindness/rules_scala/issues/261 https://github.com/higherkindness/rules_scala/issues/261
- natchy 6y agoOne of the reasons I chose F#. Too many choices for a Scala novice. Seems to be a pervasive pattern. I think Scala was actually a better choice since my company mainly does AI/ML (python) and Scala has some clout in data science. But I’m only migrating the application layer so not a deal breaker. I was leaning more towards Scala going into the “exploration phase”. —————————— Side note. Using typescript on front end, f# on back, vscode, and GitHub for repo + CI/CD. Feels nice using a single vendor (Microsoft) for dev, even though each tool is stand-alone.