Since I have started to learn this language I've noticed that there are several ways to write a main method in order to run your code. What is the most used and best one?
This
object SO extends App {
//Your main method's code goes here, since we have extended App
}
or
object SO {
// here goes the main
def main(args: Array[String]): Unit = {}
}
Personally I prefer the second one, as it distinguishes the main method more clearly.