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

Scala 2 Book migration - Prelude and Preliminaries #3127

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _overviews/scala3-book/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Scala’s syntax, grammar, and features have been re-thought, debated in an open
The book begins with a whirlwind tour of many of Scala’s features in the [“A Taste of Scala” section][taste].
After that tour, the sections that follow it provide more details on those language features.

{% comment %}
We should have a link structure on the whole tour here
{% endcomment %}
## A bit of background

Scala was created by [Martin Odersky](https://en.wikipedia.org/wiki/Martin_Odersky), who studied under [Niklaus Wirth](https://en.wikipedia.org/wiki/Niklaus_Wirth), who created Pascal and several other languages. Mr. Odersky is one of the co-designers of Generic Java, and is also known as the “father” of the `javac` compiler.

[reference]: {{ site.scala3ref }}/overview.html
[taste]: {% link _overviews/scala3-book/taste-intro.md %}
36 changes: 36 additions & 0 deletions _overviews/scala3-book/taste-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,42 @@ can be installed by following our [getting started guide][get-started].
> Alternatively you can run the examples in a web browser with [Scastie](https://scastie.scala-lang.org), a
> fully online editor and code-runner for Scala.

## Comments

One good thing to know up front is that comments in Scala are just like comments in Java (and many other languages):

{% tabs comments %}
{% tab 'Scala 2 and 3' for=comments %}
```scala
// a single line comment

/*
* a multiline comment
*/

/**
* also a multiline comment
*/
```
{% endtab %}
{% endtabs %}

## IDEs

The two main IDEs (integrated development environments) for Scala are:

- [IntelliJ IDEA](/getting-started/intellij-track/building-a-scala-project-with-intellij-and-sbt.html)
- [Visual Studio Code](https://scalameta.org/metals/docs/editors/vscode/)

## Naming conventions

Another good thing to know is that Scala naming conventions follow the same “camel case” style as Java:

- Class names: `Person`, `StoreEmployee`
- Variable names: `name`, `firstName`
- Method names: `convertToInt`, `toUpper`

More on conventions used while writing Scala code can be found in the [Style Guide](/style/index.html).

[reference]: {{ site.scala3ref }}/overview.html
[get-started]: {% link _overviews/getting-started/install-scala.md %}