Scala
Learned this for CS241E. Still feel like I don’t know what it does.
The name Scala stands for “scalable language.” The language is so named because it was designed to grow with the demands of its users.
Scala allows you to explore Functional Programming without completely disregarding Functional Programming without completely disregarding Object-Oriented Programming.
https://alvinalexander.com/scala/seq-class-methods-examples-syntax/
For some reason, tuples are 1-indexed
, but everything else is 0-indexed.
var
= variable
val
= constant
Match case: https://alvinalexander.com/scala/how-to-use-if-then-expressions-guards-in-case-statements-scala/
Partial Function
First time I was exposed to this idea in scala.
val
is executed when it is defined whereas a lazy val
is executed when it is accessed the first time.
Basics
Use Array
when the size is fixed, or ArrayBuffer
for a variable size array (Dynamic Array). There also is List
List
Scala Map
I always get confused about these
Tuples can hold values of many types, but they are immutable
Higher Order Functions
Exception Handling
Scala Classes
Trait