Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New getting-started series #608

Merged
merged 2 commits into from
Jul 13, 2017
Merged

Conversation

travissarles
Copy link
Contributor

No description provided.

@lrytz
Copy link
Member

lrytz commented Feb 28, 2017

Very nice! While looking at the preview of #606, this was exactly the kind of information I found missing on the current website.

I think the command-line/sbt vs InteliJ split is a bit too strict: I would personally create a new project with sbt new and then open it up in IntelliJ. In practice I often switch between the two, sometimes running (and debugging!) tests within IJ, sometimes running them on the console.

It also shows in your texts: there's duplication in two pages in "Let's go over this line by line".

Another thing: It would be nice to introduce the REPL and IntelliJ worksheets.

@heathermiller
Copy link
Member

Hey @lrytz there was actually a raging debate at the SC about whether or not to start with sbt new in the IntelliJ tutorial.

Even though all of us who actually use Scala to do real things would prefer to start with sbt new, we ended up trying to keep the first IntelliJ tutorial sbt-free, so as not to overwhelm newcomers with setup instructions. For "Hello, World!" and most other basic exercises that one would do when learning Scala, just using IntelliJ only is sufficient. That was the idea anyway – we all kind of agreed that it would make sense to say "well if you want to do anything real, like adding dependencies, etc, you're going to need sbt" but for the first breath of experience with Scala we thought that it was enough to try to keep setup as minimal as possible, which meant no sbt in step 0 of IntelliJ.

@SethTisue
Copy link
Member

we ended up trying to keep the first IntelliJ tutorial sbt-free

👍

perhaps there's somewhere Lukas's remarks could be incorporated anyway, like in a sort of footnote or aside later on.

@lrytz
Copy link
Member

lrytz commented Feb 28, 2017

OK, I see. Maybe a middle ground would be to merge the two paths where it talks about adding tests, to avoid some duplication? Also, the sbt/console section could mention that it's easy (and recommended?) to import an sbt project into IJ.

@travissarles
Copy link
Contributor Author

@heathermiller ready to merge

@@ -0,0 +1,94 @@
# Building a Scala project with IntelliJ and sbt

In this tutorial, we'll see how to build a Scala project [sbt](http://www.scala-sbt.org/0.13/docs/index.html). sbt is the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing word here ("with" or "using" sbt)

# Building a Scala project with IntelliJ and sbt

In this tutorial, we'll see how to build a Scala project [sbt](http://www.scala-sbt.org/0.13/docs/index.html). sbt is the
de facto tool for compiling, running, and testing Scala projects of any
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit concerned here about giving the impression that sbt is your only choice and e.g. maven and gradle aren't also options. Suggested:

  • change "de facto" to "a common, standard"
  • change "It becomes essential" to "Using a build tool becomes essential"
  • add some words like "Maven, Gradle, and other popular build tools can also build Scala projects."

## Creating the project
In this section, we'll show you how to create the project in IntelliJ. However, if you're
comfortable with the command line, we recommend you try [Getting
started with Scala with sbt in the command line](https://link) and then come back
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing link here

sbt creates many directories which can be useful once you start building
more complex projects. You can ignore most of them for now
but here's a glance at what everything is for:
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need a blank line before the triple backquotes

extra functionality to our apps.
1. Open up `build.sbt` and add the following line:
```
libraryDependencies += "org.typelevel" %% "cats" % "0.9.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid I don't think this is a good choice of example library. I would suggest a Scala module such as scala-xml or scala-parser-combinators.

* Change the code in the class to the following:
```tut
object Hello extends App {
println("Hello, World!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent 2 spaces, not 4

There are multiple libraries and testing methodologies for Scala,
but in this tutorial, we'll demonstrate one popular option from the scalatest framework
called [FunSuite](http://www.scalatest.org/getting_started_with_fun_suite).
We assume you know [how to build a project in IntelliJ](https://linktotutorial).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs proper link

```
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
```
* this will cause sbt to pull down the scalatest library
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/scalatest/ScalaTest/


## Conclusion
You've seen one way to test your Scala code. You can learn more about
scalatest's FunSuite on the [official website](http://www.scalatest.org/getting_started_with_fun_suite).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest adding: Other popular testing frameworks for Scala include ScalaCheck (link) and Specs2 (link).

@ashawley
Copy link
Member

ashawley commented Apr 24, 2017

This looks really helpful. I tried running it locally, but didn't get far. Seems the following are needed:

  1. Rename files to .md for consistencies sake?
  2. Add front matter
  3. These are new pages, but how do you get to them? Link(s) from main getting started page?
  4. Maybe rebase against master? Seems this branch is 346 commits behind master.

@travissarles
Copy link
Contributor Author

@ashawley thanks for the review. I will do those things.

@heathermiller
Copy link
Member

Will finish this.

@heathermiller heathermiller self-assigned this Jul 13, 2017
@heathermiller heathermiller merged commit fc0d110 into scala:master Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants