6 ms·
I have found that the issue isn't the language, it's the ecosystem. If you're coming from Java environment set up is not such a big deal, but if your brand new
by JackFr 11y ago
I have found that the issue isn't the language, it's the ecosystem. If you're coming from Java environment set up is not such a big deal, but if your brand new it is not as easy as other languages.
- lmm 11y agoThere are certainly poor libraries and bad advice going around (why people tell beginners to use SBT or ScalaTest is beyond me), but that happens in every language. IME the average quality on maven central is if anything better than on PyPi/rubygems/npm/etc., and the IDEs/profilers/debuggers are better than anything you can get for the other languages.
- eeperson 11y agoI can think of some very good reasons to suggest SBT to beginners. Probably the most useful features, in this regard, is that a folder with some Scala files in it is a valid SBT project. You don't even need a build configuration file. This is substantially less work than setting up a Scala project through Gradle, Maven, Ant or an IDE. Also, if you use SBT through Activator[1] you get project templates and an automatically configured IDE. [1] - https://www.lightbend.com/community/core-tools/activator-and-sbt https://www.lightbend.com/community/core-tools/activator-and...
- lmm 11y ago> I can think of some very good reasons to suggest SBT to beginners. Probably the most useful features, in this regard, is that a folder with some Scala files in it is a valid SBT project. You don't even need a build configuration file. Sounds horribly magic/incomprehensible. > This is substantially less work than setting up a Scala project through Gradle, Maven, Ant or an IDE. I don't think the work of doing it in Maven with an IDE could be called substantial. Push the button, choose the scala template, give it a groupId and artifactId, done.
- airless_bar 11y agoMan, you really need to get over your SBT hate. Maven and Ant are barely maintained anymore despite so many broken things. Just compare artifact resolution/download speed between Maven/Ivy and sbt with coursier. There is no way in hell I'll ever touch Maven again. SBT works without a single line of configuration, and that IDEs are not able to touch config files is a big fat benefit. Eclipse developers can't even turn it into a working editor. I certainly don't want Eclipse to deal with my project configuration.
- lmm 11y agoI'll get over my hate when every setting is documented, every operator is documented in a searchable way (which probably means replacing most of them or writing their own search engine), and build definitions are no longer turing-complete. Until then, Maven's a much better option.
- eeperson 11y ago> Sounds horribly magic/incomprehensible How is compiling everything in a given directory any more magic/incomprehensible than any other build tool? > I don't think the work of doing it in Maven with an IDE could be called substantial. Push the button, choose the scala template, give it a groupId and artifactId, done What IDE comes with a 'scala template' out of the box? What if you are not already in the JVM ecosystem? With SBT, the set up is: - Install SBT/Activator With your suggested equivalent, the steps are: - Install Maven - Install IDE - Install Scala IDE plugin I think the SBT option sounds like they would be much less imposing for a beginner.
- deleted 11y ago[deleted]
- the_af 11y agoOut of curiosity, what's wrong with ScalaTest? I particularly like the WordSpec style, which is easy to write and looks newbie-friendly. It's true SBT is not suitable for beginners. Regrettably, neither is Maven. I don't know which tool is...
- lmm 11y agoI find it makes tests much less comprehensible (and gives them worse IDE integration) than JUnit; it uses gratuitous operator overloading style with e.g. "should". And for a beginner it doesn't really offer any advantage - if you're using generators or the like I can see it might be helpful, but for basic unit testing I find straightforward code with JUnit is much easier.
- joshlemer 11y agoUsing the natural language style assertions is optional though, and only work if you incorporate the 'Matchers' trait in your tests. If that's too magical, you can still use plain old assertions or one of the other styles here http://www.scalatest.org/user_guide/using_assertions http://www.scalatest.org/user_guide/using_assertions
- lmm 11y agoEverything is optional, which is a nightmare for consistency. Using JUnit there's only one style of testing and every test follows it.
- the_af 11y agoYou can do what we did in my team: decide on a style of testing and stick to it (in our case, I liked WordSpec). With JUnit you can't do this, because there is only one style. I particularly liked the "should", "must", "where", etc. DSL. If I remember correctly, this style of testing comes from the Rails community. I guess it's a matter of taste, but I would definitely recommend it to newbies.
- mafribe 11y agoI've found that Scala beginners google around, and come across lot's of blog posts extolling the virtues of Scalaz, implicits, using higher kinded types, embedding DSLs and so forth. All that is worthwhile, but not really accessible to beginners. It's understandable that Scala bloggers want to write about cutting-edge material, but this misleads beginners, who think you need to use Scalaz, monads and the like to be productive. Nothing could be further from the truth.