Skip to content

Commit 6230bc9

Browse files
authored
Remove mentions of generated code + reworded last paragraph
1 parent 2dfa9c4 commit 6230bc9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tutorials/tour/case-classes.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ They are equal!
7676
SMS is: SMS(12345, Hello!)
7777
```
7878

79-
With Case Classes, all the necessary machinery required for using them in **Pattern Matching** is automatically generated by the compiler.
80-
Here's a function that prints out different messages depending on what type of Notification is received:
79+
With Case Classes, you can utilize **Pattern Matching** to work with your data. Here's a function that prints out different messages depending on what type of Notification is received:
8180

8281
```tut
8382
def showNotification(notification: Notification): String = {
@@ -131,7 +130,10 @@ val specialSms = SMS("55555", "I'm here! Where are you?")
131130
132131
```
133132

134-
_Case Classes_ is one of the biggest reasons why Scala code can be both concise and readable. With immutability and structural equality, working with
135-
case classes are just like working with primative values (Int, Double, etc), which in turn makes writing programs in a functional style much simpler
136-
and intuitive.
133+
When programming in Scala, it is recommended that you use Case Classes pervasively to model/group data as they help you to write more expressive and maintainable code:
134+
135+
* Immutability frees you from needing to keep track of where and when things are mutated
136+
* Comparison-by-value allows you compare instances as if they are primitive values - no more uncertainty regarding whether instances of a class is compared by value or reference
137+
* Pattern Matching makes branching logic simpler, which means less bugs and more readable code.
138+
137139

0 commit comments

Comments
 (0)