Skip to content

Commit

Permalink
Scala 2 Book migration - Prelude and Preliminaries
Browse files Browse the repository at this point in the history
  • Loading branch information
gkepka committed Dec 9, 2024
1 parent dfb5b04 commit d13948f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
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 %}

0 comments on commit d13948f

Please sign in to comment.