The book doesn't offer a day 4, my school, however, does. Or rather, it wants us to "create" a day 4. The main objective of day 4 is to "create a [smart](https://en.wikipedia.org/wiki/SMART_criteria) goal which fits the language and challenges you". For this purpose I came up with the following goal:
> For the "4th" day in the "Seven Languages in Seven Weeks" book, I want to create a sitemap builder which prioritises URLs based on their number of occurrences.
I picked this specific goal because Scala has awesome functionality for collections, as such it should make creating a site map a piece of cake! All the code I created for this fourth day can be found on [Github](https://github.com/Mastermindzh/Seven-Languages-in-Seven-Weeks/blob/master/Scala/Day%204/src/main/scala-2.12/MyApp.scala) or at the end of this blog post.
## My journey with Scala (and the book...)
Scala, for the most part, is pretty ok. The development tools aren't up to par with those of say Java, Python or even .net but with a bit of hassle, we can make do. The Scala collections are wicked though! I've done some really crazy things using the collections already and I'm sure there is more to come. (if anyone ever wants me to write a bit of Scala that is)
The concurrency chapter was a big failure, the book is old (2010) and covers the older API. This meant that I had to cast aside the book and create the examples with the new API myself. A drag, to say the least.
As far as functional goes, my opinion hasn't changed much. I still prefer OO, maybe because I grew up doing everything the OO way or maybe because functional programming is just not for me. Whatever the case I still prefer OO. But.... I've gained a new appreciation for the functional languages so I guess you could call this experiment a success.
Anyways, that was it for me guys, hope you enjoyed and see you later!
```scala
import java.io.{File, PrintWriter}
import scala.collection.immutable.ListMap
import scala.io.Source
object PageLinkLoader {
//I stole this regex from somewhere for a previous project, don't remember where
// regex commented out because pretify can't handle it