Martin Odersky
More books by Martin Odersky…
Upcoming Events
No scheduled events.
Add an event.
“Inheriting from Application is shorter than writing an explicit main method, but it also has some shortcomings. First, you can't use this trait if you need to access command-line arguments, because the args array isn't available. For example, because the Summer application uses command-line arguments, it must be written with an explicit main method, as shown in Listing 4.3. Second, because of some restrictions in the JVM threading model, you need an explicit main method if your program is multi-threaded. Finally, some implementations of the JVM do not optimize the initialization code of an object which is executed by the Application trait. So you should inherit from Application only when your program is relatively simple and single-threaded.”
― Programming in Scala
― Programming in Scala
“You may be wondering why you can't access the elements of a tuple like the elements of a list, for example, with "pair(0)". The reason is that a list's apply method always returns the same type, but each element of a tuple may be a different type: _1 can have one result type, _2 another, and so on.”
― Programming in Scala
― Programming in Scala
“A method that is executed only for its side effects is known as a procedure.”
― Programming in Scala: A Comprehensive Step-by-Step Guide, Third Edition
― Programming in Scala: A Comprehensive Step-by-Step Guide, Third Edition
Topics Mentioning This Author
topics | posts | views | last activity | |
---|---|---|---|---|
Java Programming: 2020 April/May Programming in Scala | 1 | 2 | Apr 03, 2020 07:29AM |
Is this you? Let us know. If not, help out and invite Martin to Goodreads.